2017-02-16 21:40:17 +00:00
|
|
|
#!/bin/bash -ex
|
2016-10-13 09:54:06 +00:00
|
|
|
set -e -o pipefail
|
2016-02-18 15:15:28 +00:00
|
|
|
|
2016-10-12 13:41:53 +00:00
|
|
|
git clone --depth 1 https://github.com/pwndbg/pwndbg
|
|
|
|
|
2016-10-12 15:49:55 +00:00
|
|
|
source ctf-tools-venv-activate
|
2016-10-12 13:41:53 +00:00
|
|
|
|
2016-10-12 15:49:55 +00:00
|
|
|
pushd pwndbg
|
|
|
|
pip install -Ur ./requirements.txt
|
|
|
|
popd
|
2016-10-12 13:41:53 +00:00
|
|
|
|
|
|
|
# pwndbg brings it's own capstone/unicorn submodules
|
2016-10-12 15:49:55 +00:00
|
|
|
# we ignore this for now and install the deps ourselfs
|
2016-10-12 13:41:53 +00:00
|
|
|
#git submodule update --init --recursive
|
2016-10-12 15:49:55 +00:00
|
|
|
|
|
|
|
# install capstone/unicron dependencies
|
|
|
|
pip install -U capstone
|
|
|
|
manage-tools install unicorn
|
2016-02-18 15:15:28 +00:00
|
|
|
|
|
|
|
mkdir bin
|
|
|
|
cat >> bin/pwndbg <<EOF
|
|
|
|
#!/bin/sh
|
2016-07-14 14:12:53 +00:00
|
|
|
exec gdb -q -ex init-pwndbg "\$@"
|
2016-02-18 15:15:28 +00:00
|
|
|
EOF
|
|
|
|
chmod +rx bin/pwndbg
|
|
|
|
|
|
|
|
cd pwndbg
|
2016-10-12 14:45:02 +00:00
|
|
|
# make sure gdbinit exists
|
|
|
|
touch ~/.gdbinit
|
2016-02-18 15:15:28 +00:00
|
|
|
if ! grep "init-pwndbg" ~/.gdbinit; then
|
|
|
|
cat >> ~/.gdbinit <<EOF
|
|
|
|
|
|
|
|
####
|
|
|
|
# added by ctf-tools
|
|
|
|
define init-pwndbg
|
|
|
|
source $PWD/gdbinit.py
|
|
|
|
end
|
|
|
|
document init-pwndbg
|
2016-10-12 13:41:53 +00:00
|
|
|
Initializes the pwndbg gdb extension (https://github.com/pwndbg/pwndbg)
|
2016-02-18 15:15:28 +00:00
|
|
|
end
|
|
|
|
####
|
|
|
|
|
|
|
|
EOF
|
|
|
|
fi
|