LiftingUnit Type
Represents a basic unit for lifting binaries, which can be used to parse, disassemble, and lift instructions. To lift a binary in parallel, one needs to create multiple lifting units.
Constructors
| Constructor |
Description
|
Full Usage:
LiftingUnit(binFile, regFactory, parser)
Parameters:
IBinFile
regFactory : IRegisterFactory
parser : IInstructionParsable
Returns: LiftingUnit
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.ConfigureDisassembly
Parameters:
bool
showSymbol : bool
|
Configure the disassembly output format for each disassembled instruction. Subsequent disassembly will use the configured format.
|
Full Usage:
this.ConfigureDisassembly
Parameters:
bool
|
Configure the disassembly output format for each disassembled instruction to show the address of the instruction or not.
|
Full Usage:
this.DecomposeInstruction
Parameters:
BinFilePointer
-
The binary file pointer.
Returns: AsmWord[]
Decomposed AsmWords.
|
Decompose an instruction pointed to by the given pointer (ptr) and return the disassembled sequence of AsmWords.
|
|
|
Full Usage:
this.DecomposeInstruction
Parameters:
IInstruction
-
The instruction to decompose.
Returns: AsmWord[]
Decomposed AsmWords.
|
Decompose the given instruction and return the disassembled sequence of AsmWords.
|
Full Usage:
this.DisasmInstruction
Parameters:
BinFilePointer
-
The binary file pointer.
Returns: string
Disassembled string.
|
Disassemble an instruction pointed to by the given pointer (ptr) and return the disassembled string. The output does not show the address of the instruction nor resolve the symbols of references.
|
Full Usage:
this.DisasmInstruction
Parameters:
Addr
-
The instruction address.
Returns: string
Disassembled string.
|
Disassemble an instruction at the given address (addr) and return the disassembled string. The output does not show the address of the instruction nor resolve the symbols of references.
|
Full Usage:
this.DisasmInstruction
Parameters:
IInstruction
-
The instruction to disassemble.
Returns: string
Disassembled string.
|
Disassemble the given instruction and return the disassembled string.
|
Binary file to be lifted.
|
|
Full Usage:
this.InstructionAlignment
Returns: int
|
The instruction alignment (in bytes) enforced by the CPU. For example, ARM requires instructions to be aligned to 4 bytes, while x86 does not have such a requirement (i.e., 1-byte alignment).
|
Full Usage:
this.LiftBBlock
Parameters:
BinFilePointer
-
The binary file pointer.
Returns: Result<Stmt[] array, Stmt[] array>
Array of lifted IR statements, grouped by instructions.
|
Lift a basic block starting from the given pointer (ptr) and return the lifted IR statements, grouped by instructions. This function returns an incomplete list of IR statments if the parsing process fails.
|
|
Lifts a basic block starting from the given address (addr) and return the lifted IR statements, grouped by instructions. This function returns an incomplete list of IR statments if the parsing process fails.
|
Full Usage:
this.LiftInstruction
Parameters:
IInstruction
-
The instruction to be lifted.
optimize : bool
-
Whether to optimize the lifted IR statements or not.
Returns: Stmt array
Lifted IR statements.
|
Lifts the given instruction and return the lifted IR statements.
|
Full Usage:
this.LiftInstruction
Parameters:
IInstruction
-
The instruction to be lifted.
Returns: Stmt[]
Lifted IR statements.
|
Lifts the given instruction and return the lifted IR statements.
|
Full Usage:
this.LiftInstruction
Parameters:
BinFilePointer
-
The binary file pointer.
optimize : bool
-
Whether to optimize the lifted IR statements or not.
Returns: Stmt array
Lifted IR statements.
|
Lifts an instruction pointed to by the given pointer and return the lifted IR statements.
|
Full Usage:
this.LiftInstruction
Parameters:
BinFilePointer
-
The binary file pointer.
Returns: Stmt[]
Lifted IR statements.
|
Lifts an instruction pointed to by the given pointer and return the lifted IR statements.
|
|
Lifts an instruction at the given address (addr) and return the lifted IR
statements.
|
|
|
Full Usage:
this.ParseBBlock
Parameters:
BinFilePointer
-
The binary file pointer.
Returns: Result<IInstruction array, IInstruction array>
Parsed basic block (i.e., an array of instructions).
|
Parses a basic block pointed to by the given binary file pointer (ptr), and return the corresponding array of instructions. This function returns an incomplete list of instructions if the parsing process fails.
|
Full Usage:
this.ParseBBlock
Parameters:
Addr
-
The basic block address.
Returns: Result<IInstruction array, IInstruction array>
Parsed basic block (i.e., an array of instructions).
|
Parses a basic block starting from the given address (addr), and return
the corresponding array of instructions. This function returns an
incomplete list of instructions if the parsing process fails.
|
Full Usage:
this.ParseInstruction
Parameters:
BinFilePointer
-
BinFilePointer.
Returns: IInstruction
Parsed instruction.
|
Parses one instruction pointed to by the binary file pointer (ptr), and return the corresponding instruction. This function raises an exception if the parsing process fails.
|
Full Usage:
this.ParseInstruction
Parameters:
Addr
-
The instruction address.
Returns: IInstruction
Parsed instruction.
|
Parses one instruction at the given address (addr), and return the
corresponding instruction. This function raises an exception if the
parsing process fails.
|
|
Parser of this lifting unit.
|
|
Sets the disassembly syntax for the disassembler. Only Intel architecture is affected by this setting.
|
Full Usage:
this.TryParseInstruction
Parameters:
BinFilePointer
-
BinFilePointer.
Returns: Result<IInstruction, ErrorCase>
Parsed instruction if succeeded, ErrorCase if otherwise.
|
Tries to parse one instruction pointed to by the binary file pointer (ptr), and return the corresponding instruction.
|
Full Usage:
this.TryParseInstruction
Parameters:
Addr
-
The instruction address.
Returns: Result<IInstruction, ErrorCase>
Parsed instruction if succeeded, ErrorCase if otherwise.
|
Tries to parse one instruction at the given address (addr), and return the corresponding instruction.
|
B2R2