class Cradare2::Gdb::Client

Overview

Lightweight, standalone GDB Remote Serial Protocol (RSP) client over TCP. Allows zero-dependency memory querying, register inspection, and hardware canary checks directly against PCSX2, QEMU, or gdbserver without spawning a radare2 process.

Defined in:

cradare2/gdb/client.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(host : String = "127.0.0.1", port : Int32 = 1234) #

[View source]

Class Method Detail

def self.calculate_checksum(payload : String) : UInt8 #

Computes the 8-bit modulo 256 checksum for a GDB RSP payload.


[View source]
def self.format_packet(payload : String) : String #

Formats a command string into a complete GDB packet with start mark '$' and checksum.


[View source]

Instance Method Detail

def close : Nil #

Closes the connection.


[View source]
def connect : Bool #

Connects to the remote GDB stub.


[View source]
def connected? : Bool #

Returns true if the client socket is active.


[View source]
def host : String #

[View source]
def port : Int32 #

[View source]
def read_memory(address : UInt64, length : Int32) : Bytes | Nil #

Reads memory of length bytes from target address.


[View source]
def read_u128(address : UInt64, format : IO::ByteFormat = IO::ByteFormat::LittleEndian) : UInt128 | Nil #

Reads a 128-bit integer (PS2 EE QWORD) directly from memory.


[View source]
def read_u32(address : UInt64, format : IO::ByteFormat = IO::ByteFormat::LittleEndian) : UInt32 | Nil #

Reads a 32-bit integer directly from memory.


[View source]
def read_u64(address : UInt64, format : IO::ByteFormat = IO::ByteFormat::LittleEndian) : UInt64 | Nil #

Reads a 64-bit integer directly from memory.


[View source]
def send_command(payload : String) : String #

Sends a command payload and reads the response packet.


[View source]
def socket : TCPSocket | Nil #

[View source]