module Ronin::ASM::Archs::X86

Contains X86 Archtecture information.

Constants

REGISTERS

X86 registers

WORD_SIZE

Default word size

Public Instance Methods

interrupt(number) click to toggle source

Generates the instruction to trigger an interrupt.

# File lib/ronin/asm/archs/x86.rb, line 84
def interrupt(number); instruction(:int,number); end
register_clear(name) click to toggle source

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
register_load(name) click to toggle source

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
register_save(name) click to toggle source

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
register_set(name,value) click to toggle source

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
stack_base() click to toggle source

The Stack Base Pointer register.

@see ebp

# File lib/ronin/asm/archs/x86.rb, line 96
def stack_base; ebp; end
stack_pointer() click to toggle source

The Stack Pointer register.

@see esp

# File lib/ronin/asm/archs/x86.rb, line 103
def stack_pointer; esp; end
stack_pop(op) click to toggle source

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
stack_push(op) click to toggle source

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
syscall() click to toggle source

Generates the instruction to invoke a syscall.

# File lib/ronin/asm/archs/x86.rb, line 89
def syscall; interrupt(0x80); end