This object is used to represent an Instruction.
>>> from __future__ import print_function
>>> from triton import TritonContext, ARCH, Instruction, OPERAND, EXCEPTION
>>> trace = [
... (0x400000, b"\x48\x8b\x05\xb8\x13\x00\x00"),
... (0x400007, b"\x48\x8d\x34\xc3"),
... (0x40000b, b"\x67\x48\x8D\x74\xC3\x0A"),
... (0x400011, b"\x66\x0F\xD7\xD1"),
... (0x400015, b"\x89\xd0"),
... (0x400017, b"\x80\xf4\x99"),
... ]
>>> ctxt = TritonContext()
>>> ctxt.setArchitecture(ARCH.X86_64)
>>> for (addr, opcode) in trace:
...
...
... inst = Instruction()
...
...
... inst.setOpcode(opcode)
...
...
... inst.setAddress(addr)
...
...
... if ctxt.processing(inst) == EXCEPTION.FAULT_UD:
... print("Fail an instruction")
...
... print(inst)
... for op in inst.getOperands():
... print(' %s' % (op))
... if op.getType() == OPERAND.MEM:
... print(' base : %s' % (op.getBaseRegister()))
... print(' index : %s' % (op.getIndexRegister()))
... print(' disp : %s' % (op.getDisplacement()))
... print(' scale : %s' % (op.getScale()))
... print('')
0x400000: mov rax, qword ptr [rip + 0x13b8]
rax:64 bv[63..0]
[@0x4013bf]:64 bv[63..0]
base : rip:64 bv[63..0]
index : unknown:1 bv[0..0]
disp : 0x13b8:64 bv[63..0]
scale : 0x1:64 bv[63..0]
<BLANKLINE>
0x400007: lea rsi, [rbx + rax*8]
rsi:64 bv[63..0]
[@0x0]:64 bv[63..0]
base : rbx:64 bv[63..0]
index : rax:64 bv[63..0]
disp : 0x0:64 bv[63..0]
scale : 0x8:64 bv[63..0]
<BLANKLINE>
0x40000b: lea rsi, [ebx + eax*8 + 0xa]
rsi:64 bv[63..0]
[@0xa]:64 bv[63..0]
base : ebx:32 bv[31..0]
index : eax:32 bv[31..0]
disp : 0xa:32 bv[31..0]
scale : 0x8:32 bv[31..0]
<BLANKLINE>
0x400011: pmovmskb edx, xmm1
edx:32 bv[31..0]
xmm1:128 bv[127..0]
<BLANKLINE>
0x400015: mov eax, edx
eax:32 bv[31..0]
edx:32 bv[31..0]
<BLANKLINE>
0x400017: xor ah, 0x99
ah:8 bv[15..8]
0x99:8 bv[7..0]
<BLANKLINE>