blob: 1893d7ef0b2eecc375ecbbf4a4ca38ddbcc46e41 (
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
81
82
83
|
{ lib
, stdenv
, fetchFromGitHub
, makeWrapper
, gdb
, python3
, bintools-unwrapped
, file
, ps
, git
, coreutils
}:
let
pythonPath = with python3.pkgs; makePythonPath [
keystone-engine
unicorn
capstone
ropper
];
in stdenv.mkDerivation rec {
pname = "gef";
version = "2023.08";
src = fetchFromGitHub {
owner = "hugsy";
repo = "gef";
rev = version;
sha256 = "sha256-MqpII3jhSc6aP/WQDktom2wxAvCkxCwfs1AFWij5J7A=";
};
dontBuild = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
mkdir -p $out/share/gef
cp gef.py $out/share/gef
makeWrapper ${gdb}/bin/gdb $out/bin/gef \
--add-flags "-q -x $out/share/gef/gef.py" \
--set NIX_PYTHONPATH ${pythonPath} \
--prefix PATH : ${lib.makeBinPath [
python3
bintools-unwrapped # for readelf
file
ps
]}
'';
nativeCheckInputs = [
gdb
file
ps
git
python3
python3.pkgs.pytest
python3.pkgs.pytest-xdist
python3.pkgs.keystone-engine
python3.pkgs.unicorn
python3.pkgs.capstone
python3.pkgs.ropper
];
checkPhase = ''
# Skip some tests that require network access.
sed -i '/def test_cmd_shellcode_get(self):/i \ \ \ \ @unittest.skip(reason="not available in sandbox")' tests/runtests.py
sed -i '/def test_cmd_shellcode_search(self):/i \ \ \ \ @unittest.skip(reason="not available in sandbox")' tests/runtests.py
# Patch the path to /bin/ls.
sed -i 's+/bin/ls+${coreutils}/bin/ls+g' tests/runtests.py
# Run the tests.
make test
'';
meta = with lib; {
description = "A modern experience for GDB with advanced debugging features for exploit developers & reverse engineers";
homepage = "https://github.com/hugsy/gef";
license = licenses.mit;
platforms = platforms.all;
maintainers = with maintainers; [ freax13 ];
};
}
|