Setup¤
There are multiple ways to install Pwndbg, depending on how you want to use it. Skim the table of contents on the right to find your preferred installation method. We support both GDB and LLDB, Linux and MacOS! If you're a new user, we recommend the system install script. If you remember the times of yore you might prefer the ~/.gdbinit install.
To run the pwndbg binary from your pwntools scripts, set:
Install Script¤
pwndbg-gdb¤
This will provide the pwndbg program. You can use it the same way you use gdb. To later update, just re-run the same command. The script will install the latest portable release from our GitHub releases.
Install the binary for all users of the system. This requires root permissions, and will invoke sudo.
Install the binary for the current user. Root access not required.
pwndbg-lldb¤
This installation method provides the pwndbg-lldb ./your-binary command.
Install pwndbg from source¤
First things first, you need to have uv installed (and git and curl):
If you just want the most up-to-date Pwndbg, the simplest thing to do is just:
which gives you thepwndbg and pwndbg-lldb binaries. If you want to update, just re-run this command. I want to use my system GDB / LLDB¤
If you don't want Pwndbg to use our up-to-date packaged+patched GDB and LLDB, but rather the GDB / LLDB from your system / package manager, you can install Pwndbg with:
# Assuming that your LLDB and GDB are compiled with the same python version :)
PY_VER=$(gdb -nx --batch -iex 'py import sysconfig; print(sysconfig.get_config_var("VERSION"))')
uv tool install --python=$PY_VER git+https://github.com/pwndbg/pwndbg
System GDB, sourced from ~/.gdbinit¤
If you want the "classic" setup, where you run the gdb binary and Pwndbg is sourced from ~/.gdbinit you can do that like this:
PY_VER=$(gdb -nx --batch -iex 'py import sysconfig; print(sysconfig.get_config_var("VERSION"))')
uv tool install --python=$PY_VER git+https://github.com/pwndbg/pwndbg
echo "source $(uv tool dir)/pwndbg/share/pwndbg/gdbinit.py" >> ~/.gdbinit
In general, if you have the repository cloned you can run the same commands as in the above sections, but replacing git+https://github.com/pwndbg/pwndbg with . (the current folder) and adding --editable so changes in the source are reflected in the installation.
Lite install¤
If you are tight on disk space, there are some non-essential dependencies you can omit when installing. You can add the --excludes <(printf 'ziglang\ndecomp2dbg\nipython') argument to any of the uv tool install methods above to save you around ~300 MB.
For example, to get the previous install method with these dependencies omitted, you can run:
PY_VER=$(gdb -nx --batch -iex 'py import sysconfig; print(sysconfig.get_config_var("VERSION"))')
uv tool install --excludes <(printf 'ziglang\ndecomp2dbg\nipython') --python=$PY_VER git+https://github.com/pwndbg/pwndbg
echo "source $(uv tool dir)/pwndbg/share/pwndbg/gdbinit.py" >> ~/.gdbinit
Uninstalling
For all of these methods, uninstall with
and remove the appropriate line from your~/.gdbinit if necessary. Other install methods¤
Homebrew¤
Install via Homebrew (macOS)
Nix¤
Install via the Nix package manager (Linux/macOS)
# pwndbg-gdb
nix shell github:pwndbg/pwndbg
# pwndbg-lldb
nix shell github:pwndbg/pwndbg#pwndbg-lldb
Install from a distro package files¤
When installing with GDB, you may also download a package file to install through your package manager of choice. Download the package from the releases page and pick the appropriate download from the second table.
Distro package repository¤
You may want to install Pwndbg through your distribution's package manager. This installation method is not officially supported because we cannot control the versions of the python dependencies Pwndbg uses in this case. Please use any other installation method when reproducing bug reports (portable package is probably simplest in this case). If a bug reproduces with a distro package but not with any of the supported installation methods, please report it to the package maintainer; if the problem cannot be fixed, let us know and we will add it to a list of known issues below.
Manually install the Portable Version¤
You can manually download a portable release on the Pwndbg releases page. There are separate releases for GDB and LLDB. Use the first table to pick the appropriate download for your system architecture. You can then unpack the archive with:
And run Pwndbg with or depending on which version you installed. You may add the appropriate file to your shell's PATH.Removing Quarantine Flags (macOS)
When first setting up the portable version of Pwndbg in macOS, Gatekeeper will normally try to prevent any code in the extracted files from running until the user explicitly allows each file to be run. As we ship many files which would require this, the process of manually granting permission for each one to be run can get quite tiresome.
In order to do this to all files at once, you may choose to run the following command, which removes the quarantine flag from all extracted files at once:
Assuming that the files were extracted to a folder called pwndbg.
Legacy install method¤
We still support a setup.sh script, but note it requires root as it calls sudo internally.
This will get you the same setup as in System GDB, sourced from ~/.gdbinit. You can update with git pull.
Setup for development¤
For getting setup for development, see contributing/Installing Pwndbg from source.