GDB调试 | PWNDBG+PWNDBG联合使用
https://www.freesion.com/article/7871636857/
本机调试:
1、安装好pwndbg后在“~”目录有“.gdbinit”
文件内容:
# cat .gdbinit source /home/giantbranch/pwndbg/gdbinit.py
2、安装好Pwngdb后需要将该目录下的“.gdbinit”覆盖原来的".gdbinit"
cd ~/ git clone https://github.com/scwuaptx/Pwngdb.git cp ~/Pwngdb/.gdbinit ~/
3、现在想将Pwngdb中的fmtstr指令集成到pwndbg中,查看Pwngdb中的“.gdbinit”文件内容如下:
# cat .gdbinit source ~/peda/peda.py source ~/Pwngdb/pwngdb.py source ~/Pwngdb/angelheap/gdbinit.py define hook-run python import angelheap angelheap.init_angelheap() end end
4、因为使用的pwndbg工具没有用peda,因此注释掉“source ~/peda/peda.py”,将Pwngdb中“.gdbinit”文件内容追加到原理“~”目录下的“.gdbinit”中,如下:
# cat .gdbinit #source ~/peda/peda.py source /home/giantbranch/pwndbg/gdbinit.py source ~/Pwngdb/pwngdb.py source ~/Pwngdb/angelheap/gdbinit.py define hook-run python import angelheap angelheap.init_angelheap() end end
结束。