3

I cannot make objdump on macOS Catalina start disassembling from a specified address using the option -stop-address=. Instead, objdump disassembles ALL executable code in the Mach-O file:

nlykkei-mbp:~ nlykkei$ objdump -macho -d -stop-address=0x1514 /usr/lib/system/libsystem_c.dylib | head -n10
/usr/lib/system/libsystem_c.dylib:
(__TEXT,__text) section
mcount:
    1508:   55  pushq   %rbp
    1509:   48 89 e5    movq    %rsp, %rbp
    150c:   48 83 ec 40     subq    $64, %rsp
    1510:   48 89 04 24     movq    %rax, (%rsp)
    1514:   48 89 7c 24 08  movq    %rdi, 8(%rsp)
    1519:   48 89 74 24 10  movq    %rsi, 16(%rsp)
    151e:   48 89 54 24 18  movq    %rdx, 24(%rsp)

How can I fix this?

Shuzheng
  • 11,288
  • 20
  • 88
  • 186

1 Answers1

0

If there is a symbol table in the Mach-O file then you could look up a nearby symbol with nm and then try:

--disassemble=symbol

Olsonist
  • 2,051
  • 1
  • 20
  • 35