struct
Cradare2::Model::Registers
- Cradare2::Model::Registers
- Struct
- Value
- Object
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
- JSON::Serializable
Defined in:
cradare2/models/register.crConstructors
- .new(pull : JSON::PullParser)
-
.new(registers : Hash(String, UInt64) = Hash(String, UInt64).new)
For direct instantiation in tests/mocks
- .new(*, __pull_for_json_serializable pull : JSON::PullParser)
Instance Method Summary
-
#[](name : String) : UInt64
Fetches any register by name (case-insensitive)
-
#[]?(name : String) : UInt64 | Nil
Safe lookup returning nil if register is absent
-
#all_registers : Hash(String, UInt64)
Returns all captured registers
-
#bp : UInt64
Architecture-neutral Frame/Base Pointer (RBP on x64, EBP on x86, FP on ARM)
- #eax : UInt64
- #ebp : UInt64
- #ebx : UInt64
- #ecx : UInt64
- #edi : UInt64
- #edx : UInt64
-
#eflags : UInt64
Flags
-
#eip : UInt64
x86 (32-bit) registers
- #esi : UInt64
- #esp : UInt64
-
#pc : UInt64
Architecture-neutral Instruction Pointer (RIP on x64, EIP on x86, PC on ARM)
- #r10 : UInt64
- #r11 : UInt64
- #r12 : UInt64
- #r13 : UInt64
- #r14 : UInt64
- #r15 : UInt64
- #r8 : UInt64
- #r9 : UInt64
- #rax : UInt64
- #rbp : UInt64
- #rbx : UInt64
- #rcx : UInt64
- #rdi : UInt64
- #rdx : UInt64
-
#rip : UInt64
x86_64 registers with 32-bit and ARM fallbacks
- #rsi : UInt64
- #rsp : UInt64
-
#sp : UInt64
Architecture-neutral Stack Pointer (RSP on x64, ESP on x86, SP on ARM)
-
#values : Hash(String, UInt64)
Captures all key-value registers from the JSON payload
Constructor Detail
For direct instantiation in tests/mocks