int3.instructions

class int3.instructions.instruction.MemoryOperand(reg: RegisterDef, offset: int, ptr_desc: PointerDesc = '')

Specialized operand type for representing memory access.

class int3.instructions.instruction.OperandView(insn: Instruction)

A view into an instruction’s operands.

property cs_insn: CsInsn

The underlying Capstone instruction instance.

imm(index: int) int

Get the immediate at the specific operand position

is_imm(index: int) bool

Whether the operand at the specific position is an immediate.

is_mem(index: int) bool

Whether the operand at the specific position is a memory access.

is_reg(index: int) bool

Whether the operand at the specific position is a register.

mem(index: int) MemoryOperand

Get the memory access operand at the specific operand position

reg(index: int) RegisterDef

Get the register definition at the specific operand position.

replace(index: int, operand: int | str | RegisterDef | MemoryOperand) Instruction

Replace the operand at the specified index with an immediate or register.

token(index: int) str

Retrieve the raw operand token.

class int3.instructions.instruction.Instruction(cs_insn: CsInsn, triple: Triple)

Wrapper around a machine code instruction.

property arch: Architecture
cs_insn: CsInsn
static from_bytes(raw: bytes, triple: Triple) tuple[Instruction, ...]

Factory method to produce an instruction from machine code bytes.

static from_str(raw: str, triple: Triple) tuple[Instruction, ...]

Factory method to produce an instruction from assembly text.

is_add() bool
is_and() bool
is_branch() bool
is_call() bool
is_dirty(bad_bytes: bytes) bool
is_jump() bool
is_mov() bool
is_or() bool
is_pop() bool
is_push() bool
is_sub() bool
is_syscall() bool
mnemonic: str
op_str: str
operands: OperandView
raw: bytes
static summary(*insns: Instruction, indent: int = 0) list[str]

Summary text for a sequence of instructions.

tainted_regs: set[RegisterDef]
to_str(alignment: int = 0, with_hex: bool = True) str

Pretty print this instructions mnemonic and operands.

triple: Triple