ctf-tools/pwndbg/install

40 lines
747 B
Bash
Executable file

#!/bin/bash
set -eu -o pipefail
git clone --depth 1 https://github.com/pwndbg/pwndbg
pushd pwndbg
ctf-tools-pip instal -Ur ./requirements.txt
ctf-tools-pip install -U capstone
manage-tools install unicorn
# pwndbg brings it's own capstone/unicorn submodules
#git submodule update --init --recursive
# we ignore this for now
mkdir bin
cat >> bin/pwndbg <<EOF
#!/bin/sh
exec gdb -q -ex init-pwndbg "\$@"
EOF
chmod +rx bin/pwndbg
cd pwndbg
# make sure gdbinit exists
touch ~/.gdbinit
if ! grep "init-pwndbg" ~/.gdbinit; then
cat >> ~/.gdbinit <<EOF
####
# added by ctf-tools
define init-pwndbg
source $PWD/gdbinit.py
end
document init-pwndbg
Initializes the pwndbg gdb extension (https://github.com/pwndbg/pwndbg)
end
####
EOF
fi