Module: Rex::Arch::AArch64

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

Overview

AArch64 64-bit

Constant Summary collapse

X0 =

Register number constants

W0 = 0
X1 =

function arg / return value

W1 = 1
X2 =

function arg / return value

W2 = 2
X3 =

function arg

W3 = 3
X4 =

function arg

W4 = 4
X5 =

function arg

W5 = 5
X6 =

function arg

W6 = 6
X7 =

function arg

W7 = 7
X8 =

function arg

W8 = 8
X9 =

indirect result location (a.k.a. “indirect result” / sometimes “XR”)

W9 = 9
X10 =

temporary

W10 = 10
X11 =

temporary

W11 = 11
X12 =

temporary

W12 = 12
X13 =

temporary

W13 = 13
X14 =

temporary

W14 = 14
X15 =

temporary

W15 = 15
X16 =

temporary

W16 = 16
X17 =

intra-procedure call scratch (IP0)

W17 = 17
X18 =

intra-procedure call scratch (IP1)

W18 = 18
X19 =

platform register (reserved by OS)

W19 = 19
X20 =

callee-saved

W20 = 20
X21 =

callee-saved

W21 = 21
X22 =

callee-saved

W22 = 22
X23 =

callee-saved

W23 = 23
X24 =

callee-saved

W24 = 24
X25 =

callee-saved

W25 = 25
X26 =

callee-saved

W26 = 26
X27 =

callee-saved

W27 = 27
X28 =

callee-saved

W28 = 28
X29 =

callee-saved

W29 = FP = 29
X30 =

frame pointer

W30 = LR = 30
SP =

link register (return address)

31
XZR =

stack pointer (shares encoding with XZR/WZR)

WZR = 31

Class Method Summary collapse

Class Method Details

._check_reg(*regs) ⇒ Boolean

Check if a provided number represents a valid register

Returns:

  • (Boolean)


51
52
53
54
55
56
57
# File 'lib/rex/arch/aarch64.rb', line 51

def self._check_reg(*regs)
  regs.each do |reg|
    raise ArgumentError, "Invalid register #{reg}", caller if reg > 31 || 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



45
46
47
# File 'lib/rex/arch/aarch64.rb', line 45

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