Commit Graph
247 Commits
Author SHA1 Message Date
Mark Mossberg e78ae8904e Add Manticore version to issue template (#447)
* Add Manticore version to issue template

* Update ISSUE_TEMPLATE.md
2017-08-10 15:06:51 -04:00
Mark Mossberg eef3cd20e2 Implement state.generate_testcase (#438)
* ran

* Some dirty work

* Rm unnecessary sanitization

* Fix state.generate_inputs event publishing

We don't need to manually pass `self` because State is automatically
forwarded as an argument. Also correctly specify a message for the state
and expose to the API

* Rename

* Update test for new save_testcase args, make test more robust

* Simplify arguments related to generate_testcase_callback by removing default arg. Add test for this behavior

* Minor test fixup

* Add official API docs

* Remove unnecessary new event type
2017-08-08 18:12:55 -04:00
Mark Mossberg 9ae76a4430 Fix testcase generation output (#436) 2017-08-07 08:08:37 -07:00
Dushyanth Chowdary 68555f5234 Fixing raise issue #435 (#437) 2017-08-04 18:27:15 -07:00
JP Smith af3020db95 log testcase generation (#430) 2017-08-04 17:18:45 -04:00
Mark Mossberg 7b832724a6 Implement symbolic branch tracking in core, add new fork event (#433)
* Add fork_state event for individual state forks

* Rename to forking_state, add branch tracking to state

* Remove unnecessary locking around event publishing
2017-08-03 14:13:40 -07:00
Yan 5ad18e736c Produce fork-related output at info level from mcore (#429) 2017-08-02 17:31:29 -04:00
feliam 3b57c0d502 Fix context serialization (#425)
* Fix context serialization

* Fix test models.  Can not set a state constraints

* typo

* A few typos (constraints setter) and use of public properties in internal methods

* State __init__ needs to initialize platform constraints

* Internal methods use internal properties

* test_record_branches removed
2017-08-01 14:08:54 -03:00
JP Smith 271400728c remove state.generate_inputs (#385) 2017-07-31 14:39:47 -04:00
Eric Hennenfent 51837df98b Add Taint Parameters (#414)
* Add taint args to buffer creation

Allows the `new_symbolic_buffer` and `symbolicate_buffer` functions to take keyword args for tainting. Defaults to frozenset in both cases.

* Add unit tests and ArrayProxy taint propery

Adds simple unit tests for tainted buffers. Added a property to the ArrayProxy class in smtlib.expression so that it's possible to access the taint of the proxied ArrayVariable.

* Updated docstrings
2017-07-28 11:58:25 -04:00
feliam 76357216da Pub-sub like events (#371)
* WIP New Policy class

* WIP pubsub

* Update Signal tests

* small fixes from github comments

* Fix event decode_instruction signature

* Good merge

* Good good merge

* Eventful class commented

* The million typos

* Code revision

* Fix tests for new mor strict Eventful
2017-07-27 19:41:08 -03:00
JP Smith a3cf6e7d2c Fix warning during regular analysis (#420)
* only make context warning appear when appropriate

* implement felipe's suggestion
2017-07-27 12:31:58 -04:00
JP Smith d1ead7a7be remove naked print from executor.py (#410) 2017-07-21 16:03:26 -04:00
JP Smith 8d19dc507d Fix solver call in decree (#409) 2017-07-21 15:34:33 -04:00
JP Smith d9c226b89d Fix forking state from memory (#407)
* import ForkState before use

* Fix ForkState behavior
2017-07-20 16:02:13 -04:00
JP Smith 7f54a4342c Make makeDecree conform to convention and fix --data (#402)
* fix makeDecree to work with scripting

* fix concrete_data
2017-07-19 10:51:31 -04:00
JP Smith 74bd5ed832 remove grr snapshot support (#400) 2017-07-18 17:25:17 -04:00
JP Smith 344ade98ee Add optional redis dependency to setup.py (#399)
* add optional redis dependency to setup.py

* update installation documentation

* clarify docs and add redis to dev install
2017-07-18 16:34:37 -04:00
Frank Busse be2494df44 Expose symbolic files to command line interface, implement whence for symbolic seek (#394)
* add --file <symbolic file> flag

* fix seek argument count error, add rudimentary whence support

* symbolic file seek: fix docstring and semantics
2017-07-18 11:38:41 -04:00
JP Smith 47a5d9752f Make save_stream pass through kwargs (#396)
* make save_stream pass through kwargs

* make base save_stream ok with extra [kw]args

* make key argument explicit
2017-07-17 14:06:42 -04:00
JP Smith ddc3b12848 Fixed CHANGELOG.md typo (#395) 2017-07-17 10:36:31 -04:00
JP Smith 97115212e1 add pypi badge to README.md (#391) 2017-07-14 18:01:14 -04:00
JP Smith 4bb48af199 Manticore 0.1.3 (#390)
* Manticore 0.1.3

* fix compare URL
2017-07-14 11:56:21 -04:00
JP Smith 13964d053b create workspace before running manticore to make memdump tests pass (#388) 2017-07-13 13:57:18 -04:00
Mark Mossberg 03ee876005 Add basic documentation on function modeling (#386)
* Add basic models docs

* Phrasing

* Minor fixes
2017-07-13 11:57:07 -04:00
JP Smith 60fa4c2231 Fix memdump tests broken by dev-events (#377)
* fix memdump tests broken by dev-events

* switch to superset check to account for timeout differences
2017-07-12 18:11:08 -04:00
Yan 45d5b9f6d2 New state serialization (#376)
* Fix naming

* Separate storage from workspace

* Begin removing output generation from manticore.py

* Split up workspace and output

* Create a separation between output and workspace

* Get it to a working (hacky) state

* Start bringing state serialization into workspace

* More mcore->workspace moves

* Remove unused imports

* Update serializers; add interface

* move state saving to workspace

* can now save/load states and testcases

* Add redis as backend

* Implement streams in terms of values and vice versa

* Implement `ls` and move workspace loading to Workspace

* Better workspace initialization

* Fix how --workspace is parsed for tests

* update tests to new workspace indexes

* Fix state storage and handling

* Doc updates and extra error checking

* pep8 style changes

* Add Executor's 'sync'

* Remove previous workspace artifacts from Executor

* Comment out constraints check assert

* Centralize locking to new testcase ids

* Fix testcase generation

* pep8 updates

* propagate descriptor instead of path

* Add an in-memory state store

* Make memory maps be sortable

* Allow to produce an empty state

* Add workspace tests

* Make Memory.__cmp__() more robust
2017-07-12 17:50:24 -04:00
JP Smith f134ad6fb4 Check for negative fds in fstat (#384)
* check for negative fds in fstat

* use _get_fd
2017-07-11 16:02:32 -04:00
JP Smith c887fb160e Fix script verbosity (#382)
* fix script verbosity

* show manticore logger

* remove unused MAIN logger
2017-07-11 12:06:33 -04:00
JP Smith b47f0cff14 fix lowering verbosity (#383) 2017-07-11 11:36:38 -04:00
JP Smith b6a71375cf Remove md5 tests and replace with set comparison (#374)
* remove md5 tests and replace with comparison

* fix directory path issue

* remove exact check as test is not deterministic

* fix argument assertion test and remove cdet_visited.txt

* allow extra addresses in actual to account for inter-machine differences
2017-07-07 15:43:52 -04:00
Mark Mossberg e4102e5000 Catch and refactor MemoryExceptions (#370)
* initial

* Clean, only store address in message if not symbolic

If it's symbolic,it renders like

    Generating testcase No. 2 - Invalid symbolic memory access (mode:r) <<manticore.core.smtlib.expression.BitVecAnd object at 0x7fd6dcd14410>>

which is not useful output to the user.

* Format as hex

* Fix tests

* Rm comments
2017-06-30 17:47:55 -04:00
JP Smith fcb375ac76 stop double-logging error traces (#369) 2017-06-29 17:38:41 -04:00
Yan bd89bfed24 Only iterate instance variables for forward_signals() (#367) 2017-06-29 16:03:10 -04:00
Corbin Riggs f58cac7451 Fixes ConcretizeArgument Misspelling (#366) 2017-06-29 14:00:34 -04:00
JP Smith fcf0024d5d Fix capstone MOV issue (#365)
* add temporary workaround for capstone bug

* rename cs to rest
2017-06-29 12:02:31 -04:00
Mark Mossberg 7c00b44675 Update docs (#360)
* Update State docs

* Update manticore docs

* Document models

* Doc models

* Use sphinx link
2017-06-28 14:58:23 -04:00
Mark Mossberg b197a47f96 Adjust verbosity settings (#358)
* Show "Generating testcase" message by default

* Rephrase program finished to be less obtuse

* Rm excessive debug print
2017-06-27 19:18:41 -04:00
Garret Reece 7d3d9a9ed1 lsl.w in thumb mode fixed, plus tests (#350)
- blx <Rm> swaps mode appropriately
- asr.w and lsr.w in thumb mode handle immediates for op2 correctly
- unit tests for thumb mode behavior for shifting instructions
- unit tests check for correct mode on BX and BLX instructions
2017-06-27 13:52:20 -05:00
Garret Reece e931992abb Add ldrd and strd instructions and tests (#348)
* LDRD and STRD implementation and tests
2017-06-26 17:22:59 -05:00
feliam 520a9be47d Dev - events (#341)
* Wip refactoring

* Executor and exceptions refactor wip wip

* Fixing all_insts auto tests

* Visited and generate testcase now at manticore api level

* Aggregating state statistics into executor statistics

* Wip refactoring

* Executor and exceptions refactor wip wip

* Fixing all_insts auto tests

* Visited and generate testcase now at manticore api level

* Aggregating state statistics into executor statistics

* forwarding events wip

* state setstate fix and setup_stack merge fix

* will_terminate_state fix and tests skipped

* Update all ConcretizeRegister and ConcretizeMemory

* Wip refactoring

* Executor and exceptions refactor wip wip

* Fixing all_insts auto tests

* Visited and generate testcase now at manticore api level

* Aggregating state statistics into executor statistics

* Wip refactoring

* Executor and exceptions refactor wip wip

* Fixing all_insts auto tests

* Visited and generate testcase now at manticore api level

* Aggregating state statistics into executor statistics

* forwarding events wip

* state setstate fix and setup_stack merge fix

* will_terminate_state fix and tests skipped

* Update all ConcretizeRegister and ConcretizeMemory

* Exceptions are crazy crazy crazy

* fix last merge

* Merge merge until it pass

* Instructions count default to 0

* will/did execute/emulate

* Delayed keybpoard interrupt now shutdowns nicely

* fix auto test generator x86

* Undo bad merge

* utterly hopeless

* basic working

* Fix merge bugs and github comments

* Remove unnecesary comment - github comments

* trace_item not used there

* model-platform and system.py fixed

* backup/restore to store/load -- cpu.instruction property

* Slightly better did/will naming and dynamic signal forwarding

* platform.constraints and cpu.instruction as properties

* Fix forward signals getattr

* set las decoded pc at decode_instruction() / reenable instruction_cache

* Signals name convention: did/will/on

* Forward normal signals

* Maintain last decoded pc in abstractcpu

* Changed context manager so it just wont raise interrupt

* Decree now forwards signals and sets constraints

* linux.SymbolicFile does not need to maintain constraints

* remove debbug print

* Assimilating some PR commets

* size_total == size

* better merge of manticore.py

* typo

* Forwarding only specified objects in signal arguments

* Fix few broken tests

* revert + merge

* remove some unused stuff from manticore()

* manticore context <-> executor context

* manticore context <-> executor context2

* context context context

* forgotten return

* Fix basix.arm

* arm bitwise fix

* fix context

* Comment 1

* Comment 2

* Comment 3

* Comment 4

* Comment 5

* Comment 6

* Fix (still needs refactor but it works) profiling

* Fix (still needs refactor but it works) profiling

* The forgotten bit

* Update tests to reflect current output

* Verbosity fix

* Fix verbosity test
2017-06-26 18:06:18 -03:00
Mark Mossberg edbb613045 Add basic binja viz plugin (#347)
* Add basic binja plugin

* Inline lnk

* Better instructions
2017-06-23 18:18:11 -04:00
Theofilos Petsios e2c0414dca added _multiprocess_can_split_ directive (#351)
* added _multiprocess_can_split_ directive

* renamed Readme
2017-06-23 17:53:19 -04:00
Douglas Gastonguay-Goddard 6133a0e2ed Feature changes to support concrete execution. (#337)
* Feature changes to support concrete execution.

- Add ctypes to lseek for signed seeks. Pass whence to seek.
- Move mmap and related functions from SLinux to Linux.
- Introduce function _sys_open_get_file to isolate symbolic code in sys_open to SLinux.

* Remove white space, use super(...)._sys_open_get_file, self.current.address_bit_size.
2017-06-22 10:13:21 -04:00
Mark Mossberg 9a2d19f498 Update README.md to use pypi (#346)
* Update README.md

* Update README.md

* Update README.md
2017-06-21 19:58:09 -04:00
Mark Mossberg 3ec9043b2e Fix verbosity=1 (#345)
* Only enable debug executor after verbosity 1

* Add regression test for checking uniform cli output for nonverbose mode
2017-06-21 17:48:37 -04:00
JP Smith 860d51ebf1 Fix simple abspath bug (#344)
Fixes #343
2017-06-21 16:59:11 -04:00
Theofilos Petsios a3f0d92393 Revert "rename getState to get_state (#338)" (#340)
This reverts commit d0465b3f91.
2017-06-20 18:14:24 -04:00
JP Smith d0465b3f91 rename getState to get_state (#338) 2017-06-20 17:23:14 -04:00
Mark Mossberg 3bf529c371 Activate executor debug logging with verbosity=2 (#310)
Currently, we no verbosity level do we activate debug level logging
from the executor, however there is significant debug logging in the
executor for state forking output.
2017-06-19 16:50:11 -04:00