Skip to content

Commit

Permalink
Mask out the two lower bits from the method list header entsize
Browse files Browse the repository at this point in the history
  • Loading branch information
0xced committed Mar 6, 2013
1 parent 0a1e552 commit e81a174
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/CDObjectiveC2Processor.m
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ - (NSArray *)loadMethodsAtAddress:(uint64_t)address;

struct cd_objc2_list_header listHeader;

listHeader.entsize = [cursor readInt32];
// See getEntsize() from http://www.opensource.apple.com/source/objc4/objc4-532.2/runtime/objc-runtime-new.h
listHeader.entsize = [cursor readInt32] & ~(uint32_t)3;
listHeader.count = [cursor readInt32];
NSParameterAssert(listHeader.entsize == 3 * [self.machOFile ptrSize]);

Expand Down

0 comments on commit e81a174

Please sign in to comment.