Microsoft Word - iOSAppReverseEngineering.docx

(Romina) #1
<UITouchesEvent: 0x176a8ce0> timestamp: 58147.4 touches: {(
<UITouch: 0x1895e2b0> phase: Ended tap count: 1 window: <UIWindow: 0x17759c30; frame
= (0 0; 320 568); gestureRecognizers = <NSArray: 0x1775c7a0>; layer = <UIWindowLayer:
0x1752e190>> view: <UIToolbarButton: 0x1776ff50; frame = (285 0; 23 44); opaque = NO;
gestureRecognizers = <NSArray: 0x17758670>; layer = <CALayer: 0x17770160>> location in
window: {308, 534} previous location in window: {304.5, 534} location in view: {23, 10}
previous location in view: {19.5, 10}
)}

The first 4 arguments of objc_msgSend, i.e. R0~R3 are intuitive. They’re self,


@selector(sendAction:to:from:forEvent:), the argument of sendAction:, and the argument of


to:. One thing to mention is that when I entered “po $r2”, LLDB said “no Objective-C


description available”, indicating R2 wasn’t an Objective-C object. Thus, combining with the


meaning of “action”, I guessed it was a SEL, so I used “p (char *)$r2” to print it. How to analyze


those arguments in the stack? Because SP points to the bottom of stack while the rest 2


arguments are on the stack, and they are both one word long, I’ve printed out the continuous 10


words from the bottom of the stack using “x/10 $sp”, and the first 2 were the arguments on


stack. Most Objective-C arguments are one word long pointers, which point at Objective-C


objects, so I’ve “po”ed the first 2 words, they were the arguments. For ease of understanding,


the relationship of SP, values on the stack and arguments are shown in figure 6-26.

Free download pdf