Radare2 Cheatsheet

radare2 commands

radare2/intro.md at master · radare/radare2 · GitHub

command Args

-d – start in debug mode

-A – Auto aaa

Radare2 – aldeid

assembly arch -a arm config asm.arch

cpu -c v8 config asm.cpu

number of bits -b 32 config asm.bits

memory offset -m 0x08000000

shell commands

aaa analyse all

afl – command (Analyze Functions List).

s <function> seek to function or any memory address

axt @@ str.* – find usage of strings

ood – Open binary in debugger

?[??][expr] – Help or evaluate math expression

Set ARchi

e asm.arch =

Set to String

Cs <len> – set current address and length to string

change data type (Hint)

ahi s – set specific offset as string

ahi s @0x080485a3 set single address to string

ahi s @@=0x080485a3 0x080485ad 0x080485b7 – sets multiple memory addresses strings @@ is an integrator place holder

rename function

s fcn.00401510
afn better_name

Or by using

afn better_name fcn.00401510

afn better_name 0x00401510

afn better_name @fcn.00401510

afn better_name @0x00401510

Extend Function

Print

pdf print disassemble function (summary+cjmp), json)

ps – print string, EX: ps @ 0x02ee@ is a temporary seek

flags

fs – To list the flag spaces

fs <flagspace>; f – show specific flag space

searching

pd 0xdff ~0xc6

rabin2 – binary info

i? – Commands related to rabin2, information about the binary

iz – List strings in data sections

izz – Search for Strings in the whole binary

Visual mode

V visual mode from r2 or switch to Graph in Visual Mode

j / k – move forward or back

p / P – switch between visual modes

<enter> – jump / call to go to location

:<r2 command> – run radare2 command in visual mode

;[-]comment – add or [-] remove comment

Visual Graph

VV – visual graph

v – visual code review

p / P – switch between visual graphs

R – change colors

:<r2 command> – run radare2 command in visual mode

;[-]comment – add or [-] remove comment

? – show commands

radare2/intro.md at master · radare/radare2 · GitHub

A journey into Radare 2 – Part 1: Simple crackme – Megabeets

A journey into Radare 2 – Part 2: Exploitation – Megabeets

Reverse Engineering With Radare2 – Intro – Insinuator.net

Reverse Engineering With Radare2 – Part 2 – Insinuator.net

Reverse Engineering With Radare2 – Part 3 – Insinuator.net

#coding/radare2 #7-notes