Expand description
This module defines the intermediate representation used to represent a binary and all its contained executable code.
The main data structure is the Project
struct,
which contains all information recovered about a binary during the disassembly step.
To learn how individual instructions are encoded,
you should first take a look at the Expression
type and then at the Def
and Jmp
data types,
which form the basis of the basic block Blk
struct.
Modules
- Control Flow Propagation Normalization Pass
Structs
- A basic block is a sequence of
Def
instructions followed by up to twoJmp
instructions. - An unsigned number of bytes.
- Calling convention related data
- Properties of C/C++ data types such as size.
- An extern symbol represents a funtion that is dynamically linked from another binary.
- The
Program
structure represents a disassembled binary. - The
Project
struct is the main data structure representing a binary. - A representation of the runtime image of a binary after being loaded into memory by the loader.
- A
Sub
or subroutine represents a function with a given name and a list of basic blocks belonging to it. - A term is an object inside a binary with an address and an unique ID (both contained in the
tid
). - A term identifier consisting of an ID string (which is required to be unique) and an address to indicate where the term is located.
- A variable represents a register with a known size and name.
Enums
- A parameter or return argument of a function.
- The type/mnemonic of a binary operation. See the Ghidra P-Code documentation for more information.
- The type/mnemonic of a typecast See the Ghidra P-Code documentation for more information.
- C/C++ data types.
- A side-effectful operation. Can be a register assignment or a memory load/store operation.
- An expression is a calculation rule on how to compute a certain value given some variables (register values) as input.
- A
Jmp
instruction affects the control flow of a program, i.e. it may change the instruction pointer. With the exception ofCallOther
, it has no other side effects. - The type/mnemonic of an unary operation See the Ghidra P-Code documentation for more information.
Traits
- A trait to extend the bitvector type with useful helper functions that are not contained in the
apint
crate.
Type Aliases
- A bitvector is a fixed-length vector of bits with the semantics of a CPU register, i.e. it supports two’s complement modulo arithmetic.