2021-01-15 22:18:51 +00:00
|
|
|
{ stdenv, lib, fetchFromGitHub, cmake }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pe-parse";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "2.0.0";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "trailofbits";
|
|
|
|
repo = "pe-parse";
|
|
|
|
rev = "v${version}";
|
2022-05-18 14:49:53 +00:00
|
|
|
hash = "sha256-HwWlMRhpB/sa/JRyAZF7LZzkXCCyuxB+gtDAfHt7e6k=";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
# See https://github.com/trailofbits/pe-parse/issues/169
|
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-sign-conversion";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckPhase = ''
|
2022-05-18 14:49:53 +00:00
|
|
|
$out/bin/dump-pe ../tests/assets/example.exe
|
2021-01-15 22:18:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A principled, lightweight parser for Windows portable executable files";
|
|
|
|
homepage = "https://github.com/trailofbits/pe-parse";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ arturcygan ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "dump-pe";
|
|
|
|
platforms = platforms.unix;
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
}
|