A concise guide to common operations and tools within the Radare2 framework.
rax2 - Base Conversion
Used for converting between various numerical bases and formats.
Command Line
rax2 0x28 # Hex to decimalrax2 40 # Decimal to hexrax2 -h # Show helpInternal (within r2)
Use the ? command to evaluate expressions or convert values.
[0x00000000]> ? 0x28 # Convert 0x28 to all formats[0x00000000]> ? 3+4 # Evaluate basic mathrabin2 - Binary Information
Extracts information from executable files (imports, exports, strings, etc.).
Common Commands
rabin2 -I file # General binary info (arch, OS, bits, etc.)rabin2 -z file # List strings in data sectionsrabin2 -zz file # List strings in the entire binaryrabin2 -i file # List imports (linked libraries/functions)rabin2 -e file # List entry pointsradare2 (r2) - Core Interactive Tool
The main interface for disassembly, analysis, and debugging.
Startup
r2 -A file # Open file and run analysis (aaa)r2 -w file # Open file in write moder2 file # Open without any analysisInformation (i)
i # Show information about current fileii # Show information about current functionis # Show information about current symboliz # Show information about strings in data sectionsiE # Show information about exports(global symbols)Navigation (s)
s 0x400500 # Seek to specific addresss main # Seek to 'main' symbols - # Seek back to previous locationAnalysis (a)
aa # Basic analysisaaa # Full analysis (including functions and symbols)afl # List all analyzed functionsDisassembly & Printing (p)
pdf # Print Disassembly of current Functionpdf @ main # Print Disassembly of specific functionpd 10 # Print 10 lines of DisassemblypD 32 # Print 32 bytes of Disassemblypx 64 # Print 64 bytes of HexdumpWriting (w)
Note: Requires opening r2 with -w.
wx 909090 # Write hex bytes (NOPs)wa nop # Assemble and write a single instructionVisual Modes (v, V)
v # Open visual panelsV # Enter visual modeVV # Enter visual graph modev test # Load saved layout 'test'v= test # Save current layout as 'test'p & P # Switch viewu & U # Undo and Redo seekrasm2 - Assembler & Disassembler
Quickly assemble or disassemble instructions.
Usage
# Assemble an instruction (x86, 64-bit)rasm2 -a x86 -b 64 "nop"
# Disassemble hex code (machine code)rasm2 -a x86 -b 64 -d "90"Useful Shortcuts (Internal)
?- Show general helpV- Enter visual modeVV- Enter visual graph modeq- Exit current mode or r2