Commit Graph

32 Commits

Author SHA1 Message Date
Eric Kilmer 2ed00dc29e Fix bad LoadInst compat for LLVM 11 (#739)
* Fix bad LoadInst compat for LLVM 11

* Add lifter smoketest. Just check for 0 return

* Use macos 10.15 CI runner
2021-03-02 16:05:45 -05:00
Eric Kilmer aa49fcc4fb Support LLVM 11 (#729)
* Add guards based on LLVM version for 11 compatibility

* Use remill LLVM 11 compat headers

* CI support for LLVM 11
2021-02-13 11:22:32 -05:00
Peter Goodman 21970a5cfd Fixes one egregious bug in how we alias registers. What would happen is that AL/AH, DL/DH, etc. would all map to the same alias because their containing register and types would be the same. Modified register aliases to have the form <name>_<offset>_<type>. Also fixed an issue in mcsema-disass where the main function wouldn't be recognized as a function, and thus not lifted. (#710) 2020-11-11 18:07:48 -05:00
Peter Goodman b0f7790f43 Sparc support (#709)
* Adds sparc support; formats files

* Update the readme and walkthrough

* Minor tweaks to readme/walkthrough

* Update ci.yml
2020-11-05 12:59:20 -05:00
Peter Goodman 31f267bd5f Cmake refactor (#693)
* Update to latest remill APIs and way of using CMake.

* Minor fixes

* Bug fixes for AArch64

* Tweaks

* Adds some nifty functionality useful for debugging some aarch64 bugs

* Fixes a subtle bug

* Bug fixes

* Make the test suite use explicit args

* Bug fix in xrefs

* Disable tests for now
2020-09-22 23:22:56 -04:00
Peter Goodman c002b8505c Formats the code with clang-format and my additional stylistic mojojojo (#682) 2020-08-05 16:14:01 -04:00
Peter Goodman 2d55d02cc3 API improvements. Must be used with the api_improvements branches of Remill and Anvill (#666)
* API improvements. Must be used with the api_improvements branch of both Remill and McSema

fixes for x86 and running the lifted code with klee

* Update dockerfile to clone anvill

* update remill commit id

* Add python3 to dockerfile

* update python3

* disable abi script

* Updated cmake to find anvill

* Update main.cpp

* update find_package for anvill

* WIP:updated prebuild cfg

* update prebuild cfg files

* enable abi build for testsuite

* Fix memory leak

* install missing package for testcases

* frontend: Reflect cfg file changes in dyninst frontend.

* frontend: Update local files copyrights to reflect overall change to agplv3.

* fix failing testcases

* update test cfgs

* Fix test failure with local state pointer

* set the flag to use local state_ptr in default mode

Co-authored-by: kumarak <iit.akshay@gmail.com>
Co-authored-by: Lukas Korencik <xkorenc1@fi.muni.cz>
2020-07-23 02:14:56 -04:00
Aiethel 8ecfe165ef Various improvements (#628)
* bc: Inline calls to semantic functions and wrappers manually.

* bc: Inline calls to semantics and wrappers only if some flags are set.

* Refactor code that is responsible for abi libs loading.

* Wrap global pointers in RAII.

* Update .remill_commit_id

Co-authored-by: Peter Goodman <peter.goodman@gmail.com>
2020-02-10 13:20:05 -05:00
Peter Goodman e13d8ffbc9 Llvm 900 (#605)
* Support for LLVM 8.0.0 and 9.0.0

* remill script fixes

* Update to master
2019-11-18 21:53:23 -05:00
Peter Goodman bda3af4c56 Dead store elim (#428)
* Update to use remill's dead store elimination, and be compatible with the indirection-removal done by Arch::PrepareModule.

* Fixes

* Update .remill_commit_id

* Update .remill_commit_id

* Update .remill_commit_id

* Update .remill_commit_id

* Update .remill_commit_id

* Update .remill_commit_id
2018-06-28 21:05:31 -04:00
Peter Goodman 8a9856ada3 Klee maze example (#369)
* In progress. Working on an example of using KLEE on a Maze, but with the maze program being compiled to x86, amd64, and aarch64.

* Making lots of progress on getting lifting and runnning an aarch64 maze program on amd64, but using --explicit_args. The key thing I'm working through right now is a jump offset table, but where the offset is a block pc, rather than a table base. Also adding various bits of code here and there to making runnning with klee more directly doable, and working on a debugging facility to track down when the emulated program counter gets out of sync with the original program.

* Fixed a subtle @PAGE and @PAGEOFF-related reference bug on AArch64. Partially disabled the special jump offset table handling I had in table.py, as it doesn't (yet) handle the shifted table values. However, I still have the code there, so that it can recognize that a basic block address is used as a possible offset, so that I can remove the block address as a reference, which permits a new heuristic on the C++ side to work. On the C++ side, when there's a jump instruction that isn't associated with a cross-reference flow, I try to auto-augment it with addition switch cases, targeting blocks with no predecessors (as present in the CFG). This seems to work reasonably well.

* Improved the scripts and updated the READMEs.

* Minor rephrase

* Minor rephrase
2018-01-13 23:47:55 -05:00
Peter Goodman 727791dd2b Minor fixup to ISEL optimizations in Optimize.cpp. 2017-10-10 12:49:50 -04:00
Peter Goodman 249506b571 Privatize isels instead of remove them; let the optimizer remove them. Add a flag to lift_program.py to not try to relink. This is nifty for aarch64 testsing. 2017-10-10 11:04:46 -04:00
Peter Goodman 14db6f229a Minor API updates 2017-09-25 17:11:16 -04:00
Peter Goodman 71c7e939df LLVM 5.0 compatibility. 2017-09-19 15:13:24 -04:00
Peter Goodman 18abc11714 Added new --legacy_mode operation that tries to produce bitcode that is more similar to old bitcode. Also updates get_cfg.py to disassemble in such a way that mcsema2 will be able to support global variable recovery as though they were distinct segments 2017-08-16 23:06:53 -04:00
Peter Goodman bc84b2f56c Improvements to handling lifting of statically linked ELFs that also have thunks in them. Bug fixes. 2017-08-14 23:29:54 -04:00
Peter Goodman b6ab3f9c43 Swapped order of args to the lifted subroutines. Updated the callback assembly stubs to use an inline assembly feature I was previously unaware of. That inline asm change fixes one issue related to using llvm 3.6, which is that the callback functions would be compiled without their tail calls, and that would cause a mess of issues. 2017-07-19 17:35:07 -04:00
Peter Goodman 6ced3bd807 Transitioned to using a table-based approach for explicit arguments and return values. 2017-07-14 15:30:18 -04:00
Peter Goodman b42fd8efba Sqlite can get up to the prompt and the .help command works. But the .databases seg faults. 2017-05-13 15:47:30 -04:00
Peter Goodman 939f408d69 Lifting and recompiling a simple hello world program is working. This uses a new runtime that does more direct register conversion between lifted and native. Updated the .gdbinit debugging script to work using the remill State structure. 2017-05-01 22:51:41 -04:00
Peter Goodman 5e508962f8 Fixes for lifting. Simple lifted binaries can now be recompiled when using the alessandro/refactor/llvmmultiversion-cmake branch of remill as a base. 2017-04-29 22:06:24 -04:00
Peter Goodman 0c8f2ec21f Minor updates. Trying to diagnose an issue where llvm optimizes a ton of stuff into unreachable insts. 2017-04-27 21:04:00 -04:00
Peter Goodman 3ca5995e83 Working toward bringing up the mcsema runtime. Need to add --entrypoint support to get_cfg.py, so that something like main can be specified as the key entrypoint. Right now it's pulling in things like init, start, etc. 2017-04-25 11:45:32 -04:00
Peter Goodman 6d6d02ba7e Made it so that contiguous segments are placed within the same struct on the llvm side, just in case there's a reference to the beginning of one segment that is logically a reference just beyond the end of another one. Added some weak externs related to the end of some segments (used by brk I think) to the linux defs file. Improved some error reporting. 2017-04-23 12:52:48 -04:00
Peter Goodman df97ad72e9 Fixes for LLVM compatibility 2017-04-21 13:41:06 -04:00
Peter Goodman 93b4aa56b4 WIP. Modified license to apache 2.0 to follow remill, also most code is new anyway. 2017-04-15 16:27:35 -04:00
Peter Goodman dfdc6b9648 More progress, especially on the get_cfg.py front. 2017-04-07 21:15:46 -04:00
Peter Goodman 23ef38c7c0 Things are moving steadily forward. Redid all cfg proto stuff, and am bringing the get_cfg.py script back up to producing all relevant info. 2017-04-05 23:20:41 -04:00
Peter Goodman 30e3c86e48 Improved jump table handling and started implementing jump table (via switch inst) support on the C++ side of things. Removed some optimization passes; it seems as though the instruction combining pass of llvm injected lots of undefs into the code, which resulted in all the things optimizing themselves away. 2017-03-31 23:37:16 -04:00
Peter Goodman dcaaa8683b Makign great progress on various forms of reference resolution. 2017-03-29 00:10:22 -04:00
Peter Goodman 0441f95426 Updated copyright messages. Added namespace mcsema 2017-03-24 19:33:54 -04:00