introduces the BIL code slot and a few convenience functions #1266
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a few convenience functions and gives access to internals
for build BIR graph. It is now very easy to go from BIL to blk term,
sub term or even program term. Details follow.
Enables representation of an instruction as a BIL program
We used BIL as a language for specifying the semantics of an
instruction, but we may also (and now can) represent the instruction
itself using BIL.
The rules of the knowledge base are adopted and split accordingly, so
that the rule that uses the old lifters to produce the BIL code is
separated from the rule that computes the semantics of the BIL code.
It is now possible to get easily an
Insn.t
value frombil
and evento go from bil to sub or program term.
E.g., to get the semantics of BIL just create a new program object and
set its bil code,
You can run this computation, for example, in the BAP toplevel
knowledge base, e.g.,
To get IR from insn use the
Blk.from_insn
function, so the full pathfrom BIL to BIR will be
Adds some sugar to IR term building functions.
It is now possible to pass the parts of compound terms to their create
function, e.g.,
Adds the Blk.from_insns function
This function translate a sequence of machine instructions that
represent a basic block into IR and preserves as much as possible the
original structure trying to keep at minimum the number of generated
IR blks.
Uses the special encodings as much as possible
This will enable more seamless translation of the system calls and interrupts.