Skip to content

Instantly share code, notes, and snippets.

@pedrominicz
Last active June 19, 2019 13:16
Show Gist options
  • Save pedrominicz/9dec57395a337fbff0deeecc78bce9b1 to your computer and use it in GitHub Desktop.
Save pedrominicz/9dec57395a337fbff0deeecc78bce9b1 to your computer and use it in GitHub Desktop.
radare2 config and cheatsheet.
# teminal 256 colors
e scr.color=2
e scr.utf8=true
e scr.utf8.curvy=true
# allow placing breakpoints outside mapped memory
#e dbg.bpinmaps=false
# color scheme
eco twilight

radare2 cheatsheet

running

  • open in debug mode: r2 -d file
  • open in debug mode and analyze: r2 -Ad file

normal mode

General:

  • analyze all and autoname functions: aaa (not necessary with -Ad)
  • list functions: afl
  • seek: s [address|function name]
  • visual mode: v
  • force quit: q!

Printing:

  • print disassembled instructions: pd [count]
  • print disassembled function: pdf
  • print hexadecimal quad-words: pxq [@] [register]
  • math: ? rax-0x10

Debug:

  • add breakpoint: db [address|function name]
  • continue execution until next breakpoint: dc
  • show registers values: dr
  • show previous (old) register values: dro
  • set register value: dr [register]=[value]

visual mode

  • step: s
  • step (over function calls): S
  • interactive graph: V
  • command mode: :
  • add comment: ;
  • delete comment: ;-
  • return to normal mode: q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment