From d06a34e95d071d268cdcbde69401e5d65a869fb9 Mon Sep 17 00:00:00 2001 From: Moritz Sanft <58110325+msanft@users.noreply.github.com> Date: Mon, 8 Apr 2024 09:57:40 +0200 Subject: [PATCH] python3Packages.pwndbg: init at 2024.02.14 --- .../python-modules/pwndbg/default.nix | 80 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 4 + 2 files changed, 84 insertions(+) create mode 100644 pkgs/development/python-modules/pwndbg/default.nix diff --git a/pkgs/development/python-modules/pwndbg/default.nix b/pkgs/development/python-modules/pwndbg/default.nix new file mode 100644 index 000000000000..7bee0345afdb --- /dev/null +++ b/pkgs/development/python-modules/pwndbg/default.nix @@ -0,0 +1,80 @@ +{ lib +, stdenv +, buildPythonPackage +, fetchFromGitHub +, capstone +, future +, ipython +, psutil +, pwntools +, pycparser +, pyelftools +, pygments +, requests +, rpyc +, sortedcontainers +, tabulate +, typing-extensions +, unicorn +, gdb-pt-dump +, poetry-core +, pythonRelaxDepsHook +}: +let + # The newest gdb-pt-dump is incompatible with pwndbg 2024.02.14. + # See https://github.com/martinradev/gdb-pt-dump/issues/29 + gdb-pt-dump' = gdb-pt-dump.overrideAttrs (oldAttrs: { + version = "0-unstable-2023-11-11"; + + src = fetchFromGitHub { + inherit (oldAttrs.src) owner repo; + rev = "89ea252f6efc5d75eacca16fc17ff8966a389690"; + hash = "sha256-i+SAcZ/kgfKstJnkyCVMh/lWtrJJOHTYoJH4tVfYHrE="; + }; + + # This revision relies on the package being imported from within GDB, which + # won't work with pythonImportsCheck. + pythonImportsCheck = [ ]; + }); +in +buildPythonPackage rec { + pname = "pwndbg"; + version = "2024.02.14"; + pyproject = true; + + src = fetchFromGitHub { + owner = "pwndbg"; + repo = "pwndbg"; + rev = version; + hash = "sha256-/pDo2J5EtpWWCurD7H34AlTlQi7WziIRRxHxGm3K2yk="; + }; + + nativeBuildInputs = [ poetry-core pythonRelaxDepsHook ]; + pythonRelaxDeps = true; + + propagatedBuildInputs = [ + capstone + future + ipython + psutil + pwntools + pycparser + pyelftools + pygments + requests + rpyc + sortedcontainers + tabulate + typing-extensions + unicorn + gdb-pt-dump' + ]; + + meta = { + description = "Exploit Development and Reverse Engineering with GDB Made Easy"; + homepage = "https://pwndbg.re"; + changelog = "https://github.com/pwndbg/pwndbg/releases/tag/${version}"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ msanft ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f9a53e944bdf..f33225e8e8eb 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4614,6 +4614,8 @@ self: super: with self; { gdata = callPackage ../development/python-modules/gdata { }; + gdb-pt-dump = callPackage ../development/python-modules/gdb-pt-dump { }; + gdcm = toPythonModule (pkgs.gdcm.override { inherit (self) python; enablePython = true; @@ -10393,6 +10395,8 @@ self: super: with self; { pwlf = callPackage ../development/python-modules/pwlf { }; + pwndbg = callPackage ../development/python-modules/pwndbg { }; + pwntools = callPackage ../development/python-modules/pwntools { debugger = pkgs.gdb; };