This project contains the ASLi lifter plugin. The file with most of the heavy lifting is a64_lifter.ml
. The lifter is able to generate semantics for the armv8 instruction set, using the ASL-interpreter to automatically generate an OCaml representation of the semantics, which are then translated into BIR through this program.
In the lifter, if you need to implement a new operation, this page is useful for finding what you have available to you through BAP.
To build and run this plugin, you'll need:
- BAP, likely a version greater than 2.5.0
- ASLi with partial evaluation
If the requirements have been installed, run make
in this directory to build and install the plugin.
Requires the architecture specification to be provided.
export ASLI_PATH=<PATH TO ASLI DIR>
bap <binary> --primus-lisp-semantics=disable \
--asli-prelude=$ASLI_PATH/prelude.asl \
--asli-specs=$ASLI_PATH/mra_tools/arch/regs.asl \
--asli-specs=$ASLI_PATH/mra_tools/types.asl \
--asli-specs=$ASLI_PATH/mra_tools/arch/arch.asl \
--asli-specs=$ASLI_PATH/mra_tools/arch/arch_instrs.asl \
--asli-specs=$ASLI_PATH/mra_tools/arch/arch_decode.asl \
--asli-specs=$ASLI_PATH/mra_tools/support/aes.asl \
--asli-specs=$ASLI_PATH/mra_tools/support/barriers.asl \
--asli-specs=$ASLI_PATH/mra_tools/support/debug.asl \
--asli-specs=$ASLI_PATH/mra_tools/support/feature.asl \
--asli-specs=$ASLI_PATH/mra_tools/support/hints.asl \
--asli-specs=$ASLI_PATH/mra_tools/support/interrupts.asl \
--asli-specs=$ASLI_PATH/mra_tools/support/memory.asl \
--asli-specs=$ASLI_PATH/mra_tools/support/stubs.asl \
--asli-specs=$ASLI_PATH/tests/override.asl
Various scripts are provided in scripts
to pass the appropriate options to bap
given the ASLI_PATH
environment variable is set.