436 Commits

Author SHA1 Message Date
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 d0465b3f91ad344d0f97312a4b181ca4093c1caf.
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
Scott
186fa9c8ca Changed Socket parameters to accept seek paramaters (#308) 2017-06-15 20:07:52 -04:00
Theofilos Petsios
285aaf8258 nits for common Socket/File FD operations (#301)
* nits for common Socket/File FD operations

* rev

* _is_open changed to _assert_open throwing IndexError

* reverted NotImplemented in File sync()

* moved sys_fstat from SLinux to Linux & fixes for _assert_open

* nit in sys_write

* comment nits
2017-06-15 13:54:24 -04:00
Mark Mossberg
9abef20b67 Manticore 0.1.2 (#306)
* Manticore 0.1.2

* Update changelog
2017-06-14 15:56:11 -04:00
JP Smith
5109e2835f Fix building linux examples and test for future failure (#284)
* fix building linux examples and test for future failure

* fix cd back and typo
2017-06-14 11:23:55 -04:00
JP Smith
b12224d8a6 short circuit _getState when queue is empty (#302) 2017-06-14 09:45:59 -04:00
Garret Reece
7f550becc6 Add mrc and movt
* Add MOVT instruction

* Add new ARM operand types for MRC

* mrc implementation seems to work

* UXTB inst implemented, provisional implementations of LDREX and STREX

* Added unit tests for MRC, MOVT, and UXTB

* Added mode swapping from blx instruction on arm cpu

* Make tests pass
2017-06-13 13:21:19 -05:00
JP Smith
5ea4a87ddb Fix SymbolicMemoryException (#303)
* fix SymbolicMemoryException

* make simple_parse's visited.txt more correct
2017-06-12 15:28:57 -04:00
JP Smith
1f8c4e18c6 Move pretty printing into helpers (#299)
* move pretty printing into helpers

* switch to using __str__
2017-06-09 17:48:56 -04:00
Theofilos Petsios
aa798c652e make SymbolicFile inherit from File (#298)
* make SymbolicFile inherit from File

* Create linux.py

Nit from merge (restore class to inheriting from File)

* Fixes on file creation

* revert of __stdin__ in assert

* removed asserts in SymbolicFile init
2017-06-09 17:35:42 -04:00
Mark Mossberg
0533fe1d2d Use global path for workspace (#295)
Temporary hack around simple chdir OS model
2017-06-09 13:42:49 -04:00
Mark Mossberg
595a33d3e0 Add .sync to regular Files also (#297) 2017-06-09 13:42:39 -04:00