2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv
|
2019-10-16 08:55:01 +01:00
|
|
|
, python3
|
2018-12-01 11:01:45 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
|
|
|
, gdb
|
2019-10-16 08:55:01 +01:00
|
|
|
}:
|
2018-04-06 08:21:43 +01:00
|
|
|
|
2019-10-16 08:55:01 +01:00
|
|
|
let
|
|
|
|
pythonPath = with python3.pkgs; makePythonPath [
|
2018-04-06 08:21:43 +01:00
|
|
|
future
|
|
|
|
isort
|
|
|
|
psutil
|
|
|
|
pycparser
|
|
|
|
pyelftools
|
|
|
|
python-ptrace
|
|
|
|
ROPGadget
|
|
|
|
six
|
|
|
|
unicorn
|
|
|
|
pygments
|
|
|
|
];
|
|
|
|
|
2019-10-16 08:55:01 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "pwndbg";
|
2021-08-17 16:48:28 +01:00
|
|
|
version = "2021.06.22";
|
2019-10-16 08:55:01 +01:00
|
|
|
format = "other";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "pwndbg";
|
|
|
|
repo = "pwndbg";
|
|
|
|
rev = version;
|
2021-08-17 16:48:28 +01:00
|
|
|
sha256 = "sha256-8jaWhpn7Q3X7FBHURX6nyOAhu+C113DnC4KBSE3FBuE=";
|
2019-10-16 08:55:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2018-04-06 08:21:43 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/pwndbg
|
|
|
|
cp -r *.py pwndbg $out/share/pwndbg
|
2019-10-16 08:55:01 +01:00
|
|
|
chmod +x $out/share/pwndbg/gdbinit.py
|
2018-04-06 08:21:43 +01:00
|
|
|
makeWrapper ${gdb}/bin/gdb $out/bin/pwndbg \
|
2019-10-16 08:55:01 +01:00
|
|
|
--add-flags "-q -x $out/share/pwndbg/gdbinit.py" \
|
|
|
|
--set NIX_PYTHONPATH ${pythonPath}
|
2018-04-06 08:21:43 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-23 12:26:19 +00:00
|
|
|
meta = with lib; {
|
2018-04-06 08:21:43 +01:00
|
|
|
description = "Exploit Development and Reverse Engineering with GDB Made Easy";
|
2019-12-08 16:50:31 +00:00
|
|
|
homepage = "https://github.com/pwndbg/pwndbg";
|
2018-04-06 08:21:43 +01:00
|
|
|
license = licenses.mit;
|
2021-03-12 05:23:08 +00:00
|
|
|
platforms = platforms.all;
|
2018-04-06 08:21:43 +01:00
|
|
|
maintainers = with maintainers; [ mic92 ];
|
|
|
|
};
|
|
|
|
}
|