https://github.com/trailofbits/manticore

sort by:
Revision Author Date Message Commit Date
5b4af2f Add basic test 25 April 2019, 19:14:53 UTC
966e642 Fix #1412 24 April 2019, 19:54:18 UTC
22cdf85 Fix DECREE Magic Pages (#1413) Travis is almost done and the relevant parts have passed 24 April 2019, 00:42:02 UTC
aadd7a0 Migrate sandshrew concolic executor as Manticore script (#1396) * Add consolidated sandshrew concolic testing script * Migrate repository content into one-file script * Reorganize for code style consistency * Optimizations to sandshrew script * Add sandshrew example test cases * Move test cases over from standalone repo * Add Makefile * Add sandshrew documentation files 22 April 2019, 21:15:19 UTC
9c9b619 Fix Travis Coverage (#1409) * Fix JOB_COUNT env var That took way longer than it should have to figure out * Fix incorrect comment Whoops... 19 April 2019, 21:18:14 UTC
3fc2faa Fix CodeClimate Master (#1408) Fixes a few CC bugs that made it into master, and marks the "too many functions" issues that we always ignore as wontfix. Travis is green so I'm just going to merge this. 19 April 2019, 18:37:08 UTC
efdac08 Remove all broad excepts (#1405) 18 April 2019, 17:59:28 UTC
220b949 PEP-257: Change docstrings using single quotes to double quotes (#1401) * PEP-257: change docustrings using single quotes to double quotes Signed-off-by: binaryflesh <logan.campos123@gmail.com> * fix pseudocode in docstring Signed-off-by: binaryflesh <logan.campos123@gmail.com> 17 April 2019, 09:53:01 UTC
d0a5ec2 Add bash syntax highlighting to shell examples in README (#1402) Signed-off-by: binaryflesh <logan.campos123@gmail.com> 17 April 2019, 09:49:43 UTC
67c1d66 Update README.md (#1397) 04 April 2019, 00:27:08 UTC
913c258 Concretize `pc` if possible to resolve issue #1394 (#1395) 28 March 2019, 20:23:50 UTC
a1f8fb3 Fix logic for solc relative path (#1393) This allows solc-select (which runs in docker) to correctly access the relative path of a sol file. 26 March 2019, 15:14:25 UTC
f4582b3 Only publish events when there is one subscriber (#1388) * Only publish events when there is one subscriber Performance optimization * Move sub_events to init. * Revert "Move sub_events to init." This reverts commit 0859a630203edaa7b7d2bd63fdb676a6bdb5f84a. * Update event.py 26 March 2019, 15:14:02 UTC
d3e4c0f Fix #1391 (#1392) 25 March 2019, 13:39:23 UTC
d287024 Release 0.2.5 (#1390) Travis passed in a previous build so we won't bother re-running it for changes to documentation. 18 March 2019, 22:09:42 UTC
3a460d5 Load truffle json artifacts (#1376) * WIP load truffle json artifacts * No 'signature' * Better truffle -artifact support * CC * Add basic test for truffle artifacs and update solidity linking * Missing data file for truffle test * CC * Add full fledged example for truffle json * Clean argument dosc for truffle * Update manticore/ethereum/manticore.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/ethereum/manticore.py Necessary for 9a93cc5 * Add check for byte type and fix f string * New lib linking bugfix * Ability to pass constructor arguments to a Truffle JSON contract (#1376) * Added sampling capabilities to RETURN.size * Update manticore/ethereum/manticore.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/ethereum/manticore.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> 18 March 2019, 18:50:56 UTC
4d0cfd4 Better doc for solc fails (#1386) * Better solc invocation failing doc * Better solc invocation failing doc * Update manticore/ethereum/manticore.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> 14 March 2019, 23:49:29 UTC
9097916 More informative errors for unimplemented EVM features (#1387) * Report the transaction type that is not yet supported * Added a more informative error about the `STATICCALL` opcode (#1168) * Reminder for when #1168 is addressed 14 March 2019, 11:56:23 UTC
10707f6 Fix #1380 - add parsetab to repo (#1383) * Fix #1380 - add parsetab to repo * Ignore parsetab in codeclimate We don't need to check autogenerated files since they shouldn't be modified by humans anyway * Yaml paths are top-level 06 March 2019, 19:48:43 UTC
71b8d2b examples/linux: Refactor, fix crackme.py (#1378) * examples/linux: Refactor crackme.py * Dockerfile: Re-add LANG environment variable See: #1300 See: #1137 27 February 2019, 00:47:55 UTC
bc77660 Unicorn Preload (#1356) Modifies the Unicorn emulator module to allow it to be used for "preloading" large binaries. It uses Unicorn to execute x64 instructions in bulk while Manticore handles IO and syscalls. State changes are aggressively written from Manticore back to Unicorn, and lazily written from Unicorn to Manticore before a syscall. Can be used to concretely execute entire binaries, but should not be used once symbolic data has been introduced. The following script demonstrates this. The user can register a plugin at startup that tells Manticore to use Unicorn to quickly execute the initialization instructions leading up to the start of `main`. The binary in question is [`multiple-styles`](https://gist.github.com/ehennenfent/a5ad9746615d1490c618a88b98769c10) from an old example. ```python from manticore.native import Manticore from manticore.core.plugin import Plugin address_of_main = 0x4009ae class concretePlugin(Plugin): def will_start_run_callback(self, state, *_args): state.cpu.emulate_until(address_of_main) m = Manticore("multiple-styles", concrete_start='coldlikeminisoda') m.register_plugin(concretePlugin()) m.run() ``` Once `main` is reached, Manticore takes over and continues execution as normal. In the case of this example, the full solution is `coldlikeminisodas`, so Manticore generates two different test cases for the remaining byte. The performance improvement for this example is only marginal because the bulk of the time is taken up by the solver, and relatively little initialization is required before executing `main`. However, more complex binaries can see very significant speedups. 26 February 2019, 19:28:22 UTC
cdae2bc Inline EVM's get_possible_solutions (#1372) This was an internal function used just once and it was recreated each time the _consume was executed which can be slow. 14 February 2019, 15:22:23 UTC
c113a13 Fix ethereum Manticore API issue, where creating a new account with the code field failed (#1371) * Fix Manticore API issue * - Added test for Manticore API issue - also bugfix for assertion 12 February 2019, 20:37:10 UTC
627abaf Rename tests: add solidity_ prefix (#1311) 12 February 2019, 19:25:00 UTC
2a48b66 Ensure native deps (better error message) (#1367) The error message for first time users can be a bit confusing ("NameError: name 'native_main' is not defined"), if native deps isn't installed and the user is running the program against a binary file. ``` $ pip3 install manticore [...] $ manticore ./app Traceback (most recent call last): File "/home/user/.local/bin/manticore", line 11, in <module> sys.exit(main()) File "/home/user/.local/lib/python3.6/site-packages/manticore/__main__.py", line 43, in main native_main(args, logger) NameError: name 'native_main' is not defined ``` After this patch, the code will instead return "ImportError: Missing some packages for native binary analysis. Please install them with pip install manticore[native]." 07 February 2019, 14:24:19 UTC
214f9e8 Make sys_lseek return offset location (#1355) Per the [man page](http://man7.org/linux/man-pages/man2/lseek.2.html#RETURN_VALUE), `lseek` should return the offset location as measured in bytes from the beginning of the file. 21 January 2019, 21:02:02 UTC
efeb5b5 Fix a typo in the documentation (#1360) 21 January 2019, 16:43:34 UTC
18265f3 Refactor tests structure (#1352) * Refactor tests structure * Travis: run whole test suite * Fix travis * Fix travis * Fix import * travis_test.sh: split tests/ directories into jobs * Fix travis_test.sh * Fix VMTests proper setup/teardown * Fix tests 17 January 2019, 10:10:02 UTC
26dc0d2 Dev single gas calc (#1353) * Try fix concolic * Let gas calc be done in a single place * Fix refactoring 17 January 2019, 01:32:40 UTC
1da68dc Symbolic memory model bugfixes (#1350) * Apply returned operands from memory read callbacks * Limit memory callbacks in favor of pluggable memory model * Support len() in bytes for bitvectors * Rolled back changes to read_int * Fix misdirected imports in logging module * Add docstring * Update expression.py 16 January 2019, 16:04:39 UTC
0627a5a Refactor not-existing SValue into BitVecVariable 15 January 2019, 19:42:30 UTC
81d42d0 Config with context (#1345) * config: try instead of asking * config.Group: `with statement` usage This changes introduces possibility to make temporary changes to config groups. * Review changes 15 January 2019, 15:53:48 UTC
3a01591 Update Capstone to 4.0.1 (#1312) * Update Capstone to 4.0 * Update Capstone to 4.0.1 As it is there! https://pypi.org/project/capstone/#history It has a minor bug with getting the extra version number but it doesn't hit us at all (see https://github.com/aquynh/capstone/issues/1315#issuecomment-454386418). 15 January 2019, 14:38:11 UTC
848fb7e evm: fix _check_jumpdest when run with detectors (#1347) * evm: fix _check_jumpdest when run with detectors When ManticoreEVM is run with detectors, the self.pc in EVM is a Constant (as we need to taint it). Because of that, the check: ``` if pc not in self._valid_jumpdests: raise InvalidOpcode() ``` failed - i.e. we raised an InvalidOpcode because we checked if the list contains the `Constant` object and not its value. This commit fixes this issue. * Fix the test 15 January 2019, 12:27:11 UTC
6804661 Move tx default gas value to config (#1346) 14 January 2019, 21:37:20 UTC
c705e85 Refactor config (#1335) * Optimize config.py imports * Use dict literal instead of dict() * config.py: process_config_values: add type adnotations * Annotation and docstring 14 January 2019, 17:30:50 UTC
cb078ff Fix writing pc address finding (#1344) * Print as hex values * Fix wrong attribute * Fix test 14 January 2019, 17:28:08 UTC
35be876 Fix unexisting attribute (#1341) 14 January 2019, 13:37:11 UTC
ea01069 Add info about ulimit 14 January 2019, 12:05:22 UTC
e1c519a Manticore 0.2.4 (#1338) * Manticore 0.2.4 * Move terminated state ressurecting bug to ethereum in changelog * Changelog improvements * Linkify * Add missing PR id 10 January 2019, 22:37:28 UTC
97cfde0 Fix tests that used --timeout 10 January 2019, 17:21:12 UTC
324504e Revert back the test file name 10 January 2019, 16:40:43 UTC
a812635 Fix missing consts in CLI args (#1337) * Fix constants missing from manticore --help * Use has_native for native constants * Remove duplicated args from consts: stdin_size and timeout * Move timeout back to shutdown_timeout * Update manticore/core/manticore.py 10 January 2019, 15:47:22 UTC
6f7f200 Fix verbose_trace test Fixes test regression introduced in 0e90ca3: the gas default value has changed from 90k to 3kk. 10 January 2019, 02:13:28 UTC
8b9632e Refactor solver (#1334) * Refactor docstrings and add type adnotations * Rename _check to _is_sat and return bool So we won't have to do `== 'sat'` comparison in tons of places. * Compile regular expressions just once! * Refactor imports * Refactor docstrings and recv method * Fix imports in ethereum.detectors 10 January 2019, 02:09:05 UTC
0e90ca3 Evm: change default gas to 3000000 when creating contract (#1332) 09 January 2019, 23:31:47 UTC
0814222 Explicitly require Python>=3.6 when using CLI (#1331) * Require Python>=3.6 We have this in setup.py python_requires but it doesn't work with old pip versions and we get reports that Manticore throws a SyntaxError (on a f-string literal :/). * Move check to __init__ 09 January 2019, 22:19:35 UTC
be81fb5 Speed up the EMVWorld.__str__ a bit ...so we can debug a bit faster. * moved `FILTER` outside of `hexdump` so it is created once, also renamed to `_FILTER` * moved `hexdump` func outside of `__str__` (so it doesn't recreate it each time) * changed list comprehensions to generator expressions (so we don't create unnecessary lists) This still isn't perfect and there are rooms for improvements. It's probably good to drop from using lists at all and use some efficient string concatenation method (see also https://waymoot.org/home/python_string/). 09 January 2019, 13:42:19 UTC
e83fae8 Add VerboseTraceStdout plugin (#1330) 09 January 2019, 13:21:53 UTC
28f6a46 Minor evm refactor (#1329) 09 January 2019, 11:37:31 UTC
d6aa04d Hotfix regressions (#1328) * Fix ConcretizeStack -> ConcretizeArgument rename * Fix: remove redundant calc in CALLDATACOPY_gas Note that it could crash the execution when the argument was symbolic (tested on contract from issue 1295) * Fix: not declared _value * Fix ConcretizeFee: set concretize value 08 January 2019, 20:28:24 UTC
c9eb624 Make gas calculation faithfulness configurable (#1279) * split extra gas calculation to it's own method * Fix MSTORE8 * Fix some legacy tests * Remove fork selection * Fix legacy tests. Iff Stack Underflow then gas is consumed in full * memfee is zero when size is zero * CC * 1st version of configurable gas faitfulness * Try fix concolic * Fix typo * Fix logic bug * If everything is concrete lets just check at every instruction * Fix bad import at test * CC * CC * CC * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Fix tab * Documment check_jmpdest * Remove unnecesary local var * Fix get_memfee arguments * Change docstrings comments * Fix concrete gas consumption for accesses with size 0 (Frontier). Fix auto tests maker. * Add comment of deleted constant * CC * fix merged test and add gas to vm.__str__ * Update evm.__str__ related tests * Try to fix/update output checking test * docstring OCD * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * docstring SOCD and fix oog config var * Fix oog config variable * Fix CC * Typo: ammmmount 07 January 2019, 23:44:36 UTC
e83a608 Fix terminated states resurrection (#1326) * Add testcase for 1325 * Fixes 1325 07 January 2019, 19:37:56 UTC
f349adb Make is_human a property (#1323) * Make is_human a property * Update manticore/platforms/evm.py * Better docstring 07 January 2019, 16:52:17 UTC
b7f9a46 added warning and error to sys_arch_prctl (#1319) * added warning and error to sys_arch_prctl * Changed error message and list to set literals * Removed trailing whitespace 06 January 2019, 21:49:36 UTC
64c75fb Fix evm's make_symbolic_address (#1318) * Fix evm's make_symbolic_address The code that created a constrain for created symbolic address was unreachable. * Add testcase for make_symbolic_address 03 January 2019, 11:25:31 UTC
23199f2 Minor state/platform refactor (#1320) The `StateBase` class had two properties that are only used in native engines: `cpu` and `mem`. Those two used `self._platform.current` and that `current` is a property in linux and decree platforms that returns current process platfrom (?). 02 January 2019, 15:44:06 UTC
b7626fc Add symbol resolution feature for binary analysis (#1302) * Remove obsolete symbol resolver helper * Add resolve helper for function sym resolving * Add test case for symbol resolution * Add binary path property, fix decree, fix m.resolve Refactor out resolver helper Decree missing self.program attribute Fix use of exceptions in m.resolve Make m.resolve raise exception instead of returning None Add another test case 01 January 2019, 15:46:59 UTC
4cb7e3b Refactor events and test_events (#1314) 20 December 2018, 23:21:05 UTC
c0b6ce1 Speed up ArmV7Operand.type assertions (#1313) * Speed up ArmV7Operand.type assertions So .type will now just return the value instead of building a mapping and returning a result. * Update manticore/native/cpu/arm.py * Revert debug changes 20 December 2018, 22:49:49 UTC
94991c8 Fix eth private func calls (#1306) * Add test for calling contract._func * Fix contract._func calls * EVMContract: make attributes protected * Move EVMContract __hashes={} to __init__ * Fix attribute error * Review fix 18 December 2018, 00:49:36 UTC
e3f8801 __main__.py: fetch manticore version from installed module (#1310) 18 December 2018, 00:40:13 UTC
6b80359 Migrate hook callback methods to native.Manticore (#1309) * Migrate hook callback methods to native.Manticore * Fix indentations 17 December 2018, 22:44:47 UTC
f1fa154 test_manticore: remove redundant imports (#1308) 17 December 2018, 19:24:45 UTC
b399080 Remove Py3 redundant object inheritance (#1307) 17 December 2018, 19:15:06 UTC
580b358 Refactor generate_testcase events and fix eth verbose trace plugin (#1305) * WIP * Add test * Add missing test data file * Fix missing testcase msg and assert it in test * Remove Executor.generate_testcase - just publish event * Remove redundant import * Add ManticoreBase._last_run_stats * Review fixes * Remove redundant assertions in test_basic_arm * Elapsed time calc fix 17 December 2018, 14:04:00 UTC
463a394 Fix logging regressions (#1304) * Fix logging Creates custom loggers so that we no longer need to call init_logging. Verbosity is automatically set upon logger creation, and updated in the event of manticore_verbosity being set after the fact. * Strip the stateid from the loggers It literally only ever gets set to None. * Fix deleted line That's what source control is for * Appease CodeClimate Trouble me no more, damnable machine 14 December 2018, 18:05:23 UTC
54bf795 Display registered eth detectors (#1301) * Display registered eth detectors ``` root@52356aa06255:/# manticore test.sol 2018-12-12 13:53:58,615: [1496] m.c.manticore:INFO: Verbosity set to 1. 2018-12-12 13:53:58,798: [1496] m.main:INFO: Registered plugins/detectors: DetectInvalid, DetectExternalCallAndLeak, DetectEnvInstruction, DetectReentrancySimple, DetectUninitializedMemory, DetectDelegatecall, DetectUninitializedStorage, DetectReentrancyAdvanced, DetectUnusedRetVal, DetectSuicidal, DetectIntegerOverflow 2018-12-12 13:53:58,799: [1496] m.main:INFO: Beginning analysis 2018-12-12 13:53:58,800: [1496] m.e.manticore:INFO: Starting symbolic create contract Mnemonic return Mnemonic return hooman 2018-12-12 13:53:58,933: [1496] m.e.manticore:INFO: Starting symbolic transaction: 0 2018-12-12 13:53:59,072: [1496] m.e.manticore:INFO: 0 alive states, 2 terminated states 2018-12-12 13:53:59,117: [1496] m.e.manticore:INFO: Starting symbolic transaction: 1 2018-12-12 13:53:59,133: [1558] m.e.manticore:INFO: Generated testcase No. 0 - REVERT 2018-12-12 13:53:59,462: [1558] m.e.manticore:INFO: Generated testcase No. 1 - RETURN 2018-12-12 13:53:59,590: [1496] m.c.manticore:INFO: Results in /mcore_f7hsxcpn 2018-12-12 13:53:59,591: [1496] m.c.manticore:INFO: Total time: 0.6525142192840576 ``` * Update manticore/ethereum/cli.py * Update tests/test_binaries.py 12 December 2018, 21:07:09 UTC
787237f Don't clone Manticore in Docker image (#1300) * Don't clone Manticore in Docker image So people can build image from given Manticore version, if they want. * Remove editable pip install mode * Fix typo * Dockerfile: Use LABEL instead of deprecated MAINTAINER * Download binary solc 0.4.25 * Revert debug changes from different branch 12 December 2018, 19:41:59 UTC
9412296 fix changelog bug 12 December 2018, 00:47:34 UTC
578fdc6 Manticore 0.2.3 (#1298) * bump vers * Add instructions for native install * add changelog * update * Update desc * Add contributors * fmt * correct * Update CHANGELOG.md * fix eth cli usage * update linux script * docker use native install * use native in quickstart 12 December 2018, 00:21:26 UTC
e8170ba Disable RaceCondition detector (#1299) 12 December 2018, 00:10:48 UTC
e21cdea Refactor detectors cli (#1286) * Use triple quotes for docstrings * Refactor detectors CLI * Add prettyable dependency to setup.py * Fix typo in prettytable dependency name * Fix test * Unregister detectors and plugins after finalize * Add docstrings to unregister plugin/detector * Changes: leave just --exclude-all and --exclude flags * Fix eth test * Fix setup 11 December 2018, 22:27:18 UTC
e8a6321 Add new auto CONCRETE test generator for eth vmTests (#1160) * New auto evm test generator [WIP] * New auto test generator for EVM * New VMTest mcore translator * Allow to auto-make single tests * New concrete auto test for vmTests snad tests * MAke bytecode bytes or array in tests too * Make bytecode bytes or array in tests too more * initial timestamp fix * Fix jmpdest gas test and evm * New tests style and some fixes * __init__ in test folders * Fix VMTest to unitests. Fix Array/ArraySlice default values * Added rlp to setup.py * Remove old deprecated tests * Debugging storage/memory default values * avoid gas consumption of empty reads * CC * Fix .written list for sliced arrays * Move blocknumber/timestamp out of evmworld * CC * Several gas related fix. Frontier concrete pass * Fix ArrayProxy tests * Debug travis * Split the regresion test so it prints . (dots) * If value is in the cache then it is a known index. optimization * add main to some unittest * FIx test maker * CC and skip slow test * Skipp other slow test for now * initial_timestamp -> timestamp * more skipping * Fix/mitigate expression copying issue * Try fix concolic * Fix simplification so it does not loose taint * Fix no-testcases and verbosity in tests * Extra visitor tests * Extra visitor tests * Better array slicing test. Code review. Basic fork support. VMTest concrete added * bump pyevmasm version * Remove pyevmasm version pinning * Pyevmasm from github for now * Setup.py crazyness * Pyevmasm version bump - again * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Update manticore/platforms/evm.py Co-Authored-By: feliam <felipe.andres.manzano@gmail.com> * Remove cache oddity and fix auto tests * Add some type checks * A fix 11 December 2018, 18:58:33 UTC
b11697b Fix multiple symbolic args solidity_create_contract (#1294) * Fix multiple symbolic args solidity_create_contract The `test_create_contract_two_instances` test was crashing before this PR, due to calling `make_symbolic_buffer` twice with the same buffer name (`'INITARGS'`) in `make_symbolic_arguments`. Here's an example of such crash (from a bit different test code/when I was developing it, but the idea/error is the same): ``` Error Traceback (most recent call last): File "/usr/lib/python3.6/unittest/case.py", line 59, in testPartExecutor yield File "/usr/lib/python3.6/unittest/case.py", line 605, in run testMethod() File "/home/dc/manticore_project/tests/eth_general.py", line 432, in test_create_two_instances_of_contract_no_args contract2 = self.mevm.solidity_create_contract(source_code, owner=owner, args=None) File "/home/dc/manticore_project/manticore/ethereum/manticore.py", line 587, in solidity_create_contract args = self.make_symbolic_arguments(constructor_types) File "/home/dc/manticore_project/manticore/ethereum/manticore.py", line 542, in make_symbolic_arguments return ABI.deserialize(types, self.make_symbolic_buffer(32, name="INITARGS")) File "/home/dc/manticore_project/manticore/ethereum/manticore.py", line 113, in make_symbolic_buffer return self.constraints.new_array(index_bits=256, name=name, index_max=size, value_bits=8, taint=frozenset(), avoid_collisions=avoid_collisions) File "/home/dc/manticore_project/manticore/core/smtlib/constraints.py", line 348, in new_array raise ValueError(f'Name {name} already used') ValueError: Name INITARGS already used ``` * Add avoid_collision arg to make_symbolic_buffer 10 December 2018, 19:59:45 UTC
f12d97e Fix command.sh not saved in ethereum (#1289) * Fix command.sh not saved in ethereum For native binaries Manticore saves `command.sh` and `manticore.yml` in a `_did_finish_run_callback`. For ethereum binaries this callback is called two times (not sure why), so we supress it instead: https://github.com/trailofbits/manticore/blob/c29f7cf8672014cf02cfc1271ec1d0a3cb3983af/manticore/ethereum/manticore.py#L1523-L1526 This PR moves this logic to a `ManticoreBase._save_run_data` method, so it can be used in both native and ethereum Manticore engines. As a result: * native engine works as it worked * ethereum engine will now save `command.sh` file * ethereum engine will now print the elapsed time Additionally, a bug with `command.sh` output has been fixed: when one passed argument that had spaces, e.g.: ``` manticore "path to contract/with_spaces.sol" ``` Resulted in a `command.sh`: `manticore path to contract/with_spaces.sol` which is wrong. This has been fixed by processing all arguments with `shlex.quote`, so they are quoted properly. * Update solidity timeout test 10 December 2018, 19:59:07 UTC
b1fa6b2 More explicit smt errors (#1293) 10 December 2018, 17:56:15 UTC
8f520bd Add a command line option for preconstraining symbolic human transactions (#1220) Fixes issue #731. 10 December 2018, 10:45:34 UTC
567fec2 Add combo1 to txaccount cli description (#1292) 10 December 2018, 10:44:38 UTC
a2243f6 Move benchmark->prof script and fix it (#1285) * Move benchmark->prof script and fix it * Better scripts/prof.py help 09 December 2018, 22:42:40 UTC
0f0579e Rename SolverException to SolverError (#1288) 07 December 2018, 14:13:44 UTC
c4a81ac Remove unecessary unicorn hack (#1290) 06 December 2018, 20:08:28 UTC
c29f7cf silence ply (#1284) 04 December 2018, 23:29:28 UTC
eb1de77 Detectors fixes (#1283) * Fix name shadowing in detector tests * Fixes #1102 * Fix isinstance with None 04 December 2018, 22:27:50 UTC
8d108d8 Add not implemented stub for execute() in state parent (#1282) 04 December 2018, 22:11:03 UTC
6850fe2 Hotfix: solidity timeout test 04 December 2018, 20:08:02 UTC
cae2fa9 Hotfix ethereum's Manticore logging 04 December 2018, 18:24:40 UTC
b1e6795 Hotfix: bring back detectors logging When Manticore is run with detectors, their logging is missing the stateid: ``` --- Logging error --- Traceback (most recent call last): File "/usr/lib/python3.6/logging/__init__.py", line 993, in emit msg = self.format(record) File "/usr/lib/python3.6/logging/__init__.py", line 839, in format return fmt.format(record) File "/usr/lib/python3.6/logging/__init__.py", line 579, in format s = self.formatMessage(record) File "/usr/lib/python3.6/logging/__init__.py", line 548, in formatMessage return self._style.format(record) File "/usr/lib/python3.6/logging/__init__.py", line 391, in format return self._fmt % record.__dict__ KeyError: 'stateid' ``` 04 December 2018, 18:13:07 UTC
c6e1c42 Rebased: add test for "arguments_linux_armv7" binary (#1216) * add test for "arguments_linux_armv7" binary * Refactor/clean the code * More tests asserts * Fix/remove resource warnings in tests * Binary tests: add --no-color, use proper python path * Fix test_basic_arm assert * Fix arm test * Debug on travis :_: * more debug * Travis debug prints * debug * Fix merge conflict * Fix visited assert? * Fix test binaries * Remove debugs and change regex assertions * Use sys.executable instead of /proc/self/exe to retrieve Python interperter path in tests (see comment). * Fix timeout solidity test and wrong type published It turned out that when we executed Manticore with `--timeout`, it ended up with an exception: ``` 2018-12-04 05:13:27,780: [7836] m.c.manticore:INFO: Verbosity set to 1. 2018-12-04 05:13:31,136: [7892] m.c.executor:ERROR: Exception: 'str' object has no attribute 'testcase' Traceback (most recent call last): File "/home/dc/manticore_project/manticore/core/executor.py", line 471, in run self._publish('will_terminate_state', current_state, current_state_id, 'Shutdown')# TerminateState('Shutdown')) File "/home/dc/manticore_project/manticore/utils/event.py", line 122, in _publish self._publish_impl(_name, *args, **kwargs) File "/home/dc/manticore_project/manticore/utils/event.py", line 130, in _publish_impl callback(robj(), *args, **kwargs) File "/home/dc/manticore_project/manticore/ethereum/manticore.py", line 1100, in _terminate_state_callback e.testcase = False # Do not generate a testcase file AttributeError: 'str' object has no attribute 'testcase' ``` Which occured because we published a string instead of exception instance in `executor.py:471`: ``` self._publish('will_terminate_state', current_state, current_state_id, 'Shutdown') ``` This has been fixed by changing the `'Shutdown'` to `TerminateState('Shutdown')`. * Fix amd/arm visited assertions * Fix binary tests * Fix binary tests 04 December 2018, 17:42:48 UTC
702f414 Fix native.cpu logging 04 December 2018, 11:42:01 UTC
c72c8cc Rewrite tests to be more compact (#1146) * Reorder all memory writes in test_x86 * More compact tests with mem.write * Reorder all memory checks in test_x86 * More compact tests with asserts memory * Reorder memory writes in test_dyn * Compact tests memory writes in test_dyn * Reorder memory writes * Compact memory writes * reorder meomry checks * compact memory checks * reorder memory checks * compact memory checks * reorder memory writes * compact memory writes * reorder memory checks * compact memory checks * Updates make_tests for tests to be more compact 03 December 2018, 21:55:00 UTC
74d620f Implement FPSE-like memory model (#1127) Implements am fpse-like memory model. 03 December 2018, 21:38:44 UTC
1699045 Make Manticore installable for separate targets (#1257) * WIP * WIP * WIP * Optimize imports * WIP * WIP * WIP * Fix setup.py comment * Move abitypes to ethereum * WIP: sth works lol * Set verbosity from args * WIP * Fix evm logging + minor refactor * Move ply dependency to evm setup * NOTE: Removed Manticore.evm * Check deps on setup, other improvements * Proper ethereum/__init__ external imports * Fix logging * Fix imports in tests * Fix scripts imports * Fix imports in example scripts * Fix tests? * Remove debug print * Fix circular import * Fix imports in tests * Fix verbosity test * Fix typo * Fix typo in test * Fix measure cov * Small review fixes * Reviewfix: move STDIN_INPUT~ to consts.stdin_size * Reviewfix: dont alias evm/native main funcs * Fix missing consts.stdin_size * Remove redundant list() call * Fix types in docstrings * Use relative imports * Fix types in docstring * Move invoke_model back to native State * Split only to manticore, manticore[native] * Fix dev and dev-noks setup extras * Review fixes * Move core/cpu -> native/cpu * Update Changelog * Import fixes * Fix test imports * Fix cpu automatic tests imports * Fix imports in tests * Fix imports & deprecated warning * Fix imports * Fix imports * Fix imports * Fix travis measure_cov path * Add comment about native deps * Use ManticoreBase.verbosity as static method * Fix docs build * Fix loger test * Move imports: from manticore import issymbolic, istainted * Docs fixes * Fix issymbolic import in test 03 December 2018, 20:20:55 UTC
f9506c8 Add missing `f`-string (#1281) 27 November 2018, 17:45:24 UTC
2d3de3e Incorrect branching based on instance type (#1280) The else condition can never be fulfilled as it is the same as the one inside the if statement. 27 November 2018, 12:10:17 UTC
b2374c3 BitvecConcat simplification fix (#1275) * BitvecConcat needs size not end * Add regression test for concat simplification 21 November 2018, 13:47:43 UTC
0e082d2 Add MJ10 (#1273) 19 November 2018, 17:48:57 UTC
3c6df93 Remove kwargs from ManticoreEVM (#1271) * Remove kwargs from ManticoreEVM Removing `kwargs` from `ManticoreEVM` as it is not needed here. It is because it is passed to `Manticore` which uses `kwargs` only in the case when the `path_or_state` is a path. The `ManticoreEVM` passes this argument as already created `State` so the `kwargs` are never used for `ManticoreEVM`. This will also prevent users from using old API that has been removed e.g. `ManticoreEVM(verbosity=5)`. * Fix init 17 November 2018, 18:27:42 UTC
48304e7 Fixed setstate reference before assignment (#1270) 16 November 2018, 22:30:59 UTC
9a0c7c9 Fixes #1067 (#1254) * moved repeated code into functions in separate file * changed repeated code to function calls * fix trailing whitespace in docstring detected by pep8 check * line 1525 of manticore/ethereum/__init__.py was missing leading white space * pep8 expects 2 blank lines between function definitions. Rookie move, rookie. * Update string_formatting.py * changing format strings to f strings * Update string_formatting.py change format strings to f strings * small change because CI failed, need to push again * change F format strings to f format strings, moved external functions into __init__ file where they are used. * Combined contract_addr and evm_program_counter in to one function, write_findings 14 November 2018, 10:28:05 UTC
back to top