Module: Rex::Arch::LoongArch64

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

Overview

LoongArch64 64-bit

Constant Summary collapse

R0 =

Register number constants

ZERO = 0
R1 =

constant 0 (hardwired zero)

RA = 1
R2 =

return address

SP = 2
R3 =

stack pointer

GP = 3
R4 =

global pointer

TP = 4
R5 =

thread pointer

T0 = 5
R6 =

temporary

T1 = 6
R7 =

temporary

T2 = 7
R8 =

temporary

T3 = 8
R9 =

temporary

T4 = 9
R10 =

temporary

T5 = 10
R11 =

temporary

T6 = 11
R12 =

temporary

T7 = 12
R13 =

temporary

T8 = 13
R14 =

temporary

T9 = 14
R15 =

temporary

T10 = 15
R16 =

temporary

T11 = 16
R17 =

temporary

T12 = 17
R18 =

temporary

T13 = 18
R19 =

temporary

T14 = 19
R20 =

temporary

T15 = 20
R21 =

temporary

T16 = 21
R22 =

temporary

T17 = 22
R23 =

temporary

T18 = 23
R24 =

temporary

T19 = 24
R25 =

temporary

T20 = 25
R26 =

temporary

T21 = 26
R27 =

temporary

T22 = 27
R28 =

temporary

T23 = 28
R29 =

temporary

FP = 29
R30 =

frame pointer

S0 = 30
R31 =

saved register

S1 = 31

Class Method Summary collapse

Class Method Details

._check_reg(*regs) ⇒ Boolean

Check if a provided number represents a valid register

Returns:

  • (Boolean)


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

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.



44
45
46
# File 'lib/rex/arch/loongarch64.rb', line 44

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