IInstruction Type
Represents a single machine instruction in a platform-independent manner. It provides useful methods for accessing useful information about the instruction.
Instance members
| Instance member |
Description
|
|
The address of this instruction.
|
Full Usage:
this.Decompose
Parameters:
IDisasmBuilder
Returns: AsmWord[]
Returns an array of AsmWords.
Modifiers: abstract |
Decomposes this instruction into AsmWords.
|
Full Usage:
this.DirectBranchTarget
Parameters:
byref<Addr>
Returns: bool
Returns true if a target address exists. Otherwise, returns false.
Modifiers: abstract |
Returns a branch target address if we can directly compute it, i.e., for direct branches.
|
Full Usage:
this.Disasm
Returns: string
Returns a disassembled string.
Modifiers: abstract |
Disassembles this instruction. This function is a convenience method, which internally creates a default disassembly builder and uses it to disassemble the instruction. Hence, this is not as efficient as the previous method and should be avoided if disassembly performance is a concern.
|
Full Usage:
this.Disasm
Parameters:
IDisasmBuilder
-
When this parameter is given, we disassemble the instruction with the
given name builder to disassemble the instruction. It can resolve symbols
depending on the implementation of the builder.
Returns: string
Returns a disassembled string.
Modifiers: abstract |
Disassembles this instruction.
|
|
Returns an array of possible next instruction addresses. For branch instructions, the returned sequence includes jump target(s). For call instructions, the sequence does not include the return address (i.e., the address of the instruction following the call instruction). For regular instructions, the sequence is a singleton of the fall-through address. This function does not resolve indirect branch targets.
|
Full Usage:
this.Immediate
Parameters:
byref<int64>
Returns: bool
Returns true if an immediate exists. Otherwise, returns false.
Modifiers: abstract |
Return an integer immediate value of the instruction if there is one. This function will ignore floating-point immediate values.
|
Full Usage:
this.IndirectTrampolineAddr
Parameters:
byref<Addr>
Returns: bool
Returns true if a trampoline address exists. Otherwise, returns false.
Modifiers: abstract |
Returns a trampoline address of an indirect branch instruction if we can directly compute the address. For example, `JMP [RIP + 0x42]` is an indirect branch instruction, but we can compute the trampoline address as RIP is statically known anyways when PIC is off.
|
Full Usage:
this.InterruptNum
Parameters:
byref<int64>
Returns: bool
Modifiers: abstract |
Returns the interrupt number if this is an interrupt instruction.
|
Full Usage:
this.IsBranch
Returns: bool
Returns true if this is a branch instruction.
Modifiers: abstract |
Is this a branch instruction? A branch instruction includes any kinds of jump instructions, such as CALL/RET instructions, indirect/direct jump instructions, and conditional jump instructions.
|
Full Usage:
this.IsCJmpOnTrue
Returns: bool
Returns true if this is a conditional branch instruction, and jumps to
the target when the predicate is true.
Modifiers: abstract |
Is this a conditional branch instruction, and it jumps to the branch
target when the predicate is true? For example, this method returns true
for
|
Full Usage:
this.IsCall
Returns: bool
Returns true if this is a call instruction.
Modifiers: abstract |
Is this a call instruction?
|
Full Usage:
this.IsCondBranch
Returns: bool
Returns true if this is a conditional branch instruction.
Modifiers: abstract |
Is this a conditional branch instruction?
|
Full Usage:
this.IsDirectBranch
Returns: bool
Returns true if this is a direct branch instruction.
Modifiers: abstract |
Is this a direct branch instruction? A direct branch instruction is a
branch instruction with a concrete jump target, which is inscribed in its
operand. For example,
|
Full Usage:
this.IsExit
Returns: bool
Returns true if this instruction should be at the end of the
corresponding basic block.
Modifiers: abstract |
Does this instruction exits the program execution? For example, this
function returns true for the
|
Full Usage:
this.IsIndirectBranch
Returns: bool
Returns true if this is an indirect branch instruction.
Modifiers: abstract |
Is this an indirect branch instruction? An indirect branch instruction is a branch instruction with a symbolic jump target. Thus, the jump target is only computed at runtime.
|
Full Usage:
this.IsInlinedAssembly
Returns: bool
Modifiers: abstract |
Is this a virtual instruction that represents an inlined assembly code?
|
Full Usage:
this.IsInterrupt
Returns: bool
Returns true if this is an interrupt instruction
Modifiers: abstract |
Does this instruction involve an interrupt?
|
Full Usage:
this.IsModeChanging
Returns: bool
Returns true if this is a mode-changing instruction.
Modifiers: abstract |
Is this a mode-changing instruction? In ARMv7, BLX is such an instruction.
|
Full Usage:
this.IsNop
Returns: bool
Returns true if this instruction is a NO-OP.
Modifiers: abstract |
Is this a NO-OP instruction? We say an instruction is a NO-OP if it does not change the CPU state except for the program counter.
|
Full Usage:
this.IsPop
Returns: bool
Returns true if this is a pop instruction.
Modifiers: abstract |
Is this a pop instruction? A pop instruction is an instruction that pops
a value from the stack. For example,
|
Full Usage:
this.IsPush
Returns: bool
Returns true if this is a push instruction.
Modifiers: abstract |
Is this a push instruction? A push instruction is an instruction that
pushes a value onto the stack. For example,
|
Full Usage:
this.IsRET
Returns: bool
Returns true if this is a return instruction.
Modifiers: abstract |
Is this a return instruction?
|
Full Usage:
this.IsTerminator
Parameters:
IInstruction
Returns: bool
Returns true if this instruction should be at the end of the corresponding
basic block.
Modifiers: abstract |
Does this instruction end a basic block? For example, this function returns true for branch instructions and exit instructions. We also consider system call instructions as a terminator. Note that this method takes the previous instruction as an argument, because instructions that are in a delay slot of a branch instruction should be considered as terminators in some architectures (e.g., MIPS).
|
Full Usage:
this.Length
Returns: uint32
Modifiers: abstract |
The length of this instruction in bytes.
|
Full Usage:
this.MemoryDereferences
Parameters:
byref<Addr[]>
Returns: bool
Returns if there exists any direct memory accesses. If there are
direct memory accesses, the `addrs` parameter will be filled with the
addresses of the direct memory accesses.
Modifiers: abstract |
Returns an array of addresses that this instruction directly dereferences
from memory. This includes PC-relative memory accesses, such as
|
Full Usage:
this.Translate
Parameters:
ILowUIRBuilder
Returns: Stmt[]
Returns an array of LowUIR statements.
Modifiers: abstract |
Lifts this instruction into a LowUIR statement array given a translation context.
|
Full Usage:
this.TranslateToList
Parameters:
ILowUIRBuilder
Returns: List<Stmt>
Returns a list of LowUIR statements.
Modifiers: abstract |
Lifts this instruction into a LowUIR statement list given a translation context.
|
B2R2