Ubuntu20.04安装pwndbg
安装
该方案来自于:网址
第一步:安装pwntools
sudo apt-get install python3 python3-pip python3-dev git libssl-dev libffi-dev build-essential
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install --upgrade pwntools
第二步:安装pwngdb和pwndbg
cd ~/
git clone https://github.com/scwuaptx/Pwngdb.git
cp ~/Pwngdb/.gdbinit ~/
git clone https://github.com/pwndbg/pwndbg
cd pwndbg
./setup.sh
第三步:修改文件
vim ~/.gdbinit
注释掉第一行 然后在第二行写入
source ~/pwndbg/gdbinit.py
简单使用
带源码调试: gdb -q [file] -d [path](默认为.)
打印链接库: vmmap
效果展示
/* ************************************************************************
> File Name: test.cpp
> Author: niu0217
> Created Time: Tue 30 Jul 2024 07:59:02 AM CST
> Description:
************************************************************************/
// g++ -g -o test test.cpp
#include <iostream>
#include <cstring>
using namespace std;
int main()
{
int a = 1;
int b = 2;
int c = 3;
cout << a << " " << b << endl;
}
g++ -g -o test test.cpp
gdb test
b main
r
在这里我们可以看到函数堆栈,代码等信息。