Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

objc_msgsend in iPhone disassembly

I'm trying to figure out what method is being called in the following bit of disassembly but I have no idea what's happening. I understand that with objc_msgsend the first argument is the object pointer and the second is the selector (so r0 and r1). But I'm having trouble figuring this out. Here's just the section before the call where r1 is being configured:
00042e48 f64731bc movw r1, 0x7bbc
00042e4c f2c0011f movt r1, 0x1f
00042e50 4479 add r1, pc
00042e52 6809 ldr r1, [r1, #0]
00042e54 f1c2e84a blx 0x204eec @ symbol stub for: _objc_msgSend
From my understanding of this the first two lines would make r1 equal 1f007bbc but what can I do from there? Edit: Also, what does adding r1 and the pc do? And what does the line after that do? And I've tried "otool -o SpringBoard" but that doesn't give me the selectors (don't know what it is but it isn't what I'm looking for)
Edit 2: Actaully, -o does give me all the methods (I got loads of random methods from the headers and searched them in the terminal window and they were there). However a search for "1f007bbc" didn't return anything. Did I get the number right?

like image 224
Johnathon Avatar asked Oct 24 '22 00:10

Johnathon


1 Answers

If you have access to the debugger, you should be able to p (char*) 1f007bbc and it'll print the selector name.

The selectors are generally constant and, thus, you should be able to extract this from the binary, too, by taking apart the mach-o.

like image 132
bbum Avatar answered Nov 15 '22 12:11

bbum