420 Commits

Author SHA1 Message Date
Dan Guido
44dff1745d Add readthedocs (#179)
* Add readthedocs badge

* Add rtd intro

* Add API reference link

* change the order

wiki first, because that’s where the majority of the docs live
2017-04-24 17:24:29 -04:00
Mark Mossberg
8b973064d1 Add read the docs mock (#180)
* Add read the docs mock

* Only mock if 'z3 in first arg to check_output
2017-04-24 17:06:47 -04:00
Mark Mossberg
c2fb359b82 Fix LDR/STR writeback (#175)
if a ldr used the same reg for dest and writeback offset, we'd
compute writeback wrong because we'd run the insn and then use the new
value in computing writeback
2017-04-24 15:09:15 -04:00
Mark Mossberg
fbe3a197ba Install instructions updates (#171)
* Install instructions updates

* Update README.md

* also need pip

* need to update, plus compact a few things

* add -y

* grammar?

* typos

* Add bountysource link

* consistency

* Point users to the examples dir and wiki

I thought these links were cluttering things a bit, and 2 out of 3 of
them aren’t official documentation yet we’re linking to them in the
first line of the README. I updated the wiki to address these directly
in a way I think is more clear.

* link to Z3 releases

* oops, don't know where that came from

* ensure people run the latest pip

* be more explicit

* Add an Issue Template

* be more explicit

* no longer appropriate here

* unnecessary

* add note about 16.04

* move issue template to hidden folder

* Spelling

* be explicit, makes copy/paste easier
2017-04-24 12:19:10 -04:00
Mark Mossberg
fd3873f0a8 Fix ARM bitwise (LSL/LSR) (#174)
* Rm bogus asserts

* correct lsl_c

* Add test for lsl carry
2017-04-24 11:31:11 -04:00
Dan Guido
fe9d4f0f6b Remove notifications to Slack (#167) 2017-04-22 19:30:00 -04:00
Mark Mossberg
edf0ee299b Remove arch specific auxv (#173) 2017-04-21 21:31:12 -04:00
Mark Mossberg
87971cca1a Add arm LDCL (#172) 2017-04-21 20:08:30 -04:00
Mark Mossberg
04aa03c85e Update README.md (#165) 2017-04-21 15:18:56 -04:00
Mark Mossberg
f552383e16 Add example taint usage (#161)
* Add example taint usage

- use new_symbolic_value API instead, because it's making an int symbolic
- add every instruction hook that checks for tainted data in operands

* update readme with taint example
2017-04-21 14:59:06 -04:00
JP Smith
130b4dc739 allow multiple --env arguments (#158) 2017-04-21 12:21:05 -05:00
Mark Mossberg
8c5cc6d4b0 Add links to eric's writeup in readme (#157)
* Update README.md

* Update README.md
2017-04-21 13:00:41 -04:00
JP Smith
54bfdf163b remove procs limit (#155) 2017-04-20 21:29:28 -05:00
Mark Mossberg
a52be7459d Arm add vldmia (#154)
* Add VLDMIA

* Add vldmia tests
2017-04-20 15:30:50 -04:00
Mark Mossberg
5ae5daa5c4 Fix arm offset calculation (#152)
* Fix offset calculation

.subtracted is unreliable, and .disp has the sign anyway

* Use .subtracted for reg offsets
2017-04-20 15:05:08 -04:00
Mark Mossberg
4ad028b0df Fix arm/x86(32) linux stat (#153)
* Fix sys_fstat

i'm pretty sure it was totally wrong before, in terms of how it laid
out the struct

I'm based this on using arm-linux-gnueabi-gcc -E
which shows me this struct:

struct stat
  {
    __dev_t st_dev;
    unsigned short int __pad1;

    __ino_t st_ino;

    __mode_t st_mode;
    __nlink_t st_nlink;
    __uid_t st_uid;
    __gid_t st_gid;
    __dev_t st_rdev;
    unsigned short int __pad2;

    __off_t st_size;

    __blksize_t st_blksize;

    __blkcnt_t st_blocks;
# 72 "/usr/arm-linux-gnueabi/include/bits/stat.h" 3
    struct timespec st_atim;
    struct timespec st_mtim;
    struct timespec st_ctim;
# 87 "/usr/arm-linux-gnueabi/include/bits/stat.h" 3
    unsigned long int __glibc_reserved4;
    unsigned long int __glibc_reserved5;

  };

* Add stat32

* Minor
2017-04-20 14:03:35 -04:00
Mark Mossberg
87073d9985 rm files (#151)
* rm

* bye
2017-04-19 15:06:31 -04:00
Yan
9ca1f4a43a Clean up output (#150)
* Quiet down some error messages
* Address comments
2017-04-19 14:28:46 -04:00
Mark Mossberg
1171b3a37f Update README.md: restructure, z3 install (#149)
* Update README.md

* Remove FAQ -> plan to move to wiki

* Rough cut

* Moved quickstart a little lower, but still above the fold
* Added more complete list of requirements
* Added full instructions to quickstart
* Clarified Installation instruction options
* Moved extra details about why requirements are what they are to FAQ

* less is more

* Minor updates
2017-04-19 14:23:36 -04:00
Yan
daab8a5824 Add examples (#145)
* intermediate example commit
* Added more state_explore examples (w/ new_symbolic_buffer)
* Actually comment out verbosity
* rename
* Add comment mentioning symbolicate_buffer
* Update comments
* Fix issue with limited exploration
* Clear up wording
* Update descriptions
* Remove reference to symbolicate_buffer
* Clean up state_explore.c header
* move .c to src/
2017-04-19 14:12:58 -04:00
feliam
648ddf10ab Capstone operand type cornered to one function (#107)
* begin refactoring logging to use manticore object

* fix verbosity things

* fix logging when in scripts

* remove m.log_file now that it's no longer used

* remove unnecessary init_logging usage and unused log_debug variable

* accidentally deleted the wrong line

* re-hide init_logging

* remove old log_debug

* remove unnecessary API stuff and refactor around that

* Capstone operand type cornered to one function

* Un-inline type_map

* Immediate fix to lacking immediate

* Add FAQ about relationship to CRS

* add link to Grr

* reorder instructions

* passive voice

* add slack badge

* begin refactoring logging to use manticore object

* fix verbosity things

* fix logging when in scripts

* remove m.log_file now that it's no longer used

* remove unnecessary init_logging usage and unused log_debug variable

* accidentally deleted the wrong line

* re-hide init_logging

* remove old log_debug

* remove unnecessary API stuff and refactor around that

* Capstone operand type cornered to one function

* Un-inline type_map

* Immediate fix to lacking immediate

* Add FAQ about relationship to CRS

* add link to Grr

* reorder instructions

* passive voice

* add slack badge

* Rebasing noise

* rebase noise

* Operand.reg moved up to Operand
2017-04-19 14:19:15 -03:00
Yan
b612332132 Spelling fixes (#148)
* Spelling fixes
2017-04-19 11:50:17 -04:00
Mark Mossberg
3e81cba8fb Fix linter issues on cpu (#144)
* quick linter stuff

* Fix cpu init in tests

* update cpu name
2017-04-19 10:29:05 -04:00
JP Smith
e32701f978 Refactor logging (#140)
* begin refactoring logging to use manticore object

* fix verbosity things

* fix logging when in scripts

* remove m.log_file now that it's no longer used

* remove unnecessary init_logging usage and unused log_debug variable

* accidentally deleted the wrong line

* re-hide init_logging

* remove old log_debug

* remove unnecessary API stuff and refactor around that

* re-introduce logging PR

* fix Popen

* lost a line in merge

* fix test_binaries

* Log to stdout instead of stderr

* implement mark's changes
2017-04-19 01:21:14 -05:00
Mark Mossberg
65df1cbe35 Fix bad reference to args (#146) 2017-04-18 18:56:58 -04:00
feliam
a9711cf119 Graceful fallback if Z3 doesn't support optimization queries (#135)
* Configure Z3 depending on installed version

* Mocking for subprocess.check_output

* change get_value_fmt to private attribute _get_value_fmt

* Move memoized to utils

* Remove minimal version and simplify

* Re-add invalid versions/sanity checks

* Z3 version format checked on github

* New tests. Version is future proof

* Better logging
2017-04-18 18:40:06 -03:00
Mark Mossberg
f6f20b5210 Register stat64 for 32bit syscalls (#142) 2017-04-18 16:21:28 -04:00
Mark Mossberg
d8335dcd97 track sys_writev32 (#143) 2017-04-18 15:39:04 -04:00
Mark Mossberg
531f245817 Fix arm PUSH (#141)
If sp is in the list, it gets pushed incorrectly because it gets
updated by the stack_pushes for registers that occur before it
2017-04-18 14:00:13 -04:00
Yan
398e4d2510 README + Output updates (#139)
* Importing Dan's README
* Reintroduce etcd's pr
2017-04-17 16:58:34 -04:00
Mark Mossberg
05b7c1138b Fix memory._ceil, Fix linux.load (#134)
* Reimplement ceil so page aligned addresses are unaffected

* Lingering fix

* Fixup users of _ceil

* Correct memory tests
2017-04-13 18:45:18 -04:00
feliam
bbfb234cca Dev fix amd64 emulation bugs (#136)
* Failing tests

* Tha Fix

* Fix auto test

* PSLLDQ for 32b python?

* More descriptive temporary variable
2017-04-13 19:22:04 -03:00
Mark Mossberg
43d7669252 Create stderr file, also watch sys_writev (#129) 2017-04-11 14:21:18 -04:00
Mark Mossberg
ebd0a8be72 Fix linter bugs from model (#122)
* liux

* easy

* fix

* more

* import
2017-04-11 09:47:05 -04:00
Mark Mossberg
b02b551911 Update README/travis (#126)
* Update travis install to match README

* Fix README error

Placement of the -e is important, apparently
2017-04-10 17:22:02 -04:00
Mark Mossberg
5870211b1e More gracefully handle uninstalled z3 (#127)
* More gracefully handle uninstalled z3

* Use better error
2017-04-10 17:10:40 -04:00
Yan
801e20aa4c Update docstrings to sphinx format (#119)
* Update docstrings to sphinx format
* Update various docstrings
* Add more docstrings and update sphinx docs
* fix trailing colons on returns
2017-04-10 17:06:47 -04:00
Yan
5c112e56f3 Add brief example descriptions to README (#120)
* Added brief example descriptions to README
* Update config script
* Update sym.py API usage
* Remove individual example descriptions
* fix mcore init
* consistently document examples
* make basic_sym runnable
* More path fixes
* cleanup; update api
2017-04-10 14:31:51 -04:00
JP Smith
a41eb6feba Fix typo in linux.py (#116) 2017-04-10 12:40:45 -05:00
Dan Guido
99a3327b8d Condense some of the instructions, add slack badge 2017-04-08 16:24:45 -04:00
JP Smith
1bcadfed4d Add memory corruption example (#124)
* add memory corruption example

* put binary in proper folder
2017-04-06 10:39:45 -05:00
JP Smith
ccd473b88e add partial solves for multiple-styles (#123) 2017-04-06 10:39:07 -04:00
Yan
0b850dba40 Make unicorn be pull-based (#97)
* Enable simple ARM register concretization for Unicorn

* Add canonical_registers property to abstractcpu

* cpu to self

* Check for regs_access better

* Emulate a single instruction

* Bypass capstone 3.0.4 arm bug

* Dealing with capstone

* Temporary disable ASR and remobe BitVec.Bool from test

* WIP WIP debug prints WIP WIP

* Unicorn fallback working (using unicorn master)

* HAck to support unicorn 1.0.0

* WIP

* Unicorn hack to handle PC updates

* [WIP] do not do anything with this commit; for debugging only

* Adding before clean up

* emulation more or less works; need to work out more unicorn bugs

* clean up emulate() caller code

* move hooks to methods; cleanup

* Concretize memory when emulating

* Re-add Bool()

* Update tests to start at offset 4

 When an instruction branches to the previous instruction,
Unicorn attempts to dereference that memory. We'd like to use
unit tests to also make sure Unicorn emulation is in line with
our own semantics. If we start all tests at offset 4, we can
jump to a previous instruction and not fault when Unicorn
dereferences it.

* Fix concretization

* Clean up test imports; upper-case Cpu

* Unicorn tests

 * Add tests for all the ARM semantics, but make sure they're equivalent
   on unicorn.
 * Add a few tests to make sure unicorn correctly concretizes the memory
   it references

* Fix broken import

* Add symbolic register tests

* Re-introduce the unicorn hack

* Add the 'ONE' concretization policy

* Rm unused function

* Update concretization; add comments

* Add ONE policy test

* Create a base class for all concretization exceptions

* Remove Armv7Cpu._concretize_registers

* Check for enabled logging in a more idiomatic way

* [wip] intermediate testing commit

* Reimplement hooks and execution with unicorn

* Add a DMB (mem barrier) instruction; nop

* simplify instruction resolution

* improve unicorn error handling

* explicitly delete emu

* Handle ARM helpers inline

* map fetched memory

* Narrow exception handling

* Update DMB docs; make __kuser_dmb match real implementation

* Fix typo; add comment; remove extraneous parameter

* typos++
2017-04-03 16:00:49 -04:00
Mark Mossberg
0ad327522b Update readme (#117)
* Update readme

- eliminate duplicated install instructions
- document pip version
- explicitly add capstone/keystone workarounds

* Update

* spelling
2017-04-03 14:41:06 -04:00
Mark Mossberg
ffe758f5f3 Fix interpreter loader (#115)
* Correctly compute total interp size

* Rename

* Make staticmethod

* Add basic loading test
2017-03-31 13:22:59 -04:00
feliam
83cb4de825 Dev fix load interpreter (#96)
* Fix interpreter load

* turn off some debug

* cuack

* Correct loader condition (#111)

* Rm unnecessary condition

We always want to run this code if there is an interpreter present, not
just if the exe is ET_DYN

* Add correct interp header type check
2017-03-28 15:45:08 -03:00
feliam
dbb63cfa34 Dev stoping criteria (#108)
* no-mp not uset and redundant

* Add timeout

* Unused args reremoved timeout readded

* no-mp not uset and redundant

* Add timeout

* Unused args reremoved timeout readded

* Move import to the top op op op
2017-03-28 14:48:23 -03:00
JP Smith
db6370bf87 Remove redundant pstats import (#113) 2017-03-28 12:16:41 -05: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
e3f6c8e4ba Force uninstall Manticore in case of cache (#112) 2017-03-27 17:52:36 -04:00