This class interfaces the assembler/disassembler support.
Public Types
Disassembly instruction iterator.
Public Functions
Disassemble the provided buffer with the address specified in the second parameter.
Disassemble the given vector of bytes with the address specified in the second parameter.
This class represents an assembly instruction.
Subclassed by LIEF::assembly::aarch64::Instruction, LIEF::assembly::arm::Instruction, LIEF::assembly::ebpf::Instruction, LIEF::assembly::mips::Instruction, LIEF::assembly::powerpc::Instruction, LIEF::assembly::riscv::Instruction, LIEF::assembly::x86::Instruction
Public Types
Public Functions
Address of the instruction.
Size of the instruction in bytes.
Raw bytes of the current instruction.
Instruction mnemonic (e.g. br
)
Representation of the current instruction in a pretty assembly way.
True if the instruction is a call.
True if the instruction marks the end of a basic block.
True if the instruction is a branch.
True if the instruction is a syscall.
True if the instruction performs a memory access.
True if the instruction is a register to register move.
True if the instruction performs an arithmetic addition.
True if the instruction is a trap.
On x86/x86-64
this includes the ud1/ud2
instructions
On AArch64
this includes the brk/udf
instructions
True if the instruction prevents executing the instruction that immediatly follows the current. This includes return or unconditional branch instructions.
True if the instruction is a return.
True if the instruction is and indirect branch.
This includes instructions that branch through a register (e.g. jmp rax
, br x1
).
True if the instruction is conditionally jumping to the next instruction or an instruction into some other basic block.
True if the instruction is jumping (unconditionally) to some other basic block.
True if the instruction is a comparison.
True if the instruction is moving an immediate.
True if the instruction is doing a bitcast.
Memory access flags.
Given a is_branch() instruction, try to evaluate the address of the destination.
Return the underlying llvm::MCInst implementation.
Warning
Because of ABI compatibility, this MCInst can only be used with the same version of LLVM used by LIEF.
This function can be used to down cast an Instruction instance:
std::unique_ptr<assembly::Instruction> inst = get_inst();
if (const auto* arm = inst->as<assembly::arm::Instruction>()) {
const arm::OPCODE op = arm->opcode();
}
Friends
Lazy-forward iterator that outputs Instruction
Public Types
Public Functions
Disassemble and output an Instruction at the current iterator’s position.