Below instruction is tested based on Pwndbg: 2024.02.14 build: 90dc42e5
.
-
Put
pwngdb.py
andangelheap.py
into/path/to/pwndbg/pwndbg/
-
Put
commands/pwngdb.py
andcommands/angelheap.py
into/path/to/pwndbg/pwndbg/commands/
-
Add
import pwndbg.commands.pwngdb
andimport pwndbg.commands.angelheap
into/path/to/pwndbg/pwndbg/__init__.py
You can use these commands to install it:
#!/bin/bash
# You need to change the `/path/to/pwdbg` to your pwndbg location
pwndbg='/path/to/pwndbg'
cp pwngdb.py $pwndbg/pwndbg/pwngdb.py
cp angelheap.py $pwndbg/pwndbg/angelheap.py
cp commands/pwngdb.py $pwndbg/pwndbg/commands/pwngdb.py
cp commands/angelheap.py $pwndbg/pwndbg/commands/angelheap.py
sed -i -e '/config_mod.init_params()/a import pwndbg.commands.pwngdb' $pwndbg/pwndbg/__init__.py
sed -i -e '/config_mod.init_params()/a import pwndbg.commands.angelheap' $pwndbg/pwndbg/__init__.py
To avoid the conflict with pwndbg, some commands will be different or be removed.
-
got
will be renamed toobjdump_got
-
canary
will be removed since pwndbg already hascanary
command -
tls
will be renamed topwngdb_tls
- Use more pwndbg API if possible instead of using
gdb.execute
(see developer notes of pwndbg)