Files

24 lines
720 B
Diff
Raw Permalink Normal View History

2024-10-05 05:37:29 -04:00
diff --git a/dspci/DataTypeHandler.m b/dspci/DataTypeHandler.m
index c9815b7..67c4ce8 100644
--- a/dspci/DataTypeHandler.m
+++ b/dspci/DataTypeHandler.m
@@ -15,6 +15,8 @@
#import "Tables.h"
+#import <mach-o/ldsyms.h>
+
#define kPCIFormat @"%04lX:%04lX"
@implementation DataTypeHandler
@@ -95,7 +97,8 @@ - (int) handleDataType: (NSString *)dataType {
*/
- (NSString *) loadPCIIDs {
unsigned long len;
- char *handle = strdup(getsectdata("__TEXT", "__pci_ids", &len));
+ const struct mach_header_64 *mh = &_mh_execute_header;
+ char *handle = strdup((char *) getsectiondata(mh, "__TEXT", "__pci_ids", &len));
NSNumber *currentClass;
NSNumber *currentVendor;
char buffer[LINE_MAX];