Module: Rex::Arch::AMD64
- Defined in:
- lib/rex/arch/amd64.rb
Overview
AMD64 (x86_64) 64-bit
Constant Summary collapse
- RAX =
Register number constants
EAX = AX = AH = AL = 0
- RBX =
accumulator
EBX = BX = BH = BL = 1
- RCX =
base
ECX = CX = CH = CL = 2
- RDX =
counter
EDX = DX = DH = DL = 3
- RSI =
data
ESI = SI = 4
- RDI =
source index
EDI = DI = 5
- RBP =
destination index
EBP = BP = 6
- RSP =
base pointer
ESP = SP = 7
- R8 =
stack pointer
R8D = R8W = R8B = 8
- R9 =
extended register
R9D = R9W = R9B = 9
- R10 =
R10D = R10W = R10B = 10
- R11 =
R11D = R11W = R11B = 11
- R12 =
R12D = R12W = R12B = 12
- R13 =
R13D = R13W = R13B = 13
- R14 =
R14D = R14W = R14B = 14
- R15 =
R15D = R15W = R15B = 15
Class Method Summary collapse
-
._check_reg(*regs) ⇒ Boolean
Check if a provided number represents a valid register.
-
.reg_number(str) ⇒ Object
The number associated with a named register.
Class Method Details
._check_reg(*regs) ⇒ Boolean
Check if a provided number represents a valid register
34 35 36 37 38 39 40 |
# File 'lib/rex/arch/amd64.rb', line 34 def self._check_reg(*regs) regs.each do |reg| raise ArgumentError, "Invalid register #{reg}", caller if reg > 15 || reg < 0 end nil end |
.reg_number(str) ⇒ Object
Returns the number associated with a named register.
28 29 30 |
# File 'lib/rex/arch/amd64.rb', line 28 def self.reg_number(str) const_get(str.upcase) end |