Why does IDA show a method that a class-dump can't? And why can't I hook it?

453 Views Asked by At

When doing a class-dump on Instagram (v7.7), I am confused on why in this class, the method declaration for "sponsoredContext" is missing. In comparison, IDA shows the "-(char)sponsoredContext" method.

Class Dump result:

@interface IGFeedItemTimelineLayoutAttributes : XXUnknownSuperclass {
    BOOL _sponsoredContext;
    BOOL _showExploreContext;
    BOOL _showTimeStampOnFirstLayoutElement;
    IGFeedItem* _feedItem;
    NSArray* _rowItems;
}
@property(retain, nonatomic) NSArray* rowItems;
@property(assign, nonatomic) BOOL showTimeStampOnFirstLayoutElement;
@property(assign, nonatomic) BOOL showExploreContext;
@property(assign, nonatomic) BOOL sponsoredContext;
@property(retain, nonatomic) IGFeedItem* feedItem;
-(void).cxx_destruct;
-(id)commentForTextTimelineRow:(int)textTimelineRow;
-(int)cellTypeForTextTimelineRow:(int)textTimelineRow;
-(int)numberOfTextRowsInTimeline;
-(id)initWithFeedItem:(id)feedItem sponsoredContext:(BOOL)context showExploreContext:(BOOL)context3 showTimeStampOnFirstLayoutElement:(BOOL)element;
@end

IDA result:

IGFeedItemTimelineLayoutAttributes - (char)sponsoredContext
char __cdecl -[IGFeedItemTimelineLayoutAttributes sponsoredContext](struct IGFeedItemTimelineLayoutAttributes *self, SEL)
__IGFeedItemTimelineLayoutAttributes_sponsoredContext_

MOV             R1, #(_OBJC_IVAR_$_IGFeedItemTimelineLayoutAttributes._sponsoredContext - 0x15C64)
ADD             R1, PC
LDR             R1, [R1]
LDRSB           R0, [R0,R1]
BX              LR
End of function -[IGFeedItemTimelineLayoutAttributes sponsoredContext]

Also, when I try to hook this method using Logos:

%hook IGFeedItemTimelineLayoutAttributes
-(BOOL)sponsoredContext{
    NSLog(@"Text:%d", %orig());
    return %orig();
}
%end

Cydia Substrate gives me the error:

MS:Warning: message not found [IGFeedItemTimelineLayoutAttributes sponsoredContext:]

How can I hook this method? Why doesn't class-dump show it, but IDA does? What's special about this method?

Thanks in advance.

0

There are 0 best solutions below