Header menu logo B2R2

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

LiftingUnit(binFile, regFactory, parser)

Full Usage: LiftingUnit(binFile, regFactory, parser)

Parameters:
Returns: LiftingUnit
binFile : IBinFile
regFactory : IRegisterFactory
parser : IInstructionParsable
Returns: LiftingUnit

Instance members

Instance member Description

this.ConfigureDisassembly

Full Usage: this.ConfigureDisassembly

Parameters:
    showAddr : bool
    showSymbol : bool

Configure the disassembly output format for each disassembled instruction. Subsequent disassembly will use the configured format.

showAddr : bool
showSymbol : bool

this.ConfigureDisassembly

Full Usage: this.ConfigureDisassembly

Parameters:
    showAddr : bool

Configure the disassembly output format for each disassembled instruction to show the address of the instruction or not.

showAddr : bool

this.DecomposeInstruction

Full Usage: this.DecomposeInstruction

Parameters:
Returns: AsmWord[] Decomposed AsmWords.

Decompose an instruction pointed to by the given pointer (ptr) and return the disassembled sequence of AsmWords.

ptr : BinFilePointer

The binary file pointer.

Returns: AsmWord[]

Decomposed AsmWords.

this.DecomposeInstruction

Full Usage: this.DecomposeInstruction

Parameters:
    addr : Addr - The instruction address.

Returns: AsmWord[] Decomposed AsmWords.

Decompose an instruction at the given address (addr) and return the disassembled sequence of AsmWords.

addr : Addr

The instruction address.

Returns: AsmWord[]

Decomposed AsmWords.

this.DecomposeInstruction

Full Usage: this.DecomposeInstruction

Parameters:
Returns: AsmWord[] Decomposed AsmWords.

Decompose the given instruction and return the disassembled sequence of AsmWords.

ins : IInstruction

The instruction to decompose.

Returns: AsmWord[]

Decomposed AsmWords.

this.DisasmInstruction

Full Usage: this.DisasmInstruction

Parameters:
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.

ptr : BinFilePointer

The binary file pointer.

Returns: string

Disassembled string.

this.DisasmInstruction

Full Usage: this.DisasmInstruction

Parameters:
    addr : 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.

addr : Addr

The instruction address.

Returns: string

Disassembled string.

this.DisasmInstruction

Full Usage: this.DisasmInstruction

Parameters:
Returns: string Disassembled string.

Disassemble the given instruction and return the disassembled string.

ins : IInstruction

The instruction to disassemble.

Returns: string

Disassembled string.

this.File

Full Usage: this.File

Returns: IBinFile

Binary file to be lifted.

Returns: IBinFile

this.InstructionAlignment

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).

Returns: int

this.LiftBBlock

Full Usage: this.LiftBBlock

Parameters:
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.

ptr : BinFilePointer

The binary file pointer.

Returns: Result<Stmt[] array, Stmt[] array>

Array of lifted IR statements, grouped by instructions.

this.LiftBBlock

Full Usage: this.LiftBBlock

Parameters:
    addr : Addr - The start address.

Returns: Result<Stmt[] array, Stmt[] array> Array of lifted IR statements, grouped by instructions.

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.

addr : Addr

The start address.

Returns: Result<Stmt[] array, Stmt[] array>

Array of lifted IR statements, grouped by instructions.

this.LiftInstruction

Full Usage: this.LiftInstruction

Parameters:
    ins : 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.

ins : IInstruction

The instruction to be lifted.

optimize : bool

Whether to optimize the lifted IR statements or not.

Returns: Stmt array

Lifted IR statements.

this.LiftInstruction

Full Usage: this.LiftInstruction

Parameters:
Returns: Stmt[] Lifted IR statements.

Lifts the given instruction and return the lifted IR statements.

ins : IInstruction

The instruction to be lifted.

Returns: Stmt[]

Lifted IR statements.

this.LiftInstruction

Full Usage: this.LiftInstruction

Parameters:
    ptr : 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.

ptr : BinFilePointer

The binary file pointer.

optimize : bool

Whether to optimize the lifted IR statements or not.

Returns: Stmt array

Lifted IR statements.

this.LiftInstruction

Full Usage: this.LiftInstruction

Parameters:
Returns: Stmt[] Lifted IR statements.

Lifts an instruction pointed to by the given pointer and return the lifted IR statements.

ptr : BinFilePointer

The binary file pointer.

Returns: Stmt[]

Lifted IR statements.

this.LiftInstruction

Full Usage: this.LiftInstruction

Parameters:
    addr : Addr - The instruction address.
    optimize : bool - Whether to optimize the lifted IR statements or not.

Returns: Stmt array Lifted IR statements.

Lifts an instruction at the given address (addr) and return the lifted IR statements. It is recommended to use the same method that takes in a pointer when the performance is a concern.

addr : Addr

The instruction address.

optimize : bool

Whether to optimize the lifted IR statements or not.

Returns: Stmt array

Lifted IR statements.

this.LiftInstruction

Full Usage: this.LiftInstruction

Parameters:
    addr : Addr - The instruction address.

Returns: Stmt array Lifted IR statements.

Lifts an instruction at the given address (addr) and return the lifted IR statements without optimization. It is recommended to use the same method that takes in a pointer when the performance is a concern.

addr : Addr

The instruction address.

Returns: Stmt array

Lifted IR statements.

this.ParseBBlock

Full Usage: this.ParseBBlock

Parameters:
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.

ptr : BinFilePointer

The binary file pointer.

Returns: Result<IInstruction array, IInstruction array>

Parsed basic block (i.e., an array of instructions).

this.ParseBBlock

Full Usage: this.ParseBBlock

Parameters:
    addr : 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. It is recommended to use the same method that takes in a pointer when the performance is a concern.

addr : Addr

The basic block address.

Returns: Result<IInstruction array, IInstruction array>

Parsed basic block (i.e., an array of instructions).

this.ParseInstruction

Full Usage: this.ParseInstruction

Parameters:
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.

ptr : BinFilePointer

BinFilePointer.

Returns: IInstruction

Parsed instruction.

this.ParseInstruction

Full Usage: this.ParseInstruction

Parameters:
    addr : 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. It is recommended to use the same method that takes in a pointer when the performance is a concern.

addr : Addr

The instruction address.

Returns: IInstruction

Parsed instruction.

this.Parser

Full Usage: this.Parser

Returns: IInstructionParsable

Parser of this lifting unit.

Returns: IInstructionParsable

this.SetDisassemblySyntax

Full Usage: this.SetDisassemblySyntax

Parameters:

Sets the disassembly syntax for the disassembler. Only Intel architecture is affected by this setting.

syntax : DisasmSyntax

this.TryParseInstruction

Full Usage: this.TryParseInstruction

Parameters:
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.

ptr : BinFilePointer

BinFilePointer.

Returns: Result<IInstruction, ErrorCase>

Parsed instruction if succeeded, ErrorCase if otherwise.

this.TryParseInstruction

Full Usage: this.TryParseInstruction

Parameters:
    addr : 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.

addr : Addr

The instruction address.

Returns: Result<IInstruction, ErrorCase>

Parsed instruction if succeeded, ErrorCase if otherwise.

Type something to start searching.