Commit Graph

18 Commits

Author SHA1 Message Date
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
Eric Kilmer effd27daa9 Small final docker image (#655)
* Small final Docker image
* Ubuntu 20.04 support
* LLVM10 Fixes
2020-05-21 02:04:38 -04:00
Peter Goodman 7d2dfe6e94 Attempt to resolve Issue #521 (#522)
* Attempt to resolve Issue #521

* minor fix

* minor fix

* minor fix

* Simplifications and comments

* If it's a copy of shared data, then don't treat it as an xref

* Error log if there is segment variable with the same name as external var

* Added flag and checks if the variable needs initialization if already defined;

* fix noreturn for the functions throwing exceptions;

* review changes

* Update get_cfg.py

* Update get_cfg.py

* Fix the recovery of exception action table chain

* Update the prebuild cfg for testsuite

* Fix entrypoint function not getting recovered in ida7

* Change the order of idc.GetFunctionName and idc.GetTrueName while looking for function name
2019-03-02 20:59:08 -05:00
artemdinaburg a2f7f0f189 Fix Issue #491 (#492)
* Update CMakeLists to look for idat64 (IDA 7+)
* Update documentation
2018-11-28 02:09:35 -05:00
Peter Goodman fd3bce8809 Issue 395 abi libs complex numbers (#436)
* -abi-libraries can work with function returning complex types

* -abi-libraries can now work with most functions taking complex numbers

* Code style improvements

* LLVM 3.5 compatibility

* long double complex numbers are now correctly passed to external function

* Code style changes, fix of float complex return for 64bit

* Older version of llvm allow pointer to be casted to type it is pointing to

* Add option to return integers in two registers if calling convention supports it.

* Byval attribute fix, small code style changes

* Floats are now correctly unpacked from xmm

* Add test for basic calls into complex.h

* Complex number test is now C-program

* Adding new prebuilt CFGs for unit tests

* WIP: Rework. Vector type is now one of the "simple" types. Easier code structure to support vector types in external libs

* Skeleton for vector passing

* WIP: Unpolished version of remake of constrant tables. Add constraint table also for return variables

* Code style changes, some small reworks.

* Incompatible return type now ends with error message instead of crash

* Code style

* Tables with information about registers used by different calling conventions are created only once.

* Changed severity of log, default for reg vectors are now xmm

* Win64 now uses only 4 registers to transfer arguments

* Code style improvements

* CallingConventionInfo now initialize ConstraintTable/s for specific gArch

* Remove kNoArgs since ConstraintTable can now use std::vector::size()

* Fixed iteration of ext_func arguments

* 32bit can now return i64 via two registers

* Code style
2018-08-30 16:12:31 -04:00
artemdinaburg d2582c7abd Build Tests in Travis (#406)
Always generate integration tests and then run the generated integration tests travis. We get around a lack of IDA by providing pre-built CFGs for examples.

Closes #407
2018-05-22 21:13:43 -04:00
kumarak a708bafc42 InlineAsm function type mismatch (#409)
* InlineAsm fails due to function type mismatch

* disable ada failing testcases;

* Generate ABI library for integration test

* Change ArrayRef to vector; getting corrupted for llvm >= 3.9
2018-05-18 05:58:34 -04:00
kumarak fffbb0e30b Missing llvm.global_ctors from the lifted bitcode (#405)
* Check for the global ctors/dtors during ABI library unload

* Add std::terminate to std-def list

* Fix integration test
2018-04-19 22:50:02 -04:00
kumarak a3483e4bf1 C++ exception handling support (#391)
* Initial changes to parse the eh_frame and exception table

* linearly scan the function to find missing blocks

* Update protobuf format for lp; need to tag instructions or basic blocks to associate it with the lp

* tag instructions with lp; removed debug logs

* updated comments and protobuf; use utility functions for pointer size;

* travis build failure; make lp_ea optional field

* Collect the exception handling bb chunks; Create a passthrough for the lifted landingpad;

* Generate the passthrough IR and attach the landing pad with function invoke

* Generate the eh_frame/exception table and add personality function with one raising the exception.

* catch/cleanup wrapper for the exception handling; Disable CFG simplification pass temporarily for invoke inst;

* invoke wrapper to fix stack and base pointers

* recover type indices of the exception type

* fix exception table offset

* Add the function definition for setting the rsp/rpb correctly after eh return;

* Changes for abi_library support in exception handling

* Remove unwind attribute from ext_* functions to generate eh table

* Support the lifting of multiple exception types thrown;

* Fix the multiple declaration of personality function in lifted bitcode;

* Add --recover_exception flag to lift the exception table

* Update the list of external functions with c++ ABI's; Fix basic block split issue for exception chunks;

* Weak linkage for external function causing the garbage value for out_of_range destructor. Temporarily disabled;

* cleanup redundant changes and resolve conflicts

* Update --std-defs list with the c++ exception ABIs

* Fix merge fail

* exception test binaries for integration test; Move to clang++ for recompiling the bitcode.

* Fix the exception handling support for llvm 3.5

* Disable the optimization passes for the function having landingpad;

* Temporary changes to add ABI libraries for exception tests.

* Remove the noreturn attribute to fix the problem with -03 optimization

* review comment changes

* Change wrapper function name across invoke;

* review changes

* Updated comments text

* Remove duplicate clauses from the list; Add arguments for personalityfn and fix review comments.

* Update the flag name to --exception_personalityfn;

* Update the flag name to --exception_personality_func;

* Follow the variable naming convention;

* Update comments

* travis build fix for unused variable

* Create the map of type indices from original binary. Runtime routine to fix the RDX with correct type index;

* Add _Unwind_Resume to --abi_libraries functions list;

* Update comments & code restructure

* Exception handling changes and utility functions for 32 bit;

* DWORD for 32-bit system
2018-04-12 14:05:45 -04:00
artemdinaburg 7a7dc48a16 Fix Integration Tests (#394)
* Remove old documentation
* Fix cmake lists to set C/CXX compiler first, to avoid infinite loops
* Fix pthread tests
* Add documentation
* Making ADA tests work with test generator
* Strip resulting binary for cpp_construtor so it works with .init/.fini
* Looser comparison for output validation
* Update test suite with Ubuntu 14.04 CFGs for travis-ci
2018-03-29 18:26:00 -04:00
artemdinaburg 5dd79c35df Update README, Make --prefix work, check test results (#353)
* The test runner now knows about mcsema installations that aren't global

* We now check the output of the integration test suite in travis. This will cause travis to fail since we're currently failing tests

* Lots of README updates

* Use like 99% less sudo
* Better script to fix local IDA Python installations
* Support for building local installs in a virtualenv
* Remove the protobuf install that led people astray
2018-01-18 19:50:54 -05:00
kumarak b6d18e1a5f Issue 319 thread support (#343)
* Added pthread sample testcase

* Ada threading testapp

* ada testcases

* pthread testcase

* update pthread worker testcase

* update the licence header
2017-12-04 12:33:33 -08:00
kumarak 4c8387dc0e Issue 330 libc constructor crash (#335)
* Issue #330; --libc_constructor flag was producing the crashing bitcode for apache; Special case the constructor/destructor segment to lift them together as one GV;

* Testcase for the cpp constructor/destructor function

* Update test_suite generator start.py

* updated comments

* Update the comments about Issue#330, handle condition if the init_array and fini_array are not adjacent;

* Updated comments, remove non-utf character getting copied from the IDA;

* Updated command line reference

Added a brief description of the command line arguments `--libc_constructor` and `--libc_destructor`.

* review comment changes
2017-11-22 20:37:25 -05:00
Alessandro Gario a8b85fdb8a Add support for the new cxx-common and llvm35 (#320)
* Add support for the new cxx-common and llvm35

This closes #317

* Code review changes

* Code review changes
2017-11-09 14:52:10 -05:00
Alessandro Gario 6015890d14 This PR enables the XZ test (#312)
* Travis: Enable the XZ test.

* Travis: Show the clang command line when recompilation fails.
2017-11-06 13:22:50 -05:00
Alessandro Gario 406e674636 Add Travis support to the use_remill_semantics branch (#310)
* Imported the new test framework

* Added the new Travis script

* Change Ubuntu version to Xenial (16.04)

* Travis: Various fixes; also enabled CMAKE_VERBOSE_MAKEFILE

* Travis: The test binaries were being excluded by gitignore. Add clang's static analysis

* Travis: the CC and CXX variables were not being set

* Travis: Explicitly set the compiler (CMAKE_CXX_COMPILER) along with the CXX env var

* Travis: Disable the XZ test (currently broken), show the clang static analyzer summary

* Travis: Move the CI shellscript to the script folder. Add src headers

* Travis: Test a known Remill version to avoid random breakages
2017-11-05 16:18:21 -05:00