summaryrefslogtreecommitdiff
path: root/dev-debug/pwndbg
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-01-18 20:07:15 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-01-18 20:07:15 +0000
commita4c0eb2444b57e79bce0a088e5936ed71c415e8f (patch)
tree61a990b001109844a226b1fbe33bb38486a88c8e /dev-debug/pwndbg
parente60b61e39bb9b7cbf525baa183a5a19234f335fa (diff)
gentoo auto-resync : 18:01:2024 - 20:07:15
Diffstat (limited to 'dev-debug/pwndbg')
-rw-r--r--dev-debug/pwndbg/Manifest6
-rw-r--r--dev-debug/pwndbg/files/pwndbg-20230717-no-venv.patch46
-rw-r--r--dev-debug/pwndbg/metadata.xml20
-rw-r--r--dev-debug/pwndbg/pwndbg-20230717-r1.ebuild90
-rw-r--r--dev-debug/pwndbg/pwndbg-99999999.ebuild83
5 files changed, 245 insertions, 0 deletions
diff --git a/dev-debug/pwndbg/Manifest b/dev-debug/pwndbg/Manifest
new file mode 100644
index 000000000000..92bfa9f661c1
--- /dev/null
+++ b/dev-debug/pwndbg/Manifest
@@ -0,0 +1,6 @@
+AUX pwndbg-20230717-no-venv.patch 1623 BLAKE2B abab8d6cec25a8efc8fc6e3b16159b0ace65ed2b11d5dc64686ea09aa5efdfddc4bf704c2fbfb24e4e2fdb542d41b2ac7c1737cd1211717b72bebe50cd075ba5 SHA512 2eb2441fa27e8e3a024bb88731ab81d81370648cc7f8e3f2694809fa64beacfdfcb61a06b7689fa97a3f046775a1d12eaf9310ac3beea44ba28c67175e5e89fb
+DIST gdb-pt-dump-ebdc24573a4bf075cf3ab6016add9db6baacf977.tar.gz 385989 BLAKE2B b7582289f83fd0c76b8ef2a04540db979b0f599b6b711e17541e2804b93bcffe6fd611d43101c96644a7324398eea5df02326267b4e201564929de956849b719 SHA512 57701b5fdd4c69be79a451f08fa6d7cbd43a0963cfd7689443676b68ece96154ccb61121d4a770d6e519d3142f99c589df1143b0ff8308547c06fb0e87e187db
+DIST pwndbg-20230717.tar.gz 8392017 BLAKE2B e373a7408366090f58385dac8dfcdd13702c475117a35158a1a149d149c9a2cbf5f2702be33aeab537451cfd990b5253e9bc0283fa5ae197c9cceb680e65a724 SHA512 d261ed992327d62b0b3e7cc002d3185435748e27cc2ce0085d438848ef1bdb0b3921ae5c1ce19c25e49d52b10f8340eb67c4e05fc197d2adeb888b47e2c158ba
+EBUILD pwndbg-20230717-r1.ebuild 2561 BLAKE2B 368be41db6679ae094ab0c6b0bec4ad08f86a5c0d9567801d87859f741dcf4d23b6e4189fb0613ba1b22fbf8b8c61d819c099e38c5ce36cff423827f4f58c542 SHA512 b64476c5dbf9cd48d3a34b3aaab012ce2882f08439acdc95bfa1d2e0a485c6d0e922e455de0c8fdbb67d1ad3dafe394b190f9b15cddf596ec7c11f3382e9b661
+EBUILD pwndbg-99999999.ebuild 2392 BLAKE2B e007895a4cd8bf5bbbfc12f2bb12ae875749f5278391dc41f501c44dda635cad426cd2705b7d200be59b72fb89aa22b098eb806c4eca502a8180a81fdd34a8df SHA512 fb2c9641dd2a09a02a5ded28c01d8c716a4c1933859133d6e4ccf4ccd7bf6a9919eb23161610f0859d2ac12581cd61bf2ab913b5e603b2dd6fc43cd1c4316cac
+MISC metadata.xml 692 BLAKE2B bb74dda183fe35e5873e7cbaa5886dec5beaf082968b16352bcda55f2e14dbdb78ee48d2e0195baa735b0f615b0469f8fd48429c47f4a81d2fc0391cafaade76 SHA512 8a6a9ec3aa03e597d8302a5b1001fbfd569e6efb08157445bedb58ec82b4d7812aad7a852ae3eb0d0f245cbf89c85a357e532855c19e6dbc9d438c16e0bd549d
diff --git a/dev-debug/pwndbg/files/pwndbg-20230717-no-venv.patch b/dev-debug/pwndbg/files/pwndbg-20230717-no-venv.patch
new file mode 100644
index 000000000000..4011236240f9
--- /dev/null
+++ b/dev-debug/pwndbg/files/pwndbg-20230717-no-venv.patch
@@ -0,0 +1,46 @@
+From 6a351680675123ccc0d8fb192f28f3c654979c92 Mon Sep 17 00:00:00 2001
+From: Stefan Gloor <code@stefan-gloor.ch>
+Date: Tue, 28 Nov 2023 20:24:26 +0100
+Subject: [PATCH] Use global python packages instead of virtualenv
+Bug: https://bugs.gentoo.org/918705
+
+The upstream install script creates a .venv and installs the
+dependencies there. This patch allows the normal python packages to be
+used.
+
+Signed-off-by: Stefan Gloor <code@stefan-gloor.ch>
+--- a/gdbinit.py
++++ b/gdbinit.py
+@@ -20,29 +20,6 @@ directory, file = path.split(__file__)
+ directory = path.expanduser(directory)
+ directory = path.abspath(directory)
+
+-# Get virtualenv's site-packages path
+-venv_path = os.environ.get("PWNDBG_VENV_PATH")
+-if not venv_path:
+- venv_path = os.path.join(directory, ".venv")
+-
+-if not os.path.exists(venv_path):
+- print(f"Cannot find Pwndbg virtualenv directory: {venv_path}: please re-run setup.sh")
+- sys.exit(1)
+-
+-site_pkgs_path = glob(os.path.join(venv_path, "lib/*/site-packages"))[0]
+-
+-# add virtualenv's site-packages to sys.path and run .pth files
+-site.addsitedir(site_pkgs_path)
+-
+-# remove existing, system-level site-packages from sys.path
+-for site_packages in site.getsitepackages():
+- if site_packages in sys.path:
+- sys.path.remove(site_packages)
+-
+-# Set virtualenv's bin path (needed for utility tools like ropper, pwntools etc)
+-bin_path = os.path.join(venv_path, "bin")
+-os.environ["PATH"] = bin_path + os.pathsep + os.environ.get("PATH")
+-
+ # Add gdb-pt-dump directory to sys.path so it can be imported
+ gdbpt = path.join(directory, "gdb-pt-dump")
+ sys.path.append(directory)
+--
+2.41.0
+
diff --git a/dev-debug/pwndbg/metadata.xml b/dev-debug/pwndbg/metadata.xml
new file mode 100644
index 000000000000..707da35acff7
--- /dev/null
+++ b/dev-debug/pwndbg/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>mario.haustein@hrz.tu-chemnitz.de</email>
+ <name>Mario Haustein</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+ <longdescription>
+ pwndbg is a GDB plug-in that makes debugging with GDB suck less, with a
+ focus on features needed by low-level software developers, hardware
+ hackers, reverse-engineers and exploit developers.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">pwndbg/pwndbg</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/dev-debug/pwndbg/pwndbg-20230717-r1.ebuild b/dev-debug/pwndbg/pwndbg-20230717-r1.ebuild
new file mode 100644
index 000000000000..a38b9180e566
--- /dev/null
+++ b/dev-debug/pwndbg/pwndbg-20230717-r1.ebuild
@@ -0,0 +1,90 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..11} )
+
+inherit python-single-r1 wrapper
+
+DESCRIPTION="A GDB plug-in that makes debugging with GDB suck less"
+HOMEPAGE="https://github.com/pwndbg/pwndbg"
+
+if [[ ${PV} == "99999999" ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/pwndbg/pwndbg"
+else
+ MY_PV="${PV:0:4}.${PV:4:2}.${PV:6:2}"
+ GDB_PT_DUMP_COMMIT="ebdc24573a4bf075cf3ab6016add9db6baacf977"
+ SRC_URI="
+ https://github.com/pwndbg/pwndbg/archive/${MY_PV}.tar.gz -> ${P}.tar.gz
+ https://github.com/martinradev/gdb-pt-dump/archive/${GDB_PT_DUMP_COMMIT}.tar.gz -> gdb-pt-dump-${GDB_PT_DUMP_COMMIT}.tar.gz
+ "
+ KEYWORDS="amd64 ~arm64 x86"
+ S="${WORKDIR}/${PN}-${MY_PV}"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ dev-debug/gdb[python,${PYTHON_SINGLE_USEDEP}]
+ $(python_gen_cond_dep '
+ >=dev-libs/capstone-5.0_rc4[python,${PYTHON_USEDEP}]
+ >=dev-python/psutil-5.9.5[${PYTHON_USEDEP}]
+ >=dev-python/pycparser-2.21[${PYTHON_USEDEP}]
+ >=dev-python/pyelftools-0.29[${PYTHON_USEDEP}]
+ >=dev-python/pygments-2.15.1[${PYTHON_USEDEP}]
+ >=dev-python/tabulate-0.9.0[${PYTHON_USEDEP}]
+ >=dev-python/typing-extensions-4.6.1[${PYTHON_USEDEP}]
+ >=dev-util/pwntools-4.10.0[${PYTHON_USEDEP}]
+ >=dev-util/ROPgadget-7.2[${PYTHON_USEDEP}]
+ >=dev-util/unicorn-2.0.1[python,${PYTHON_USEDEP}]
+ ')"
+
+PATCHES=(
+ "${FILESDIR}/${P}-no-venv.patch" # Bug 918705
+)
+
+src_prepare() {
+ if [[ ${PV} == *9999 ]]; then
+ rm -r gdb-pt-dump/.git || die
+ else
+ sed -e "s/__version__ = '\(.*\)'/__version__ = '${PV}'/" \
+ -i pwndbg/lib/version.py || die
+
+ rm -r gdb-pt-dump || die
+ mv "${WORKDIR}/gdb-pt-dump-${GDB_PT_DUMP_COMMIT}" gdb-pt-dump || die
+ fi
+
+ python_fix_shebang "${S}"
+ default
+}
+
+src_install() {
+ insinto /usr/share/${PN}
+ doins -r pwndbg/ gdbinit.py # ida_script.py
+ doins -r gdb-pt-dump/
+
+ python_optimize "${ED}"/usr/share/${PN}
+
+ make_wrapper "pwndbg" \
+ "gdb -x \"${EPREFIX}/usr/share/${PN}/gdbinit.py\"" || die
+
+ dodoc {README,DEVELOPING,FEATURES}.md
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ einfo "\nUsage:"
+ einfo " ~$ pwndbg <program>"
+ ewarn "\nWARNING!!!"
+ ewarn "Some pwndbg commands only works with libc debug symbols.\n"
+ ewarn "See also:"
+ ewarn " * https://github.com/pentoo/pentoo-overlay/issues/521#issuecomment-548975884"
+ ewarn " * https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html"
+ ewarn " * https://wiki.gentoo.org/wiki/Debugging"
+ fi
+}
diff --git a/dev-debug/pwndbg/pwndbg-99999999.ebuild b/dev-debug/pwndbg/pwndbg-99999999.ebuild
new file mode 100644
index 000000000000..304326ef2983
--- /dev/null
+++ b/dev-debug/pwndbg/pwndbg-99999999.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=poetry
+DISTUTILS_SINGLE_IMPL=1
+PYTHON_COMPAT=( python3_{10..11} )
+
+inherit distutils-r1 wrapper
+
+DESCRIPTION="A GDB plug-in that makes debugging with GDB suck less"
+HOMEPAGE="https://github.com/pwndbg/pwndbg"
+
+if [[ ${PV} == "99999999" ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/pwndbg/pwndbg"
+else
+ MY_PV="${PV:0:4}.${PV:4:2}.${PV:6:2}"
+ SRC_URI="https://github.com/pwndbg/pwndbg/archive/${MY_PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64 ~x86"
+ S="${WORKDIR}/${PN}-${MY_PV}"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+
+RDEPEND="
+ dev-debug/gdb[python,${PYTHON_SINGLE_USEDEP}]
+ ~dev-python/gdb-pt-dump-0.0.0_p20231111[${PYTHON_SINGLE_USEDEP}]
+ $(python_gen_cond_dep '
+ >=dev-libs/capstone-5.0_rc4[python,${PYTHON_USEDEP}]
+ >=dev-python/psutil-5.9.5[${PYTHON_USEDEP}]
+ >=dev-python/pycparser-2.21[${PYTHON_USEDEP}]
+ >=dev-python/pyelftools-0.29[${PYTHON_USEDEP}]
+ >=dev-python/pygments-2.15.1[${PYTHON_USEDEP}]
+ >=dev-python/tabulate-0.9.0[${PYTHON_USEDEP}]
+ >=dev-python/typing-extensions-4.6.1[${PYTHON_USEDEP}]
+ >=dev-util/pwntools-4.10.0[${PYTHON_USEDEP}]
+ >=dev-util/ROPgadget-7.2[${PYTHON_USEDEP}]
+ >=dev-util/unicorn-2.0.1[python,${PYTHON_USEDEP}]
+ ')
+"
+
+src_prepare() {
+ if [[ ${PV} != 99999999 ]]; then
+ sed -e "s/__version__ = '\(.*\)'/__version__ = '${PV}'/" \
+ -i pwndbg/lib/version.py || die
+ fi
+
+ default
+}
+
+src_install() {
+ distutils-r1_src_install
+
+ insinto /usr/share/${PN}
+ doins gdbinit.py
+
+ # Signal pwndbg not to create it's own python venv (Bug #918705).
+ # See: https://github.com/pwndbg/pwndbg/commit/139b7542cd9567eaff32bd713df971b6ac5b81de
+ touch "${ED}/usr/share/${PN}/.skip-venv" || die
+
+ python_optimize "${ED}"/usr/share/${PN}
+
+ make_wrapper "pwndbg" \
+ "gdb -x \"${EPREFIX}/usr/share/${PN}/gdbinit.py\"" || die
+
+ dodoc {README,DEVELOPING,FEATURES}.md
+}
+
+pkg_postinst() {
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then
+ einfo "\nUsage:"
+ einfo " ~$ pwndbg <program>"
+ ewarn "\nWARNING!!!"
+ ewarn "Some pwndbg commands only works with libc debug symbols.\n"
+ ewarn "See also:"
+ ewarn " * https://github.com/pentoo/pentoo-overlay/issues/521#issuecomment-548975884"
+ ewarn " * https://sourceware.org/gdb/onlinedocs/gdb/Separate-Debug-Files.html"
+ ewarn " * https://wiki.gentoo.org/wiki/Debugging"
+ fi
+}