about summary refs log tree commit diff
path: root/pkgs/development/python-modules/pwndbg/default.nix
blob: 7bee0345afdb7893a8c5b1c5164e09d61fe96e9e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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 ];
  };
}