2023-10-09 19:29:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake }:
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pe-parse";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "2.1.1";
|
2021-01-15 22:18:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "trailofbits";
|
|
|
|
repo = "pe-parse";
|
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-XegSZWRoQg6NEWuTSFI1RMvN3GbpLDrZrloPU2XdK2M=";
|
2021-01-15 22:18:51 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isClang [
|
|
|
|
"-Wno-error=deprecated-declarations"
|
|
|
|
]);
|
|
|
|
|
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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Principled, lightweight parser for Windows portable executable files";
|
2021-01-15 22:18:51 +00:00
|
|
|
homepage = "https://github.com/trailofbits/pe-parse";
|
2023-10-09 19:29:22 +00:00
|
|
|
changelog = "https://github.com/trailofbits/pe-parse/releases/tag/v${version}";
|
2021-01-15 22:18:51 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|