Skip to content

pwndbg overview

pwndbg extends GDB with compact views and commands useful for binary analysis. It remains GDB: use GDB’s help and apropos for standard commands, and pwndbg’s help or theme for extension behavior. Output can differ across pwndbg versions and themes.

For a one-screen lookup of command syntax, example usage, and when each command is useful, see the GDB and pwndbg command glossary.

Terminal window
gdb -q ./chall
set disassembly-flavor intel
start
context

When execution stops, the context view commonly includes registers, nearby disassembly, stack data, and code references. If it is not shown, inspect context settings and use direct commands such as regs, nearpc, and telescope.

  1. Run checksec to record the binary’s protections.
  2. Start at main, or use starti when symbols are missing.
  3. Locate input-handling code with Ghidra, then set a breakpoint around the relevant function.
  4. Step with ni or si; inspect values and memory after each meaningful operation.
  5. On a crash, inspect the instruction pointer, stack pointer, and saved control data before restarting.
Goal GDB command pwndbg command/view
Start or continue run, continue same
Break at a function break main same
Step one instruction ni, si same
Show current stop summary GDB has separate register/stack commands context
Show registers info registers regs
Disassemble nearby code x/12i $rip nearpc
Inspect pointed-to data x/32gx $rsp telescope $rsp
Show process mappings info proc mappings vmmap

context refreshes pwndbg’s summary after each stop. regs prints register values, nearpc prints instructions around the current instruction pointer, telescope follows pointer-like values in memory, and vmmap lists the process’s memory mappings. The focused pages below explain the arguments and when each view is useful.

Command names and arguments can change. Use help COMMAND in the installed version when a command behaves differently from these examples.

pwndbg documentation and its command reference are the source of truth for the installed release.