Module Rex::Arch::X86
In: lib/rex/arch/x86.rb

everything here is mostly stole from vlad‘s perl x86 stuff

Methods

Constants

EAX = AL = AX = ES = 0   Register number constants
ECX = CL = CX = CS = 1
EDX = DL = DX = SS = 2
EBX = BL = BX = DS = 3
ESP = AH = SP = FS = 4
EBP = CH = BP = GS = 5
ESI = DH = SI = 6
EDI = BH = DI = 7

Public Class methods

This method generates the opcodes equivalent to subtracting with a negative value from a given register.

This method adjusts the value of the ESP register by a given amount.

This method returns the opcodes that compose a relative call instruction to the address specified.

This method generates an instruction that clears the supplied register in a manner that attempts to avoid bad characters, if supplied.

Generates a buffer that will copy memory immediately following the stub that is generated to be copied to the stack

This method adds/subs a packed long integer

This method generates the encoded effective value for a register.

This method generates the mod r/m character for a source and destination register.

This method returns an array of ‘safe’ FPU instructions

This method returns an array containing a geteip stub, a register, and an offset This method will return nil if the getip generation fails

This method returns the opcodes that compose a jump instruction to the supplied relative offset.

Jump tp a specific register

This method returns the opcodes that compose a short jump instruction to the supplied relative offset.

This method generates the opcodes that set the low byte of a given register to the supplied value.

This method generates the opcodes that set the a register to the supplied value.

This method generates the opcodes that set the low word of a given register to the supplied value.

This method wrappers packing an integer as a little-endian buffer.

This method returns the least significant byte of a packed dword.

This method generates a pop dword instruction into a register.

This method generates a push byte instruction.

This method generates a push dword instruction.

This method returns the register named associated with a given register number.

This method returns the number associated with a named register.

This method returns a number offset to the supplied string.

This method returns the opcodes that compose a tag-based search routine

This method is a general way of setting a register to a value. Depending on the value supplied, different sets of instructions may be used.

TODO: Make this moderatly intelligent so it chain instructions by itself

  (ie. xor eax, eax + mov al, 4 + xchg ah, al)

Builds a subtraction instruction using the supplied operand and register.

[Validate]