Class: OneGadget::Emulators::I386
- Defined in:
- lib/one_gadget/emulators/i386.rb
Overview
Emulator of amd64 instruction set.
Constant Summary
Constants inherited from X86
X86::COMPARES, X86::JCC, X86::SEGMENT_OPERAND
Constants inherited from Processor
Constants included from Constraints
Constraints::ADDRESS_TYPES, Constraints::CLOBBERED, Constraints::NULLABLE_REQUIREMENTS, Constraints::POINTER_REQUIREMENTS
Constants included from Conditional
Conditional::COMPARE_OPS, Conditional::NEGATE, Conditional::RELATION, Conditional::ZERO
Instance Attribute Summary
Attributes inherited from Processor
#bp, #pc, #refused_line, #registers, #sp
Class Method Summary collapse
-
.bits ⇒ Integer
Yap, bits.
Instance Method Summary collapse
-
#argument(idx) ⇒ Lambda, Integer
The value on the stack slot holding the +idx+-th argument.
-
#initialize ⇒ I386
constructor
Instantiate an I386 object.
Methods inherited from X86
Methods inherited from Processor
instruction_table, #instructions, line_memo, #parse, #process, #process!, #reach_terminal_call, #terminal_call?
Methods included from TrackedMemory
#bp_based_stack, #get_corresponding_stack, #resolve_address, #setup_frame_pointer, #sp_based_stack, #writes_through
Methods included from Constraints
#address_deref0?, #closed_fds, #constraint_key, #constraints, #drop_implied_nonzero, #drop_restated_null, #render_constraint
Methods included from Conditional
#branch_on_bit, #branch_on_compare, #branch_on_zero, #comparisons_on, #handle_compare, #mnemonic, #operand_str, #record_compare, #resolve_pending_branch, #satisfiable?, #value_str
Constructor Details
#initialize ⇒ I386
Instantiate an OneGadget::Emulators::I386 object.
19 20 21 |
# File 'lib/one_gadget/emulators/i386.rb', line 19 def initialize super(OneGadget::ABI.i386, 'esp', 'ebp', 'eip') end |
Class Method Details
.bits ⇒ Integer
Yap, bits.
13 14 15 |
# File 'lib/one_gadget/emulators/i386.rb', line 13 def bits 32 end |
Instance Method Details
#argument(idx) ⇒ Lambda, Integer
The value on the stack slot holding the +idx+-th argument. The slots are
relative to the esp the line sees, not the one the candidate was entered
with, so its offset is evaluated first.
28 29 30 31 |
# File 'lib/one_gadget/emulators/i386.rb', line 28 def argument(idx) cur_top = registers['esp'].evaluate('esp' => 0) sp_based_stack[cur_top + idx * 4] end |