From 70631e160dcbaf6b43d33654d52ca96655509534 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Tue, 23 Jan 2024 00:41:11 +0100 Subject: objdump: disasm specific sym, visualize jumps --- src/binary/objdump.md | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/binary/objdump.md b/src/binary/objdump.md index a76a327..6f17cb5 100644 --- a/src/binary/objdump.md +++ b/src/binary/objdump.md @@ -2,13 +2,15 @@ ```markdown objdump [opts] - -M intel use intil syntax - -d disassemble text section - -D disassemble all sections - -S mix disassembly with source code - -C demangle - -j
display info for section - --[no-]show-raw-insn [dont] show object code next to disassembly + -M intel use intil syntax + -d disassemble text section + -D disassemble all sections + --disassemble= disassemble symbol + -S mix disassembly with source code + -C demangle + -j
display info for section + --[no-]show-raw-insn [dont] show object code next to disassembly + --visualize-jumps[=color] visualize jumps with ascii art, optionally color arrows ``` ## Disassemble section @@ -54,3 +56,14 @@ objcopy -O binary --only-section .text test test-bin # Disassemble raw binary. objdump -D -b binary -m i386:x86-64 test-bin ``` + +## Example: disassemble specific symbol +```bash +# Disassemble main(). +objdump --disassemble=main +# Disassemble 'foo::bar()' (mangled). +objdump --disassemble=_ZN3foo3barEvr + +# Disassemble 'foo::bar()' (demangled), requires -C +objdump -C --disassemble=foo::bar +``` -- cgit v1.2.3