Definition
Dynamic Binary Analysis
Dynamic binary analysis is binary analysis performed by running the program — typically under a debugger or system-call/library-call tracer, often in a sandbox — and observing its runtime behaviour. It complements static analysis: where static analysis reveals only what the disassembler can recover, dynamic analysis shows the program’s actual state evolution, arguments actually passed, and code paths actually taken.
Tracers
Two non-debugger tracers
Tool What it traces straceevery system call the program makes, with arguments and return values ltraceevery library call the program makes (e.g. strcmp,malloc)Both are read-only observatories — they do not let you step or modify state, but they answer “what is the program asking the OS / lib for?” with no setup. Running
strace ./password_managerreveals that the program expects the password as an argument; runningltrace ./password_manager asdfreveals thestrcmpagainst the actual password.
GDB
The GNU debugger
gdbruns a program under a debugger where execution can be frozen, inspected, and modified. The core commands:
Command Effect runrun the loaded program as if from the command line break <where>set a breakpoint at an address; execution freezes when it is hit continueresume execution after a breakpoint info registers/info frameshow register contents / the current stack frame x/<nuf> <what>nunits of formatffrom addresswhat(e.g.x/1gx $rax— one giant word, hex, fromrax)disassemble <func>disassemble the named function pprint the value of an expression setchange a gdb setting or set a value inside program memory set disassembly-flavor inteloutput disassembly in Intel syntax nexti/nistep over the next instruction stepi/sistep into the next instruction (follow calls)
pwndbg
A GDB plugin made for reverse engineering
pwndbgis a GDB plugin that adds commands and context displays suited to exploit development. All plaingdbcommands work; the plugin layers usability on top:
context— summarizes the current execution context (registers, stack, code) in one view;telescope— displays memory dumps and recursively dereferences pointers;search— searches for bytes, strings, integers, or pointers in the program’s memory space.
Tampering With State
The advantage of dynamic over static
A debugger can also modify state, which static analysis cannot. The slide demonstrates this on
password_manager_v2: after the call tostrcmp, setting theRAXregister to0withset $rax = 0makes the subsequent check behave as if the strings had compared equal, becausestrcmpreturns0on equality. That bypasses the password check without ever recovering the password itself — a clean illustration of the difference between defeating a check and understanding the program.