mirror of
https://github.com/zardus/ctf-tools
synced 2024-12-13 14:32:34 +00:00
7144e756e5
early on any error + anticipate that some tools can't be installed by now, but we still want the test to return success to satisfy travis-ci
44 lines
838 B
Bash
Executable file
44 lines
838 B
Bash
Executable file
#!/bin/bash -ex
|
|
set -e -o pipefail
|
|
|
|
git clone --depth 1 https://github.com/pwndbg/pwndbg
|
|
|
|
source ctf-tools-venv-activate
|
|
|
|
pushd pwndbg
|
|
pip install -Ur ./requirements.txt
|
|
popd
|
|
|
|
# pwndbg brings it's own capstone/unicorn submodules
|
|
# we ignore this for now and install the deps ourselfs
|
|
#git submodule update --init --recursive
|
|
|
|
# install capstone/unicron dependencies
|
|
pip install -U capstone
|
|
manage-tools install unicorn
|
|
|
|
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
|