- Addresses within the memory are referenced with @
General
Starting with directly analysing all referenced code.
r2 -A $file ... e emu.str = true
Starting with enabled debugger (only when I want to execute the program)
r2 -AA -e dbg.follow.child=true -e dbg.forks=true -d $file ... e emu.str = true
Fork parameter:
- If the process forks, the debugger halts
- Type dp to see the child processes.
- Use dp=<pid> to set the new pid
Get help about possible commands: Add ? to the end of a command prefix.
aa?
Count lines count
... ~?
Note: bash commands are valid as well.
afl | wc -l
Get general information
ai
List all strings (like… strings)
izz
Get address from main
iM
Convert decimal, hex, binary, …
? 0xc0
rax2 -h
Debugging
Show the current address
s
Step 12 byte forward or backward
s+ 12 | s- 12
Undo the previous step
s-
Print current code
pd
Print code at a label
pd @main
Print only function code
pdf @main
Emoji hexdump for presentations
pxe
Show value of all registers:
dr
Set a breakpoint
db
Restart program at the beginning
ood
Continue
dc | dcf (dc -> follow also after forks)
Show register content
dr eax
Show current variable from function
afvd
Visual mode
vv
Step through the program
s
Add a comment
; comment
Dissassembler
r2pm init
r2pm ‑i r2dec
r2pm ‑l
pdd?
Open questions
- If I print aflc with ‑d and without, it is not the same. Why?
General hints
- Use as payload something like 1234567… and not some other string.
Leave a Reply
You must be logged in to post a comment.