* 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>
* 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>
* Devirtualization can only happen in read_only segment
* Disable inlining with explicit_args because of dse
Co-authored-by: Aiethel <korencikl@gmail.com>
* Correct constness when appending to global ctors
* Remove obsolete commit.
* Return type for native -> lifted is now pointer type size.
* Main returns i32
* More broadly applies lazy xref initialization to all initializations where the xref size is less than teh value size of the xref itself (pointer size, usually). Moves initialization of lazy xrefs into a new function, __mcsema_early_init, which guards itself against multiple executions. Makes sure that __mcsema_constructor calls __mcsema_early_init first. Finally, makes sure that all native-to-lifted entrypoints call __mcsema_early_init as well, as we have observed cases where the lifted binary contains weak implementations of c++ standard library functions, and these functions are called by native libraries initialized before the call to __mcsema_constructor, thereby resulting in re-entrancy issues.
* Update Function.cpp
* Make sure the __mcsema_early_init guard is in the module.
* Make sure the __mcsema_early_init guard is in the module.
* Fixes for __gmon_start__ and stuff.
* Minor fix
* Adds some symbols
* Minor fix for ida7
* Try to resolve things like calls through PLT thunks via xref entry lookups when a flow cross-reference is missing.
* -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
* Using both --libc_ctor/dtor and --explicit_args no longer crashes
* --explicit_args now works with functions calling indirectly into lifted code
* Basic support for thread_local global stack and state
* Single function to insert call to __mcsema_verify_reg_state as first inst of block
* State is now zeroinitialized
* Extra comment
* Remove inline attribute from __detach_call_value
* No need for InsertVerifyFunction at beginning of ext_* functions
* Adds a new command-line option that adds a request for stack protection on lifted functions.
* Add the stack protector request to more locations
* Add gets to the libc abi.
* 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
* 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
* Add initial support for --abi_library flags
* support for abi_library
* Remove the weak linkage for __mcsema_debug_get_reg_state.
* Fix num of agruments for __cxa_allocate_exception
* Remove --library flag and cleanup
* Don't reload/overwrite mcsema::gModule after loading in the protobuf.
* Use PrepareModuleDataLayout to avoid checks for __remill_basic_block function.
* Bump the remill commit id to support --abi_library flag
* Fix travis build failure
* Initialize the test log filename;
* trim newline char from the eof
* 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
* explicit args to external APIs
* Make AArch64 disassembly detect refs to external functions
* Fix awful bug where code would become undefined since our callinst was not same convention as the called function
* Emit enough code so that AArch64 bitcode gets emitted