Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pwndbg "Move GDB initialization and basic startup functionality to a new Debugger-agnostic API" #56

Open
Acters opened this issue Sep 28, 2024 · 0 comments

Comments

@Acters
Copy link

Acters commented Sep 28, 2024

pwndbg/pwndbg@7dbc547

the 3 month old commit breaks provided script of pwngdb to pwndbg.

consider changing it from $pwndbg/pwndbg/__init__.py to $pwndbg/pwndbg/dbg/gdb.py
and change import pwndbg.commands.pwngdb and import pwndbg.commands.angelheap to:
from pwndbg.commands import pwngdb and from pwndbg.commands import angelheap

this should be new README.md now:

# Pwngdb ❤️ pwndbg

Below instruction is tested based on Pwndbg: `2024.02.14 build: 90dc42e5`.

## How to install

1. Put `pwngdb.py` and `angelheap.py` into `/path/to/pwndbg/pwndbg/`

2. Put `commands/pwngdb.py` and `commands/angelheap.py` into `/path/to/pwndbg/pwndbg/commands/`

3. Add  `from pwndbg.commands import pwngdb` and `from pwndbg.commands import angelheap` into `/path/to/pwndbg/pwndbg/dbg/gdb.py`

You can use these commands to install it:

```shell
#!/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 '/def setup(self):/a \        from pwndbg.commands import pwngdb' $pwndbg/pwndbg/dbg/gdb.py
sed -i -e '/def setup(self):/a \        from pwndbg.commands import angelheap' $pwndbg/pwndbg/dbg/gdb.py
```.

## Note

To avoid the conflict with pwndbg, some commands will be different or be removed.

1. `got` will be renamed to `objdump_got`

2. `canary` will be removed since pwndbg already has `canary` command

3. `tls` will be renamed to `pwngdb_tls`

## TODO

- [ ] Use more pwndbg API if possible instead of using `gdb.execute` (see [developer notes of pwndbg](https://github.com/pwndbg/pwndbg/blob/dev/DEVELOPING.md))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant