gdb
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| gdb [2024/05/07 07:46] – A User Not Logged in | gdb [2024/11/14 06:58] (current) – A User Not Logged in | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== General ====== | ====== General ====== | ||
| + | attach to running process without break: | ||
| + | |||
| + | gdb attach -ex cont -iex "set pagination off" $(pidof process_name) | ||
| < | < | ||
| Line 11: | Line 14: | ||
| </ | </ | ||
| - | ====== Print and Examine | + | ====== Print Command |
| + | print string pointed by $rdi: | ||
| + | |||
| + | x/s $rdi | ||
| + | | ||
| show bytes pointed by register with offset: | show bytes pointed by register with offset: | ||
| Line 20: | Line 27: | ||
| p/x *(char *)$rcx@$dx | p/x *(char *)$rcx@$dx | ||
| + | p/x (char[size]) *$rcx | ||
| ====== Breakpoint ====== | ====== Breakpoint ====== | ||
| + | |||
| + | break on address: | ||
| + | |||
| + | b *0xdeadbeef | ||
| + | |||
| + | break at offset to function name: | ||
| + | |||
| + | < | ||
| + | b *(& | ||
| + | b *(funcname+0xbeef) | ||
| + | b *(' | ||
| + | </ | ||
| set conditional breakpoint: | set conditional breakpoint: | ||
| - | break dlopen if strcmp(file, | + | break dlopen if strcmp(file, |
| - | + | ||
| - | set conditional | + | set logpoint: |
| < | < | ||
| Line 34: | Line 53: | ||
| commands | commands | ||
| silent | silent | ||
| - | printf "msg: %d\n", *($rdi+0x34) | + | printf "msg: %d\n", *($rdi+0xbeef) |
| cont | cont | ||
| end | end | ||
| Line 41: | Line 60: | ||
| | | ||
| | | ||
| - | ====== View Memory ====== | ||
| - | |||
gdb.1715068009.txt.gz · Last modified: by A User Not Logged in
