class OneGadget::Emulators::I386
Emulator of amd64 instruction set.
Public Class Methods
bits()
click to toggle source
Yap, bits.
# File lib/one_gadget/emulators/i386.rb, line 12 def bits 32 end
new()
click to toggle source
Instantiate an {I386} object.
Calls superclass method
# File lib/one_gadget/emulators/i386.rb, line 18 def initialize super(OneGadget::ABI.i386, 'esp', 'eip') end
Public Instance Methods
argument(idx)
click to toggle source
Get function call arguments.
For i386 this is a little bit tricky. We need to fetch the stack slots reference to current ‘esp’ but not original ‘esp’. So we need to evaluate the offset of current esp first. @param [Integer] idx @return [Lambda, Integer]
# File lib/one_gadget/emulators/i386.rb, line 30 def argument(idx) cur_top = registers['esp'].evaluate('esp' => 0) stack[cur_top + idx * 4] end