class OneGadget::Emulators::Amd64

Emulator of amd64 instruction set.

Public Class Methods

bits() click to toggle source

Bits.

# File lib/one_gadget/emulators/amd64.rb, line 12
def bits
  64
end
new() click to toggle source

Instantiate an {Amd64} object.

Calls superclass method
# File lib/one_gadget/emulators/amd64.rb, line 18
def initialize
  super(OneGadget::ABI.amd64, 'rsp', 'rip')
end

Public Instance Methods

argument(idx) click to toggle source

Return the argument value of calling a function. @param [Integer] idx @return [Lambda, Integer]

# File lib/one_gadget/emulators/amd64.rb, line 25
def argument(idx)
  case idx
  when 0 then registers['rdi']
  when 1 then registers['rsi']
  when 2 then registers['rdx']
  when 3 then registers['rcx']
  when 4 then registers['r8']
  when 5 then registers['r9']
  end
end