Class: FFI::UDis86::Operand
- Inherits:
-
Struct
- Object
- Struct
- FFI::UDis86::Operand
- Defined in:
- lib/ffi/udis86/operand.rb
Instance Method Summary collapse
-
#base ⇒ Symbol
(also: #reg)
The base register used by the operand.
-
#index ⇒ Symbol
The index register used by the operand.
-
#is_const? ⇒ Boolean
Determines if the operand is a data constant.
-
#is_imm? ⇒ Boolean
Determines if the operand is immediate data.
-
#is_jmp_imm? ⇒ Boolean
Determines if the operand is a relative offset used in a jump.
-
#is_mem? ⇒ Boolean
Determines if the operand is a memory access.
-
#is_reg? ⇒ Boolean
Determines if the operand is a register.
-
#is_seg_ptr? ⇒ Boolean
Determines if the operand is Segment:Offset pointer.
-
#offset ⇒ OperandValue, 0
The offset value used by the operand.
-
#offset_size ⇒ Integer
The word-length of the offset used with the operand.
-
#scale ⇒ Integer
The scale value used by the operand.
-
#size ⇒ Integer
The size of the operand.
-
#type ⇒ Symbol
The type of the operand.
-
#value ⇒ OperandValue, OperandPointer
The value of the operand.
Instance Method Details
#base ⇒ Symbol Also known as: reg
The base register used by the operand.
122 123 124 |
# File 'lib/ffi/udis86/operand.rb', line 122 def base REGS[self[:base]] end |
#index ⇒ Symbol
The index register used by the operand.
134 135 136 |
# File 'lib/ffi/udis86/operand.rb', line 134 def index REGS[self[:index]] end |
#is_const? ⇒ Boolean
Determines if the operand is a data constant.
74 75 76 |
# File 'lib/ffi/udis86/operand.rb', line 74 def is_const? self[:type] == :ud_op_const end |
#is_imm? ⇒ Boolean
Determines if the operand is immediate data.
54 55 56 |
# File 'lib/ffi/udis86/operand.rb', line 54 def is_imm? self[:type] == :ud_op_imm end |
#is_jmp_imm? ⇒ Boolean
Determines if the operand is a relative offset used in a jump.
64 65 66 |
# File 'lib/ffi/udis86/operand.rb', line 64 def is_jmp_imm? self[:type] == :ud_op_jimm end |
#is_mem? ⇒ Boolean
Determines if the operand is a memory access.
34 35 36 |
# File 'lib/ffi/udis86/operand.rb', line 34 def is_mem? self[:type] == :ud_op_mem end |
#is_reg? ⇒ Boolean
Determines if the operand is a register.
84 85 86 |
# File 'lib/ffi/udis86/operand.rb', line 84 def is_reg? self[:type] == :ud_op_reg end |
#is_seg_ptr? ⇒ Boolean
Determines if the operand is Segment:Offset pointer.
44 45 46 |
# File 'lib/ffi/udis86/operand.rb', line 44 def is_seg_ptr? self[:type] == :ud_op_ptr end |
#offset ⇒ OperandValue, 0
The offset value used by the operand.
144 145 146 147 148 149 150 |
# File 'lib/ffi/udis86/operand.rb', line 144 def offset if self[:offset] > 0 return self[:value] else return 0 end end |
#offset_size ⇒ Integer
The word-length of the offset used with the operand.
158 159 160 |
# File 'lib/ffi/udis86/operand.rb', line 158 def offset_size self[:offset] end |
#scale ⇒ Integer
The scale value used by the operand.
168 169 170 |
# File 'lib/ffi/udis86/operand.rb', line 168 def scale self[:scale] end |
#size ⇒ Integer
The size of the operand.
94 95 96 |
# File 'lib/ffi/udis86/operand.rb', line 94 def size self[:size] end |
#type ⇒ Symbol
The type of the operand.
24 25 26 |
# File 'lib/ffi/udis86/operand.rb', line 24 def type self[:type] end |
#value ⇒ OperandValue, OperandPointer
The value of the operand.
105 106 107 108 109 110 111 112 113 114 |
# 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 |