killchain-compendium/exploit/binaries/r2.md

52 lines
667 B
Markdown

# Radare2
## Usage
### Debug
```sh
r2 -d <binary>
```
* Analyze
```sh
aaa
```
* Show main
```sh
pdf @main
```
* Breakpoint
```sh
db 0xdeadbeef
```
* Show rbp-0x4
```sh
px @rbp-0x4
```
* Continue
```sh
dc
```
* Step
```sh
ds
```
* Show registers
```sh
dr
```
* Restart
```sh
ood
```
## AT&T Instructions
* leaq src, dst: this instruction sets dst to the address denoted by the expression in src
* addq src, dst: dst = dst + src
* subq src, dst: dst = dst - src
* imulq src, dst: dst = dst * src
* salq src, dst: dst = dst << src
* sarq src, dst: dst = dst >> src
* xorq src, dst: dst = dst XOR src
* andq src, dst: dst = dst & src
* orq src, dst: dst = dst | src