Tooling#
The everyday toolbox for writing, reading, and debugging machine code.
Assemble and link#
$ nasm -felf64 prog.asm -o prog.o
$ ld prog.o -o prog
$ as prog.s -o prog.o && ld prog.o -o prog
Disassemble#
$ objdump -d -M intel prog
$ objdump -d -M intel -j .text prog
$ ndisasm -b 64 prog
$ readelf -a prog
Debug#
$ gdb ./prog
$ gdb -tui ./prog
$ gef --args ./prog
$ pwndbg ./prog
Reverse-engineering platforms#
Tool |
Notes |
|---|---|
|
Open-source RE framework; CLI + |
|
Friendly fork of radare2; ships with the Cutter GUI. |
|
NSA’s open-source decompiler + SRE platform; great UI. |
|
Industry-standard commercial disassembler / decompiler. |
|
Commercial; strong API for analysis plugins. |
|
macOS / Linux commercial disassembler. |
Static / dynamic analysis#
strings, pull printable text out of a binary.nm, list symbols.ltrace/strace, trace library / syscall calls.perf, CPU profiler with hardware-counter samples.valgrind, memory error detection (Memcheck) and call profiler (Callgrind).Compiler Explorer, compile and diff assembly across compilers, languages, and flags.