libTriton  version 0.9 build 1502
Immediate

[python api] All information about the Immediate Python object.

Description


This object is used to represent an immediate.

Example

>>> ctxt.processing(inst)
True
>>> print(inst)
0x0: mov eax, 0x14
>>> op1 = inst.getOperands()[1]
>>> print(op1)
0x14:32 bv[31..0]
>>> print(hex(op1.getValue()))
0x14
>>> print(op1.getBitSize())
32

Constructor

>>> imm = Immediate(0x1234, CPUSIZE.WORD)
>>> print(imm)
0x1234:16 bv[15..0]
>>> imm.getValue()
4660
>>> imm.getSize()
2
>>> imm.getBitSize()
16

Python API - Methods of the Immediate class


  • integer getBitSize(void)
    Returns the size (in bits) of the immediate.
    e.g: 64
  • BitsVector getBitvector(void)
    Returns the bit vector.
  • SHIFT getShiftType(void)
    Returns the shift type of the operand. Mainly used for AArch64.
    e.g: SHIFT.ARM.LSL
  • integer getShiftImmediate(void)
    Returns the shift immediate value of the operand. Mainly used for AArch64 and ARM32.
    e.g: 2
  • REG getShiftRegister(void)
    Returns the shift register of the operand. Mainly used for ARM32.
    e.g: REG.ARM32.R0
  • integer getSize(void)
    Returns the size (in bytes) of the immediate.
    e.g: 8
  • OPERAND getType(void)
    Returns the type of the immediate. In this case this function returns OPERAND.IMM.
  • integer getValue(void)
    Returns the immediate value.
  • void setValue(integer value, integer size)
    Sets the immediate value.