Skip to content

radare2

25 commands

A complete command-line reverse-engineering framework: disassemble, debug, patch and analyse binaries for many architectures.

  • disassembly
  • debugging
  • binary analysis

Install radare2

sudo apt install radare2

Opening7

r2 <binary>

Opens a binary read-only.

Link
r2 -A <binary>

Opens and runs full analysis (same as aaa) — slower but finds functions and references.

Link
r2 -d <binary>

Opens in debug mode.

Link
r2 -w <binary>

Opens writable so you can patch bytes.

Link
rabin2 -I <binary>

Binary info without the shell: architecture, protections, language.

Link
rabin2 -z <binary>

Strings from the data sections.

Link
rabin2 -i <binary>

Imported functions.

Link

Analysis9

aaa

Analyses everything: functions, references and names.

Link
afl

Lists functions with addresses and sizes.

s <addr|symbol>

Seeks to an address or symbol.

Link
pdf

Prints the disassembly of the current function.

pdf @ <symbol>

Disassembles a function without seeking.

Link
axt <addr>

Cross-references to an address — who uses this string or calls this function.

Link
iz

Strings in data sections; izz searches the whole binary.

Link
pdc

A pseudo-C view of the current function.

Link
/ <string>

Searches for a string; /x searches hex bytes.

Link

Visual modes2

V

Visual mode; press p to cycle views and q to leave.

Link
VV

Graph view of the current function’s control flow.

Debugging and patching7

db <addr>

Sets a breakpoint.

Link
dc

Continues execution.

Link
ds

Steps one instruction; dso steps over.

Link
dr

Shows registers; dr rax=0 sets one.

Link
px <n> @ <addr>

Hex dump of memory.

Link
wa <asm> @ <addr>

Writes assembled instructions (in -w mode).

Link
wx <hex> @ <addr>

Writes raw bytes.

Link