Merge pull request #302057 from msanft/pwndbg/2024.02.14

pwndbg: 2022.12.19 -> 2024.02.14

authored by Jörg Thalheim and committed by GitHub bc79709d fa8453e3

+171 -65
+58
pkgs/by-name/pw/pwndbg/package.nix
···
··· 1 + { lib 2 + , stdenv 3 + , python3 4 + , fetchFromGitHub 5 + , makeWrapper 6 + , gdb 7 + }: 8 + 9 + let 10 + pwndbg-py = python3.pkgs.pwndbg; 11 + 12 + pythonPath = python3.pkgs.makePythonPath [ pwndbg-py ]; 13 + 14 + binPath = lib.makeBinPath ([ 15 + python3.pkgs.pwntools # ref: https://github.com/pwndbg/pwndbg/blob/2022.12.19/pwndbg/wrappers/checksec.py#L8 16 + ] ++ lib.optionals stdenv.isLinux [ 17 + python3.pkgs.ropper # ref: https://github.com/pwndbg/pwndbg/blob/2022.12.19/pwndbg/commands/ropper.py#L30 18 + python3.pkgs.ropgadget # ref: https://github.com/pwndbg/pwndbg/blob/2022.12.19/pwndbg/commands/rop.py#L32 19 + ]); 20 + in 21 + stdenv.mkDerivation rec { 22 + pname = "pwndbg"; 23 + version = lib.getVersion pwndbg-py; 24 + format = "other"; 25 + 26 + inherit (pwndbg-py) src; 27 + 28 + nativeBuildInputs = [ makeWrapper ]; 29 + 30 + installPhase = '' 31 + runHook preInstall 32 + 33 + mkdir -p $out/share/pwndbg 34 + cp gdbinit.py $out/share/pwndbg 35 + chmod +x $out/share/pwndbg/gdbinit.py 36 + 37 + # Don't require an in-package venv 38 + touch $out/share/pwndbg/.skip-venv 39 + 40 + makeWrapper ${gdb}/bin/gdb $out/bin/pwndbg \ 41 + --add-flags "-q -x $out/share/pwndbg/gdbinit.py" \ 42 + --prefix PATH : ${binPath} \ 43 + --set PYTHONPATH ${pythonPath} \ 44 + 45 + runHook postInstall 46 + ''; 47 + 48 + meta = with lib; { 49 + description = "Exploit Development and Reverse Engineering with GDB Made Easy"; 50 + mainProgram = "pwndbg"; 51 + homepage = "https://github.com/pwndbg/pwndbg"; 52 + license = licenses.mit; 53 + platforms = platforms.all; 54 + maintainers = with maintainers; [ mic92 patryk4815 msanft ]; 55 + # not supported on aarch64-darwin see: https://inbox.sourceware.org/gdb/3185c3b8-8a91-4beb-a5d5-9db6afb93713@Spark/ 56 + broken = stdenv.isDarwin && stdenv.isAarch64; 57 + }; 58 + }
+29
pkgs/development/python-modules/gdb-pt-dump/default.nix
···
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + , poetry-core 5 + }: 6 + 7 + buildPythonPackage rec { 8 + pname = "gdb-pt-dump"; 9 + version = "0-unstable-2024-04-01"; 10 + pyproject = true; 11 + 12 + src = fetchFromGitHub { 13 + owner = "martinradev"; 14 + repo = "gdb-pt-dump"; 15 + rev = "50227bda0b6332e94027f811a15879588de6d5cb"; 16 + hash = "sha256-yiP3KY1oDwhy9DmNQEht/ryys9vpgkFS+EJcSA6R+cI="; 17 + }; 18 + 19 + build-system = [ poetry-core ]; 20 + 21 + pythonImportsCheck = [ "pt" ]; 22 + 23 + meta = with lib; { 24 + description = "GDB script to enhance debugging of a QEMU-based virtual machine"; 25 + homepage = "https://github.com/martinradev/gdb-pt-dump"; 26 + license = licenses.mit; 27 + maintainers = with maintainers; [ msanft ]; 28 + }; 29 + }
+80
pkgs/development/python-modules/pwndbg/default.nix
···
··· 1 + { lib 2 + , stdenv 3 + , buildPythonPackage 4 + , fetchFromGitHub 5 + , capstone 6 + , future 7 + , ipython 8 + , psutil 9 + , pwntools 10 + , pycparser 11 + , pyelftools 12 + , pygments 13 + , requests 14 + , rpyc 15 + , sortedcontainers 16 + , tabulate 17 + , typing-extensions 18 + , unicorn 19 + , gdb-pt-dump 20 + , poetry-core 21 + , pythonRelaxDepsHook 22 + }: 23 + let 24 + # The newest gdb-pt-dump is incompatible with pwndbg 2024.02.14. 25 + # See https://github.com/martinradev/gdb-pt-dump/issues/29 26 + gdb-pt-dump' = gdb-pt-dump.overrideAttrs (oldAttrs: { 27 + version = "0-unstable-2023-11-11"; 28 + 29 + src = fetchFromGitHub { 30 + inherit (oldAttrs.src) owner repo; 31 + rev = "89ea252f6efc5d75eacca16fc17ff8966a389690"; 32 + hash = "sha256-i+SAcZ/kgfKstJnkyCVMh/lWtrJJOHTYoJH4tVfYHrE="; 33 + }; 34 + 35 + # This revision relies on the package being imported from within GDB, which 36 + # won't work with pythonImportsCheck. 37 + pythonImportsCheck = [ ]; 38 + }); 39 + in 40 + buildPythonPackage rec { 41 + pname = "pwndbg"; 42 + version = "2024.02.14"; 43 + pyproject = true; 44 + 45 + src = fetchFromGitHub { 46 + owner = "pwndbg"; 47 + repo = "pwndbg"; 48 + rev = version; 49 + hash = "sha256-/pDo2J5EtpWWCurD7H34AlTlQi7WziIRRxHxGm3K2yk="; 50 + }; 51 + 52 + nativeBuildInputs = [ poetry-core pythonRelaxDepsHook ]; 53 + pythonRelaxDeps = true; 54 + 55 + propagatedBuildInputs = [ 56 + capstone 57 + future 58 + ipython 59 + psutil 60 + pwntools 61 + pycparser 62 + pyelftools 63 + pygments 64 + requests 65 + rpyc 66 + sortedcontainers 67 + tabulate 68 + typing-extensions 69 + unicorn 70 + gdb-pt-dump' 71 + ]; 72 + 73 + meta = { 74 + description = "Exploit Development and Reverse Engineering with GDB Made Easy"; 75 + homepage = "https://pwndbg.re"; 76 + changelog = "https://github.com/pwndbg/pwndbg/releases/tag/${version}"; 77 + license = lib.licenses.mit; 78 + maintainers = with lib.maintainers; [ msanft ]; 79 + }; 80 + }
-63
pkgs/development/tools/misc/pwndbg/default.nix
··· 1 - { lib 2 - , stdenv 3 - , python3 4 - , fetchFromGitHub 5 - , makeWrapper 6 - , gdb 7 - }: 8 - 9 - let 10 - pythonPath = with python3.pkgs; makePythonPath [ 11 - capstone 12 - future 13 - psutil 14 - pwntools 15 - pycparser 16 - pyelftools 17 - pygments 18 - unicorn 19 - rpyc 20 - ]; 21 - binPath = lib.makeBinPath ([ 22 - python3.pkgs.pwntools # ref: https://github.com/pwndbg/pwndbg/blob/2022.12.19/pwndbg/wrappers/checksec.py#L8 23 - ] ++ lib.optionals stdenv.isLinux [ 24 - python3.pkgs.ropper # ref: https://github.com/pwndbg/pwndbg/blob/2022.12.19/pwndbg/commands/ropper.py#L30 25 - python3.pkgs.ropgadget # ref: https://github.com/pwndbg/pwndbg/blob/2022.12.19/pwndbg/commands/rop.py#L32 26 - ]); 27 - 28 - in stdenv.mkDerivation rec { 29 - pname = "pwndbg"; 30 - version = "2022.12.19"; 31 - format = "other"; 32 - 33 - src = fetchFromGitHub { 34 - owner = "pwndbg"; 35 - repo = "pwndbg"; 36 - rev = version; 37 - sha256 = "sha256-pyY2bMasd6GaJZZjLF48SvkKUBw3XfVa0g3Q0LiEi4k="; 38 - fetchSubmodules = true; 39 - }; 40 - 41 - nativeBuildInputs = [ makeWrapper ]; 42 - 43 - installPhase = '' 44 - mkdir -p $out/share/pwndbg 45 - cp -r *.py pwndbg gdb-pt-dump $out/share/pwndbg 46 - chmod +x $out/share/pwndbg/gdbinit.py 47 - makeWrapper ${gdb}/bin/gdb $out/bin/pwndbg \ 48 - --add-flags "-q -x $out/share/pwndbg/gdbinit.py" \ 49 - --prefix PATH : ${binPath} \ 50 - --set NIX_PYTHONPATH ${pythonPath} 51 - ''; 52 - 53 - meta = with lib; { 54 - description = "Exploit Development and Reverse Engineering with GDB Made Easy"; 55 - mainProgram = "pwndbg"; 56 - homepage = "https://github.com/pwndbg/pwndbg"; 57 - license = licenses.mit; 58 - platforms = platforms.all; 59 - maintainers = with maintainers; [ mic92 patryk4815 ]; 60 - # not supported on aarch64-darwin see: https://inbox.sourceware.org/gdb/3185c3b8-8a91-4beb-a5d5-9db6afb93713@Spark/ 61 - broken = stdenv.isDarwin && stdenv.isAarch64; 62 - }; 63 - }
···
-2
pkgs/top-level/all-packages.nix
··· 12249 12250 pwnat = callPackage ../tools/networking/pwnat { }; 12251 12252 - pwndbg = callPackage ../development/tools/misc/pwndbg { }; 12253 - 12254 pwninit = callPackage ../development/tools/misc/pwninit { 12255 inherit (darwin.apple_sdk.frameworks) Security; 12256 };
··· 12249 12250 pwnat = callPackage ../tools/networking/pwnat { }; 12251 12252 pwninit = callPackage ../development/tools/misc/pwninit { 12253 inherit (darwin.apple_sdk.frameworks) Security; 12254 };
+4
pkgs/top-level/python-packages.nix
··· 4614 4615 gdata = callPackage ../development/python-modules/gdata { }; 4616 4617 gdcm = toPythonModule (pkgs.gdcm.override { 4618 inherit (self) python; 4619 enablePython = true; ··· 10392 pweave = callPackage ../development/python-modules/pweave { }; 10393 10394 pwlf = callPackage ../development/python-modules/pwlf { }; 10395 10396 pwntools = callPackage ../development/python-modules/pwntools { 10397 debugger = pkgs.gdb;
··· 4614 4615 gdata = callPackage ../development/python-modules/gdata { }; 4616 4617 + gdb-pt-dump = callPackage ../development/python-modules/gdb-pt-dump { }; 4618 + 4619 gdcm = toPythonModule (pkgs.gdcm.override { 4620 inherit (self) python; 4621 enablePython = true; ··· 10394 pweave = callPackage ../development/python-modules/pweave { }; 10395 10396 pwlf = callPackage ../development/python-modules/pwlf { }; 10397 + 10398 + pwndbg = callPackage ../development/python-modules/pwndbg { }; 10399 10400 pwntools = callPackage ../development/python-modules/pwntools { 10401 debugger = pkgs.gdb;