class Cradare2::Client

Overview

The central client representing an open radare2 session.

Defined in:

cradare2/client.cr
cradare2/dsl/disasm.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(transport : Transport::Base) #

[View source]

Instance Method Detail

def all_strings : Array(Model::StringItem) #

Returns strings from the entire binary (izzj).


[View source]
def analyze : DSL::Analysis #

Access the Analysis DSL. Supports fluent chaining or block syntax.


[View source]
def analyze(&block : DSL::Analysis -> ) : self #

[View source]
def close : Nil #

Closes the radare2 session.


[View source]
def closed? : Bool #

Returns true if the session is closed.


[View source]
def cmd(command : String) : String #

Executes a command string in radare2 and returns the raw output string.


[View source]
def cmdj(command : String, as type : T.class) : T forall T #

Executes a command and deserializes the JSON string into the specified type T.


[View source]
def cmdj(command : String) : JSON::Any #

Executes a command and parses the returned JSON string as JSON::Any.


[View source]
def crystal : CrystalHelper #

Access the Crystal binary analysis and memory inspection helper.


[View source]
def crystal(&block : CrystalHelper -> ) : self #

[View source]
def current_offset : UInt64 #

Returns the current seek position / offset.


[View source]
def debug : DSL::Debugger #

Access the Debugger DSL. Supports fluent chaining or block syntax.


[View source]
def debug(&block : DSL::Debugger -> ) : self #

[View source]
def demangle(symbol : String) : String #

Demangles a symbol using radare2 and internal caching.


[View source]
def disasm : DSL::Disassembly #

Access the Disassembly DSL.


[View source]
def exports : Array(Model::Export) #

Returns exported symbols (iEj).


[View source]
def exports_matching(pattern : Regex | String) : Array(Model::Export) #

Filters exports matching a substring or regex pattern.


[View source]
def find_function(name : String) : Model::Function | Nil #

Finds a specific function by name.


[View source]
def find_symbol(name : String) : Model::Symbol | Nil #

Finds a specific symbol by name or display name.


[View source]
def functions : Array(Model::Function) #

Returns analyzed functions (aflj).


[View source]
def functions_matching(pattern : Regex | String) : Array(Model::Function) #

Filters functions matching a substring or regex pattern.


[View source]
def imports : Array(Model::Import) #

Returns imported symbols (iij).


[View source]
def imports_matching(pattern : Regex | String) : Array(Model::Import) #

Filters imports matching a substring or regex pattern.


[View source]
def info : Model::BinaryInfo #

Returns binary metadata (ij).


[View source]
def memory : DSL::Memory #

Access the Memory DSL.


[View source]
def memory(&block : DSL::Memory -> ) : self #

[View source]
def quit : Nil #

Alias for close.


[View source]
def sections : Array(Model::Section) #

Returns binary sections (iSj).


[View source]
def security : Model::SecurityInfo #

Evaluates binary security mitigations (ASLR, DEP/NX, Stack Canary, Relocations).


[View source]
def seek(target : UInt64 | Int32 | Int64 | String) : self #

Seeks to the specified target address or symbol (s ).


[View source]
def strings : Array(Model::StringItem) #

Returns strings in data sections (izj).


[View source]
def strings_matching(query : String) : Array(Model::StringItem) #

Filters strings matching a substring.


[View source]
def symbols : Array(Model::Symbol) #

Returns all symbols in the binary (isj).


[View source]
def symbols_matching(pattern : Regex | String) : Array(Model::Symbol) #

Filters symbols matching a substring or regex pattern.


[View source]
def transport : Transport::Base #

[View source]
def xrefs_from(address : UInt64 | Int32 | Int64 | String) : Array(Model::Xref) #

Returns cross-references originating from the specified address or symbol (axfj @ ).


[View source]
def xrefs_to(address : UInt64 | Int32 | Int64 | String) : Array(Model::Xref) #

Returns cross-references targeting the specified address or symbol (axtj @ ).


[View source]