diff --git a/Source/CDMachOFile.m b/Source/CDMachOFile.m index 3d6656a1..f3e2e7b7 100644 --- a/Source/CDMachOFile.m +++ b/Source/CDMachOFile.m @@ -558,7 +558,8 @@ - (BOOL)hasObjectiveC2Data; // 0xced: @gparker I was hoping for a flag, but that will do it, thanks. // 0xced: @gparker Did you mean __DATA,__objc_imageinfo instead of __DATA,__objc_info ? // gparker: @0xced Yes, it's __DATA,__objc_imageinfo. - return [[self segmentWithName:@"__DATA"] sectionWithName:@"__objc_imageinfo"] != nil; + return [[self segmentWithName:@"__DATA"] sectionWithName:@"__objc_imageinfo"] != nil || + [[self segmentWithName:@"__DATA_CONST"] sectionWithName:@"__objc_imageinfo"] != nil; } - (Class)processorClass; diff --git a/Source/CDObjectiveC2Processor.m b/Source/CDObjectiveC2Processor.m index 4bc07cf9..c9de91a0 100644 --- a/Source/CDObjectiveC2Processor.m +++ b/Source/CDObjectiveC2Processor.m @@ -28,6 +28,8 @@ @implementation CDObjectiveC2Processor - (void)loadProtocols; { CDSection *section = [[self.machOFile segmentWithName:@"__DATA"] sectionWithName:@"__objc_protolist"]; + if (section == nil) + section = [[self.machOFile segmentWithName:@"__DATA_CONST"] sectionWithName:@"__objc_protolist"]; CDMachOFileDataCursor *cursor = [[CDMachOFileDataCursor alloc] initWithSection:section]; while ([cursor isAtEnd] == NO) @@ -37,6 +39,8 @@ - (void)loadProtocols; - (void)loadClasses; { CDSection *section = [[self.machOFile segmentWithName:@"__DATA"] sectionWithName:@"__objc_classlist"]; + if (section == nil) + section = [[self.machOFile segmentWithName:@"__DATA_CONST"] sectionWithName:@"__objc_classlist"]; CDMachOFileDataCursor *cursor = [[CDMachOFileDataCursor alloc] initWithSection:section]; while ([cursor isAtEnd] == NO) { @@ -51,6 +55,8 @@ - (void)loadClasses; - (void)loadCategories; { CDSection *section = [[self.machOFile segmentWithName:@"__DATA"] sectionWithName:@"__objc_catlist"]; + if (section == nil) + section = [[self.machOFile segmentWithName:@"__DATA_CONST"] sectionWithName:@"__objc_catlist"]; CDMachOFileDataCursor *cursor = [[CDMachOFileDataCursor alloc] initWithSection:section]; while ([cursor isAtEnd] == NO) { @@ -490,7 +496,11 @@ - (NSArray *)protocolAddressListAtAddress:(uint64_t)address; - (CDSection *)objcImageInfoSection; { - return [[self.machOFile segmentWithName:@"__DATA"] sectionWithName:@"__objc_imageinfo"]; + CDSection *section = [[self.machOFile segmentWithName:@"__DATA"] sectionWithName:@"__objc_imageinfo"]; + if (section == nil) + section = [[self.machOFile segmentWithName:@"__DATA_CONST"] sectionWithName:@"__objc_imageinfo"]; + + return section; } @end