When I open the iOS framework AddressBook with IDA, I get the following code:
**__ABPeoplePickerNavigationController_initAsAddressBook_withAddressBook__
var_C= -0xC
PUSH {R7,LR}
MOV R7, SP
SUB SP, SP, #4
MOVW R1, #0x2B06
MOV.W R12, #0
MOVT.W R1, #0xB
STR.W R12, [SP,#0xC+var_C]
ADD R1, PC
LDR R1, [R1]
BLX _objc_msgSend
ADD SP, SP, #4
POP {R7,PC}
; End of function __ABPeoplePickerNavigationController_initAsAddressBook_withAddressBook__**
How can get to know what selector is stored in R1 before _objc_msgSend() called.
With some help from Internet, I do the following things:
After MOVW R1, #0x2B06 and MOVT.W R1, #0xB, I got the R1=0x000B2B06
After ADD R1, PC, I got R1=0x000B2B06+PC(A13A)+4=0x000BCC44, where A13A is the address of ADD R1, PC
the content near that address is:
__objc_selrefs:000BCC44 DCD aInitasaddres_0 ; "initAsAddressBook:withAddressBook:withS"... __objc_selrefs:000BCC48 DCD aDefaultstylepr ; "defaultStyleProviderForStyle:" __objc_selrefs:000BCC4C DCD aInitwithnaviga ; "initWithNavigationController:" __objc_selrefs:000BCC50 DCD aSetupinitialst ; "setupInitialStackAndLoadState:"
So I got the selector "initAsAddressBook:withAddressBook:withS...",
4.But when I log the workflow I got that "setupInitialStackAndLoadState:" was actually called.
Is there anything wrong with my method to get the selector?