Microsoft Word - iOSAppReverseEngineering.docx

(Romina) #1
R0-R3 Passes arguments and return values
R7 Frame pointer, which points to the previously saved stack frame and the
saved link register
R9 Reserved by system before iOS 3.0
R12 IP register,used by dynamic linker
R13 Stack Pointer, i.e. SP
R14 Link Register, i.e. LR, saves function return address
R15 Program Counter, i.e. PC

We’re not writing ARM assembly yet, so treat the above table as a reference would be


enough.


-^ Branches


The process saves the address of the next instruction in PC register. Usually, CPU will


execute instructions in order. When it has done with one instruction, PC will increase 1 to point


to the next instruction, as shown in figure 6-2.


Figure 6-2 Execute instructions in order


The processor will execute instructions from 1 to 5 in a plain and trivial way. However, if


we change the value of PC, the execution order will be very different, as shown in figure 6-3.

Free download pdf