class FFI::UDis86::Operand
Public Instance Methods
The base register used by the operand.
@return [Symbol]
The base register of the operand.
# File lib/ffi/udis86/operand.rb, line 122 def base REGS[self[:base]] end
The index register used by the operand.
@return [Symbol]
The index register of the operand.
# File lib/ffi/udis86/operand.rb, line 134 def index REGS[self[:index]] end
Determines if the operand is a data constant.
@return [Boolean]
Specifies whether the operand is a data constant.
# File lib/ffi/udis86/operand.rb, line 74 def is_const? self[:type] == :ud_op_const end
Determines if the operand is immediate data.
@return [Boolean]
Specifies whether the operand is immediate data.
# File lib/ffi/udis86/operand.rb, line 54 def is_imm? self[:type] == :ud_op_imm end
Determines if the operand is a relative offset used in a jump.
@return [Boolean]
Specifies whether the operand is a relative offset.
# File lib/ffi/udis86/operand.rb, line 64 def is_jmp_imm? self[:type] == :ud_op_jimm end
Determines if the operand is a memory access.
@return [Boolean]
Specifies whether the operand is a memory access.
# File lib/ffi/udis86/operand.rb, line 34 def is_mem? self[:type] == :ud_op_mem end
Determines if the operand is a register.
@return [Boolean]
Specifies whether the operand is a register.
# File lib/ffi/udis86/operand.rb, line 84 def is_reg? self[:type] == :ud_op_reg end
Determines if the operand is Segment:Offset pointer.
@return [Boolean]
Specifies whether the operand is Segment:Offset pointer.
# File lib/ffi/udis86/operand.rb, line 44 def is_seg_ptr? self[:type] == :ud_op_ptr end
The offset value used by the operand.
@return [OperandValue, 0]
The offset value of the operand.
# File lib/ffi/udis86/operand.rb, line 144 def offset if self[:offset] > 0 return self[:value] else return 0 end end
The word-length of the offset used with the operand.
@return [Integer]
Word-length of the offset being used.
# File lib/ffi/udis86/operand.rb, line 158 def offset_size self[:offset] end
The scale value used by the operand.
@return [Integer]
The scale value of the operand.
# File lib/ffi/udis86/operand.rb, line 168 def scale self[:scale] end
The size of the operand.
@return [Integer]
The size of the operand in bytes.
# File lib/ffi/udis86/operand.rb, line 94 def size self[:size] end
The type of the operand.
@return [Symbol]
The type of the operand.
# File lib/ffi/udis86/operand.rb, line 24 def type self[:type] end
The value of the operand.
@return [OperandValue, OperandPointer]
The value of the operand. If the operand represents a pointer, an OperandPointer object will be returned.
# File lib/ffi/udis86/operand.rb, line 105 def value case type when :ud_op_ptr return self[:value].ptr when :ud_op_reg return nil else return self[:value] end end