21 Commits

Author SHA1 Message Date
Yan Ivnitskiy
9c258bd68d
Update concolic.py (#887)
* Update concolic.py

* update what evt we subscribe to
2018-05-03 18:52:29 -04:00
Yan Ivnitskiy
60d2b61fb3
Run linux examples in Travis (#668)
* Update makefile; add a list target for testing

* simplify nostdlib example

* Make sendmail example return success

* Add tests to run all examples

* Add some targets to exclude

* Run example scripts; temporarily add a workspace accsesor to mcore

* Optionally read end of main from argv

* Make concolic test more robust

* Clean up Makefile

* Be better with phony targets

* Add run_simple and state_control tests

* verbosity++

* Make sure we fail when we intend to

* Simplify travis_test.sh

* Remove multi_arch_sym
2018-01-18 15:50:13 -05:00
Mark Mossberg
6b794fecaa
eth int overflow: tests, mul support (#656)
* Move algorithm into ManticoreEVM

* Rm buggy unused line

* Initial eth testing setup

* Check for overflow in mul also

* clarifying comment

* Install solc for travis

* Add sudo

* x

* Rm travis_retry, since we rarely actually use it, and it's not available in this script for some reason

* Check for specific findings

* Fix test

* Clean up transaction firing logic

* Use less strict check, better for floating point
2017-12-21 12:54:24 -05:00
Yan Ivnitskiy
3c7d92bfcd
Trace following mode (#513)
* WIP New Policy class

* WIP pubsub

* Update Signal tests

* small fixes from github comments

* Fix event decode_instruction signature

* Good merge

* Good good merge

* WIP manticore refactor

* Fix default old-style initial state

* add -> enqueue

* @m.init

* Fix workspace url

* Some test skipped

* Ad Fixme to platform specific stuff in State

* add -> enqueue

* Enqueue created state

* Fix m.init

Use a messy hack to adhere to the spec (callback func receive 1 state argument)

* Add _coverage_file ivar to Manticore

* Fix symbolic files

* remove extra enqueue

* Fixing __main__

* comments

* Experimental plugin system

* tests fixed

* Fix plugins

* Some reporting moved to plugin

* Fix assertions test

* Add published events to classes that publish them

* Update how we verify callbacks

* Update Eventful._publish

* Yet another flavor for event name checking

* really it's a bunch of minimal bugfixes

* Remove get_all_event_names from Plugin

* Update where we get all events

* Use new metaclass-based event registry

* Initial concrete trace follower

* Add extended (json) trace support

* More stubs for condition gather

* Update trace saving to new format

* Produce trace regardless of contents

* Record register deltas in trace

* Move initialization to _start_run so we can call run() multiple times

* Re-fix multiple workspace bug

* Fix it correctly

* Add extended trace and accessors

* make sure did_execute_instruction is always published

* Produce a consistent version

* move extended tracing to separate class

* Reorg of extended tracing plugins

* Add concolic tracing script

* Clean up old hooks

* Sync memory as well; cleanups

* Revert binary tests

* simplify concolic follower

* Move trace follower to plugin.py

* Simplify follower

* Add skip ranges to Follower

* Update concolic.py

* Remove redundant state init

* Clean up driver script

* Update header line

* Move trace follower

* Move Follower to follow_trace.py

* rm unused import

* Remove unnecessary property

* rm ConcreteTraceFollower

* Revert start_run behavior
2017-11-28 18:14:03 -05:00
Mark Mossberg
9535ec8fd3
Fix all integral type checks that forget long (#555) 2017-11-09 11:28:24 -05:00
feliam
8591bff45f EVM support (#521)
* WIP New Policy class

* WIP pubsub

* Update Signal tests

* EVM support - Wip

* EVM support - dependencies fixed

* EVM support - fix decree merge

* fix decode instrucion event

* Fix small bugs in evm opcodes (too many arguments + wrong LOG name) (#380)

Fix wrong call parameters + typo

* Fix Create/Call

* Fix depth

* Default fixed point in arithmetic simplifier

* small fixes from github comments

* Fix event decode_instruction signature

* wip wip

* Auto tests for evm

* New EVM tests

* Ran 9556  FAILED (failures=166, errors=8, skipped=62)

* Fix some arithmetic instructions

* Ran 9556  FAILED (failures=136, errors=8, skipped=62)

* More instructions - Optimizing symbolic memory

* Added gas to opcodes description - FIX DELEGATECALL POPS

* Add wip wallet example

* The tests

* Solidity constructors need argument after bytecode

* Simple integer overflow working

* Good merge

* Good good merge

* WIP manticore refactor

* Fix default old-style initial state

* context now working

* 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

* Fix init wallet example

* State __init__ needs to initialize platform constraints

* Internal methods use internal properties

* Better attack modeling

* Better example layout

* Storage backup on CALL is now faster .. and correct

* Add LOG support

* Minimal SE test

* Added examples

* Send ether bugfix

* EVM: Fix wrong balance destination on CALL + decrease caller balance on CREATE

* New balance management

* Trying to maintain known hashes

* Known hash concretization policy

* CALLDATA max size bugfix

* Minimal SE example

* Remove evm tests

* add -> enqueue

* @m.init

* Fix workspace url

* Some test skipped

* Ad Fixme to platform specific stuff in State

* add -> enqueue

* Enqueue created state

* Fix m.init

Use a messy hack to adhere to the spec (callback func receive 1 state argument)

* Add _coverage_file ivar to Manticore

* Fix symbolic files

* remove extra enqueue

* Fixing __main__

* comments

* Fix visitors oddity

* setup merged

* remove duplicates and add pysha3

* Remove EVMTests import

* Refactor platform specific code out of ManticoreOutput (#505)

* Initial moving work

* Clean

* Make linux.generate_workspace_files work

* Fix

* clean

* Add test

* Test workspace for platform files

* Skip EVM cpu pretty print

* Remove bad import

* Fix coverage.py for testing

* Clean comment

* Comment hack

* Print evm cpu

* pretty print evm world instead of platform

* delet old scripts/examples

* delet old tests

* Remove z3 install script

* Array.max_size can be None, include check for that

* Rm unused _symbolic_files

add_symbolic_files was moved to linux, so this is not needed

* Rm unused args

* Import evm

* Rm dup function

* Rm stray prints

* Add docs for new classmethod apis

* minimal

* minimal example

* fix minimal

* Fair symbolic SHA3 handling

* Simple mapping example

* coverage example

* fix tests

* fix minimal

* Some eko fixes

* New SETH

* integer_overflow refactored

* Fixing the examples

* init_bytecode -> init
'

* Concrete reentrancy exampole

* concrete reentrancy selfdestruct

* Update minimal.py

* It's a new Minimal

* Integer overflow example

* New minimal

* minimal fix

* Examples last minute fixes

* Remove debug print

* add plugin.py

* Fixing event subscription

* remove temp params

* Remove param

* Update uncovered will_exec callback prototype

* Clean up debug output

* Automatically generated intruction tests

* Uninplemented instruction test removed

* Unused concretization policy removed

* Fixes enabling default bplugins

* solc from PATH

* Removed unused import

* Logger name updated
2017-10-17 19:47:20 -03:00
Theofilos Petsios
a025bda97a Updated visualization plugin with coverage info & live update option (#444)
* plugin rearrangement and UI options

* Live update and clear options

* coverage stats

* added check for xref address

* coverage in separate option as BackgroundTaskThread

* license cleanup
2017-08-23 17:47:23 -04: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
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
1f8c4e18c6 Move pretty printing into helpers (#299)
* move pretty printing into helpers

* switch to using __str__
2017-06-09 17:48:56 -04:00
Yan
2916d7e3ae Support tracing (#247)
* Script for generating syscall tables

* Add generated syscall table

* Reintroduce tracing script

* Add configuration options needed by verify.py

* Clean up verify; remove dependency on experimental after_hook

* trace experiments

* reorg verify.py

* Update after merge

* Remove Manticore param

* Remove unused vars

* Use regfile api; redo last_instr check

* Fix gdb->mcore name descrepancy

* Move kwargs to explicit args for Linux/SLinux

 * Maintain options in makeLinux to not overcomplicate the Manticore
   class

* Address merge issues

* remove debug stmt

* Reintroduce options

* Revert linux.py/manticore.py from master

* Use the qemu -s and -R flags

* Import syscalls table from master

* And import extract_syscalls.py script

* Fix verify reference

* Move syscall to arg

* Update register references

* Simplify last instruction check

* Add logging filter to TRACE logger as well

* Be consistent with state synchronization

* Be explicit about gdb types

* Improve mmap debug output

* Return error if ioctl is not implemented

* Fix syscall sync

* Make logging more self-contained

* Use errno const in ioctl impl
2017-06-05 16:16:54 -04:00
Yan
2202b0a27d Generate NRs for ARM-specific syscalls (#254) 2017-05-15 15:11:54 -04:00
Yan
a0717aa661 Syscall table rework (#245)
* Script for generating syscall tables from Linux src (pulled from kernel.org)

* Add generated syscall table

* Update syscall names to match extracted entries

* Move to new syscall dispatcher

* Add machine def to x86 cpus
2017-05-11 12:20:00 -04:00
Dan Guido
7e46db5216 oops 2017-04-27 15:48:28 -04:00
Dan Guido
d1b0abba6c try removing sudo 2017-04-27 15:37:20 -04:00
JP Smith
1ad9a88032 Add basic benchmarking script (#83)
* add basic benchmarking script

* add results class, collect more information, and fix check for no args

* fix indentation

* we don't have logger here

* use argv[0] for name of program

* allow dumping of stats from the API and use .format()

* add ProfilingResults class

* bugfixes
2017-03-28 11:12:36 -05:00
Mark Mossberg
a12aae80d1 Move stats.py to scripts/ (#100) 2017-03-23 14:25:46 -04:00
JP Smith
ca0bee2377 Rename test -> tests (#66)
* rename test -> tests

* re-add ignored tests
2017-03-13 14:06:36 -05:00
JP Smith
dd24878724 Remove unicorn script from travis build (#64)
* remove unicorn script from travis build

* remove unicorn script entirely
2017-03-13 10:51:49 -05:00
Mark Mossberg
05f5fcf045 Port to real python package structure (#6)
* Initial moving

* Initial package __init__.py

* Use relative imports

* Correct imports for tests

* Rename main.py -> __main__.py

* Use relative imports in main

* Refactor cli to be used with setuptools

* Add basic setup.py

* Fix test_memory import

* Fix test_cpu_manual imports

* Correct iterpickle import

* Use manticore console_script installed by setuptools

* Make travis install our package for integration cli tests

* Refactor model hooks dynamic import for being in pkg

* Correct import

* Rm empty line

* Fix coverage test paths
2017-02-15 12:32:08 -05:00
yan
badf1ab28e Initial import 2017-02-13 12:04:15 -05:00