killchain-compendium/exploit/binaries/r2.md

52 lines
667 B
Markdown
Raw Normal View History

2021-09-14 00:35:24 +02:00
# Radare2
## Usage
2021-09-27 00:48:14 +02:00
### Debug
2021-09-14 00:35:24 +02:00
```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
```
2021-09-27 00:48:14 +02:00
* Step
```sh
ds
```
2021-09-14 00:35:24 +02:00
* Show registers
```sh
dr
```
2021-09-27 00:48:14 +02:00
* 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