mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
Move pwndbg to tools from dotfile status.
This commit is contained in:
@@ -87,6 +87,7 @@ if [ -d ${DESTDIR} ] ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Begin main tool selection
|
||||||
case ${TOOL} in
|
case ${TOOL} in
|
||||||
john)
|
john)
|
||||||
install_pkgs libssl-dev git build-essential yasm libgmp-dev libpcap-dev \
|
install_pkgs libssl-dev git build-essential yasm libgmp-dev libpcap-dev \
|
||||||
@@ -220,8 +221,28 @@ case ${TOOL} in
|
|||||||
src="https://github.com/trustedsec/ptf.git"
|
src="https://github.com/trustedsec/ptf.git"
|
||||||
git clone ${src} ${DESTDIR}
|
git clone ${src} ${DESTDIR}
|
||||||
;;
|
;;
|
||||||
|
pwndbg)
|
||||||
|
if ! which gdb > /dev/null 2>&1 ; then
|
||||||
|
echo 'No gdb available!' >/dev/stderr
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
git clone --depth 1 -b stable https://github.com/pwndbg/pwndbg.git ${DESTDIR}
|
||||||
|
local PY_PACKAGES=${DESTDIR}/vendor
|
||||||
|
mkdir -p ${PY_PACKAGES}
|
||||||
|
local PYVER=$(gdb -batch -q --nx -ex 'pi import platform; print(".".join(platform.python_version_tuple()[:2]))')
|
||||||
|
local PYTHON=$(gdb -batch -q --nx -ex 'pi import sys; print(sys.executable)')
|
||||||
|
PYTHON="${PYTHON}${PYVER}"
|
||||||
|
${PYTHON} -m pip install --target ${PY_PACKAGES} -Ur ${DESTDIR}/requirements.txt
|
||||||
|
${PYTHON} -m pip install --target ${PY_PACKAGES} -U capstone unicorn
|
||||||
|
# capstone package is broken
|
||||||
|
cp ${PY_PACKAGES}/usr/lib/*/dist-packages/capstone/libcapstone.so ${PY_PACKAGES}/capstone
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Unknown tool: ${TOOL}" >/dev/stderr
|
echo "Unknown tool: ${TOOL}" >/dev/stderr
|
||||||
|
echo "Options:" >/dev/stderr
|
||||||
|
for opt in $(awk 'BEGIN {s=0;FS=")"};/main tool selection/{s=1};/^\s+\w+)$/{if(s==1){print $1}}' $0|sort); do
|
||||||
|
echo -e "\t${opt}" >/dev/stderr
|
||||||
|
done
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
@@ -26,10 +26,10 @@ end
|
|||||||
python
|
python
|
||||||
import sys
|
import sys
|
||||||
import os.path
|
import os.path
|
||||||
pwndbg = os.path.expanduser('~/.pwndbg/gdbinit.py')
|
pwndbg = os.path.expanduser('~/tools/pwndbg/gdbinit.py')
|
||||||
peda = os.path.expanduser('~/.peda/peda.py')
|
peda = os.path.expanduser('~/.peda/peda.py')
|
||||||
if os.path.isfile(pwndbg):
|
if os.path.isfile(pwndbg):
|
||||||
sys.path.insert(0, os.path.expanduser('~/.pwndbg/vendor'))
|
sys.path.insert(0, os.path.expanduser('~/tools/pwndbg/vendor'))
|
||||||
gdb.execute('source {}'.format(pwndbg))
|
gdb.execute('source {}'.format(pwndbg))
|
||||||
elif os.path.isfile(peda):
|
elif os.path.isfile(peda):
|
||||||
gdb.execute('source {}'.format(peda))
|
gdb.execute('source {}'.format(peda))
|
||||||
|
|||||||
21
install.sh
21
install.sh
@@ -102,24 +102,6 @@ add_bin_symlink() {
|
|||||||
ln -sf ${1} ${LINKNAME}
|
ln -sf ${1} ${LINKNAME}
|
||||||
}
|
}
|
||||||
|
|
||||||
# Custom version of pwndbg's installer
|
|
||||||
# TODO: move to install_tool.sh
|
|
||||||
install_pwndbg() {
|
|
||||||
if ! which gdb > /dev/null 2>&1 ; then
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
install_git -b stable https://github.com/pwndbg/pwndbg.git $HOME/.pwndbg
|
|
||||||
mkdir -p $HOME/.pwndbg/vendor
|
|
||||||
local PYVER=$(gdb -batch -q --nx -ex 'pi import platform; print(".".join(platform.python_version_tuple()[:2]))')
|
|
||||||
local PYTHON=$(gdb -batch -q --nx -ex 'pi import sys; print(sys.executable)')
|
|
||||||
PYTHON="${PYTHON}${PYVER}"
|
|
||||||
local PY_PACKAGES=$HOME/.pwndbg/vendor
|
|
||||||
${PYTHON} -m pip install --target ${PY_PACKAGES} -Ur $HOME/.pwndbg/requirements.txt
|
|
||||||
${PYTHON} -m pip install --target ${PY_PACKAGES} -U capstone unicorn
|
|
||||||
# capstone package is broken
|
|
||||||
cp ${PY_PACKAGES}/usr/lib/*/dist-packages/capstone/libcapstone.so ${PY_PACKAGES}/capstone
|
|
||||||
}
|
|
||||||
|
|
||||||
postinstall() {
|
postinstall() {
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
@@ -392,9 +374,6 @@ case $OPERATION in
|
|||||||
PKG_SET=${2:-minimal}
|
PKG_SET=${2:-minimal}
|
||||||
install_pkg_set packages.${PKG_SET}
|
install_pkg_set packages.${PKG_SET}
|
||||||
;;
|
;;
|
||||||
pwndbg)
|
|
||||||
install_pwndbg
|
|
||||||
;;
|
|
||||||
test)
|
test)
|
||||||
# Do nothing, just sourcing
|
# Do nothing, just sourcing
|
||||||
set +o errexit
|
set +o errexit
|
||||||
|
|||||||
Reference in New Issue
Block a user