struct Cradare2::Model::Registers

Overview

Represents CPU registers returned by radare2 drj. Provides architecture-agnostic helpers for instruction pointer and stack pointer, as well as named accessors for x86/x64/ARM registers.

Included Modules

Defined in:

cradare2/models/register.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(registers : Hash(String, UInt64) = Hash(String, UInt64).new) #

For direct instantiation in tests/mocks


[View source]
def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

[View source]

Instance Method Detail

def [](name : String) : UInt64 #

Fetches any register by name (case-insensitive)


[View source]
def []?(name : String) : UInt64 | Nil #

Safe lookup returning nil if register is absent


[View source]
def all_registers : Hash(String, UInt64) #

Returns all captured registers


[View source]
def bp : UInt64 #

Architecture-neutral Frame/Base Pointer (RBP on x64, EBP on x86, FP on ARM)


[View source]
def eax : UInt64 #

[View source]
def ebp : UInt64 #

[View source]
def ebx : UInt64 #

[View source]
def ecx : UInt64 #

[View source]
def edi : UInt64 #

[View source]
def edx : UInt64 #

[View source]
def eflags : UInt64 #

Flags


[View source]
def eip : UInt64 #

x86 (32-bit) registers


[View source]
def esi : UInt64 #

[View source]
def esp : UInt64 #

[View source]
def pc : UInt64 #

Architecture-neutral Instruction Pointer (RIP on x64, EIP on x86, PC on ARM)


[View source]
def r10 : UInt64 #

[View source]
def r11 : UInt64 #

[View source]
def r12 : UInt64 #

[View source]
def r13 : UInt64 #

[View source]
def r14 : UInt64 #

[View source]
def r15 : UInt64 #

[View source]
def r8 : UInt64 #

[View source]
def r9 : UInt64 #

[View source]
def rax : UInt64 #

[View source]
def rbp : UInt64 #

[View source]
def rbx : UInt64 #

[View source]
def rcx : UInt64 #

[View source]
def rdi : UInt64 #

[View source]
def rdx : UInt64 #

[View source]
def rip : UInt64 #

x86_64 registers with 32-bit and ARM fallbacks


[View source]
def rsi : UInt64 #

[View source]
def rsp : UInt64 #

[View source]
def sp : UInt64 #

Architecture-neutral Stack Pointer (RSP on x64, ESP on x86, SP on ARM)


[View source]
def values : Hash(String, UInt64) #

Captures all key-value registers from the JSON payload


[View source]