2021-04-14 22:18:09 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, capstone
|
|
|
|
, click
|
|
|
|
, cryptography
|
2022-12-11 10:03:33 +00:00
|
|
|
, dnfile
|
2021-04-14 22:18:09 +01:00
|
|
|
, fetchFromGitHub
|
|
|
|
, pefile
|
|
|
|
, pycryptodomex
|
|
|
|
, pyelftools
|
|
|
|
, pythonOlder
|
2022-12-11 10:03:33 +00:00
|
|
|
, pytestCheckHook
|
2021-04-14 22:18:09 +01:00
|
|
|
, typing-extensions
|
|
|
|
, yara-python
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "malduck";
|
2022-12-11 10:03:33 +00:00
|
|
|
version = "4.3.0";
|
2022-05-07 19:36:44 +01:00
|
|
|
format = "setuptools";
|
|
|
|
|
2021-04-14 22:18:09 +01:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CERT-Polska";
|
|
|
|
repo = pname;
|
2022-04-26 01:44:51 +01:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-12-11 10:03:33 +00:00
|
|
|
hash = "sha256-1gwJhlhRLnh01AIJj07Wpba8X7V5AfACuJmZX+cfT6Y=";
|
2021-04-14 22:18:09 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
capstone
|
|
|
|
click
|
|
|
|
cryptography
|
2022-12-11 10:03:33 +00:00
|
|
|
dnfile
|
2021-04-14 22:18:09 +01:00
|
|
|
pefile
|
|
|
|
pycryptodomex
|
|
|
|
pyelftools
|
|
|
|
typing-extensions
|
|
|
|
yara-python
|
|
|
|
];
|
|
|
|
|
2021-06-30 18:04:03 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace requirements.txt \
|
2022-12-11 10:03:33 +00:00
|
|
|
--replace "pefile==2019.4.18" "pefile" \
|
|
|
|
--replace "dnfile==0.11.0" "dnfile"
|
2021-06-30 18:04:03 +01:00
|
|
|
'';
|
|
|
|
|
2022-12-11 10:03:33 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2021-06-30 18:04:03 +01:00
|
|
|
|
2022-05-07 19:36:44 +01:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"malduck"
|
|
|
|
];
|
2021-04-14 22:18:09 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Helper for malware analysis";
|
|
|
|
homepage = "https://github.com/CERT-Polska/malduck";
|
2022-12-11 09:09:49 +00:00
|
|
|
changelog = "https://github.com/CERT-Polska/malduck/releases/tag/v${version}";
|
2021-04-14 22:18:09 +01:00
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|