Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Source/CDMachOFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 11 additions & 1 deletion Source/CDObjectiveC2Processor.m
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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) {
Expand All @@ -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) {
Expand Down Expand Up @@ -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