I have a mach-o binary and using llvm-objdump
version 9 I can disassemble it. I would like to disassemble only a single function though.
If I display the symbol table with --syms
I can see the function I would like to disassemble:
0000000100005a54 l F __TEXT,__text -[ViewController isValidPin:]
however I cannot work out the proper command to do this.
I have tried the following options which all just result in the usage being displayed and no indication what the issue is with the command:
llvm-objdump-9 --dis-symname "-[ViewController isValidPin:]"
llvm-objdump-9 --macho --dis-symname "-[ViewController isValidPin:]"
llvm-objdump-9 --macho --dis-symname "isValidPin"
llvm-objdump-9 --macho --dis-symname "- isValidPin"
llvm-objdump-9 --macho --dis-symname "- isValidPin:"
llvm-objdump-9 --macho --dis-symname "-isValidPin:"
If I use --disassemble-functions
with all of the above variations on the command name it just shows all the disassembly and not just isValidPin
, including if I add the --demangle
flag.
If I try and do it using --start address, i.e.:
llvm-objdump-9 --macho --start-address=100005a54
or 0x100005a54
I get the following error:
llvm-objdump-9: for the --start-address option: '100005a54' value invalid for ulong argument!
If I convert that to decimal instead it just shows the usage again. If I add a stop address as well it shows the usage regardless of whether that is in hex or dec.
I came across this similar question however it is trying to do this on macOS and also the answer there is just suggesting what I have tried.
The only other mention I can find of llvm-objdump
on here is me answering another question.
Googling just seems to lead me to different versions of the man page or discussion on commits to the source.