radare2
Reverse engineering and binary analysis framework
TLDR
SYNOPSIS
r2 [-a arch] [-b bits] [-B baddr] [-c cmd] [-e k=v] [-i file] [-I prefile] [-k kernel] [-m addr] [-p project] [-P patch] [-r rarun2] [-R rr2rule] [-s addr] [-0AdfDjLMnNqStTuVwxX] file
DESCRIPTION
radare2 (r2) is an open-source reverse engineering framework for binary analysis, debugging, and exploitation. It disassembles, analyzes, and patches binaries across many architectures and formats.The tool operates through a command-line interface with hundreds of commands. Commands are typically short mnemonics: 'p' for print, 'a' for analyze, 's' for seek. Help is available by appending '?' to any command prefix.Analysis identifies functions, strings, cross-references, and control flow. The 'aaa' command performs comprehensive analysis. Results populate databases queryable through commands.Visual modes provide cursor-based navigation and graph views. Function graphs show control flow with block connections. Hex editing mode enables direct binary modification.Debugging integrates natively, attaching to processes or launching programs. Breakpoints, stepping, register manipulation, and memory inspection work across supported platforms.Scripting uses r2pipe for external automation (Python, JavaScript, etc.) or internal radare2 scripts. Extensive plugin API enables custom analysis.
PARAMETERS
-A
Run 'aaa' command to analyze all referenced code before prompt.-a arch
Force asm.arch (x86, ppc, arm, mips, bf, java, ...).-b bits
Force asm.bits (16, 32, 64).-B baddr
Specify the base address for loading a new binary.-c cmd
Execute the given command before giving prompt.-d
Start in debugger mode.-D backend
Enable debug mode with a specific debug backend.-e k=v
Set configuration eval variable key=value.-f
Set blocksize to file size.-i file
Run script file after the file is loaded.-I file
Run script file before the file is loaded.-k kernel
Select kernel (asm.os) for syscall resolution.-l plugfile
Load a given plugin file.-L
List loaded IO plugins.-m addr
Map file at given address.-M
Disable demangling.-n
Do not perform any analysis. Just load the raw file.-nn
Only load the rbin structures (elf, mach0, ...).-N
Do not load user settings or projects from ~/.radare2rc.-p project
Set project file.-P file
Apply rapatch file and quit.-q
Quiet mode. Exit after running -c commands.-r rarun2
Specify dbg.profile rarun2 profile for spawning programs.-R directive
Specify custom rarun2 directives without creating a profile.-s addr
Start seeking at this address.-S
Enable sandboxed mode.-T
Avoid computing file hashes.-v
Show version information and exit.-w
Open in write mode.
CONFIGURATION
~/.radare2rc
Startup configuration file executed on launch, containing default settings and commands to run automatically. Use -N to skip loading.-e key=value
Runtime configuration variables controlling analysis depth, display format, and tool behavior. Use `e??` inside r2 to list all options.~/.local/share/radare2/projects/
Project files saving analysis state including function names, comments, and flags for resuming work on a binary.
COMMANDS
Disassemble function.afl
List functions.aaa
Analyze all (functions, references, strings, etc.).s addr
Seek to address.V
Enter visual mode.VV
Enter graph mode.px N
Print N bytes as hex.iz
List strings in data sections.ii
List imports.ie
List entrypoints.db addr
Set breakpoint.dc
Continue execution.ds
Step one instruction.dr
Show registers.?
Show help. Append ? to any command prefix for subcommand help.q
Quit.
CAVEATS
Steep learning curve - command syntax takes time to master. Documentation can be sparse. Analysis may miss obfuscated code. Some features are platform-specific. Memory usage grows with analysis depth.
HISTORY
radare2 was created by pancake (Sergi Alvarez) around 2006, evolving from the original radare. It grew from a hex editor to a full reverse engineering platform. The project emphasizes freedom, portability, and Unix philosophy. Despite its complexity, it has a dedicated community and is used in CTF competitions and security research.
