Module: Rex::Arch::ZArch

Defined in:
lib/rex/arch/zarch.rb

Overview

z/Arch 64-bit

Constant Summary collapse

R0 =

Register number constants

0
R1 =

general purpose, often scratch

1
R2 =

general purpose, sometimes function arg

2
R3 =

function argument / return value

3
R4 =

function argument

4
R5 =

function argument

5
R6 =

function argument

6
R7 =

function argument

7
R8 =

function argument

8
R9 =

callee-saved / local variable

9
R10 =

callee-saved / local variable

10
R11 =

callee-saved / local variable

11
R12 =

callee-saved / local variable

12
R13 =

callee-saved / local variable

13
R14 =

callee-saved / local variable

LR = 14
R15 =

link register (return address)

SP = 15

Class Method Summary collapse

Class Method Details

._check_reg(*regs) ⇒ Boolean

Check if a provided number represents a valid register

Returns:

  • (Boolean)


34
35
36
37
38
39
40
# File 'lib/rex/arch/zarch.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.

Returns:

  • the number associated with a named register



28
29
30
# File 'lib/rex/arch/zarch.rb', line 28

def self.reg_number(str)
  const_get(str.upcase)
end