module Ronin::ASM::Archs::X86
Contains X86
Archtecture information.
Constants
- REGISTERS
X86
registers- WORD_SIZE
Default word size
Public Instance Methods
Generates the instruction to trigger an interrupt.
# File lib/ronin/asm/archs/x86.rb, line 84 def interrupt(number); instruction(:int,number); end
Generates the instruction to clear a register.
@param [Symbol] name
The name of the register.
# File lib/ronin/asm/archs/x86.rb, line 127 def register_clear(name) instruction(:xor,register(name),register(name)) end
Generates the instruction to restore a register.
@param [Symbol] name
The name of the register.
# File lib/ronin/asm/archs/x86.rb, line 160 def register_load(name) stack_pop(register(name)) end
Generates the instruction to save a register.
@param [Symbol] name
The name of the register.
# File lib/ronin/asm/archs/x86.rb, line 150 def register_save(name) stack_push(register(name)) end
Generates the instruction to set a register.
@param [Symbol] name
The name of the register.
@param [ImmediateOperand, MemoryOperate, Register
, Integer, Symbol] value
The value to set.
# File lib/ronin/asm/archs/x86.rb, line 140 def register_set(name,value) instruction(:mov,value,register(name)) end
The Stack Base Pointer register.
@see ebp
# File lib/ronin/asm/archs/x86.rb, line 96 def stack_base; ebp; end
The Stack Pointer register.
@see esp
# File lib/ronin/asm/archs/x86.rb, line 103 def stack_pointer; esp; end
Generates the instruction to pop a value off of the Stack.
@param [Register] op
The register operand to store the value.
# File lib/ronin/asm/archs/x86.rb, line 119 def stack_pop(op); instruction(:pop,op); end
Generates the instruction to push a value onto the Stack.
@param [ImmediateOperand, MemoryOperate, Register
, Integer, Symbol] op
The value.
# File lib/ronin/asm/archs/x86.rb, line 111 def stack_push(op); instruction(:push,op); end
Generates the instruction to invoke a syscall.
# File lib/ronin/asm/archs/x86.rb, line 89 def syscall; interrupt(0x80); end