1{ lib 2, buildPythonPackage 3, capstone 4, crytic-compile 5, fetchFromGitHub 6, intervaltree 7, ply 8, prettytable 9, protobuf 10, pyelftools 11, pyevmasm 12, pysha3 13, pytestCheckHook 14, pythonOlder 15, pyyaml 16, rlp 17, stdenv 18, unicorn 19, wasm 20, yices 21, z3 22}: 23 24buildPythonPackage rec { 25 pname = "manticore"; 26 version = "0.3.7"; 27 format = "setuptools"; 28 29 disabled = pythonOlder "3.7"; 30 31 src = fetchFromGitHub { 32 owner = "trailofbits"; 33 repo = "manticore"; 34 rev = version; 35 hash = "sha256-+17VBfAtkZZIi3SF5Num1Uqg3WjIpgbz3Jx65rD5zkM="; 36 }; 37 38 propagatedBuildInputs = [ 39 crytic-compile 40 intervaltree 41 ply 42 prettytable 43 protobuf 44 pyevmasm 45 pysha3 46 pyyaml 47 rlp 48 wasm 49 ] ++ lib.optionals (stdenv.isLinux) [ 50 capstone 51 pyelftools 52 unicorn 53 ]; 54 55 postPatch = '' 56 # Python API is not used in the code, only z3 from PATH 57 substituteInPlace setup.py \ 58 --replace "z3-solver" "" \ 59 --replace "crytic-compile==0.2.2" "crytic-compile>=0.2.2" 60 ''; 61 62 checkInputs = [ 63 pytestCheckHook 64 ]; 65 66 preCheck = '' 67 export PATH=${yices}/bin:${z3}/bin:$PATH 68 ''; 69 70 disabledTestPaths = [ 71 "tests/ethereum" # Enable when solc works again 72 "tests/ethereum_bench" 73 ] ++ lib.optionals (!stdenv.isLinux) [ 74 "tests/native" 75 "tests/other/test_locking.py" 76 "tests/other/test_state_introspection.py" 77 ]; 78 79 disabledTests = [ 80 # Failing tests 81 "test_chmod" 82 "test_timeout" 83 "test_wasm_main" 84 # Slow tests 85 "testmprotectFailSymbReading" 86 "test_ConstraintsForking" 87 "test_resume" 88 "test_symbolic" 89 "test_symbolic_syscall_arg" 90 "test_state_merging" 91 "test_decree" 92 "test_register_comparison" 93 "test_arguments_assertions_armv7" 94 "test_integration_basic_stdout" 95 "test_fclose_linux_amd64" 96 "test_fileio_linux_amd64" 97 "test_arguments_assertions_amd64" 98 "test_ioctl_bogus" 99 "test_ioctl_socket" 100 "test_brk_regression" 101 "test_basic_arm" 102 "test_logger_verbosity" 103 "test_profiling_data" 104 "test_integration_basic_stdin" 105 "test_getchar" 106 "test_ccmp_reg" 107 "test_ld1_mlt_structs" 108 "test_ccmp_imm" 109 "test_try_to_allocate_greater_than_last_space_memory_page_12" 110 "test_not_enough_memory_page_12" 111 "test_PCMPISTRI_30_symbolic" 112 "test_ld1_mlt_structs" 113 "test_time" 114 "test_implicit_call" 115 "test_trace" 116 "test_plugin" 117 # Tests are failing with latest unicorn 118 "Aarch64UnicornInstructions" 119 "test_integration_resume" 120 ]; 121 122 pythonImportsCheck = [ 123 "manticore" 124 ]; 125 126 meta = with lib; { 127 # m.c.manticore:WARNING: Manticore is only supported on Linux. Proceed at your own risk! 128 broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin; 129 description = "Symbolic execution tool for analysis of smart contracts and binaries"; 130 homepage = "https://github.com/trailofbits/manticore"; 131 changelog = "https://github.com/trailofbits/manticore/releases/tag/${version}"; 132 license = licenses.agpl3Only; 133 platforms = platforms.unix; 134 maintainers = with maintainers; [ arturcygan ]; 135 }; 136}