1{ lib
2, buildPythonPackage
3, capstone
4, click
5, cryptography
6, fetchFromGitHub
7, pefile
8, pycryptodomex
9, pyelftools
10, pythonOlder
11, typing-extensions
12, yara-python
13}:
14
15buildPythonPackage rec {
16 pname = "malduck";
17 version = "4.1.0";
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "CERT-Polska";
22 repo = pname;
23 rev = "v${version}";
24 sha256 = "04d8bhzax9ynbl83hif9i8gcs29zrvcay2r6n7mcxiixlxcqciak";
25 };
26
27 propagatedBuildInputs = [
28 capstone
29 click
30 cryptography
31 pefile
32 pycryptodomex
33 pyelftools
34 typing-extensions
35 yara-python
36 ];
37
38 postPatch = ''
39 substituteInPlace requirements.txt \
40 --replace "pefile==2019.4.18" "pefile"
41 '';
42
43 # Project has no tests. They will come with the next release
44 doCheck = false;
45
46 pythonImportsCheck = [ "malduck" ];
47
48 meta = with lib; {
49 description = "Helper for malware analysis";
50 homepage = "https://github.com/CERT-Polska/malduck";
51 license = with licenses; [ bsd3 ];
52 maintainers = with maintainers; [ fab ];
53 };
54}