Class: OneGadget::Emulators::Amd64
- Defined in:
- lib/one_gadget/emulators/amd64.rb
Overview
Emulator of amd64 instruction set.
Instance Attribute Summary
Attributes inherited from X86
Attributes inherited from Processor
#pc, #registers, #sp, #sp_based_stack
Class Method Summary collapse
-
.bits ⇒ Object
Bits.
Instance Method Summary collapse
-
#argument(idx) ⇒ Lambda, Integer
Return the argument value of calling a function.
-
#initialize ⇒ Amd64
constructor
Instantiate an Amd64 object.
Methods inherited from X86
#get_corresponding_stack, #instructions, #process!
Methods inherited from Processor
#constraints, #get_corresponding_stack, #instructions, #parse, #process, #process!
Constructor Details
#initialize ⇒ Amd64
Instantiate an OneGadget::Emulators::Amd64 object.
18 19 20 |
# File 'lib/one_gadget/emulators/amd64.rb', line 18 def initialize super(OneGadget::ABI.amd64, 'rsp', 'rbp', 'rip') end |
Class Method Details
.bits ⇒ Object
Bits.
12 13 14 |
# File 'lib/one_gadget/emulators/amd64.rb', line 12 def bits 64 end |
Instance Method Details
#argument(idx) ⇒ Lambda, Integer
Return the argument value of calling a function.
25 26 27 28 29 30 31 32 33 34 |
# 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 |