more gdb notes

This commit is contained in:
Ward Wouts 2023-02-15 08:57:22 +01:00
parent e8ae1519cb
commit 886ebe52f7

View file

@ -474,11 +474,18 @@ template: inverse
- `disas <function>` disassemble a function
- `b *<address>` set a breakpoint on an address
- `x/200x $esp` show the memory contents for 200 bytes starting at the address $esp points to
- `x/200c <addr>` show the memory contents for 200 characters starting at the address
- `r` run
- `r < foo.txt` run with stdin filled from a file
- `c` continue
- `s` step into
- `info functions` list all functions
- `p (char*)getenv("PATH")` find the memory location of an environment variable for the running program (use a breakpoint!)
Many improvements exist to make gdb nicer for reverse engineering, such as:
- https://github.com/pwndbg/pwndbg
- https://github.com/hugsy/gef
- https://github.com/longld/peda
]
</textarea>