class Cradare2::CrystalHelper

Overview

Crystal-specific binary analysis, memory layout inspection, and debugging tools.

Defined in:

cradare2/crystal.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(client : Client) #

[View source]

Instance Method Detail

def classes : Array(String) #

Discovers all distinct Crystal class, struct, and module names present in the binary.


[View source]
def client : Client #

[View source]
def crash_report : String #

Generates a detailed crash report with demangled Crystal stack traces, registers, and binary context.


[View source]
def crystal_binary? : Bool #

Returns true if the binary appears to be compiled with Crystal. Checks for the presence of __crystal_main, *Crystal::*, or Boehm GC symbols.


[View source]
def crystal_main_function : Model::Function | Nil #

Returns the __crystal_main function model if analyzed.


[View source]
def demangled_backtrace : Array(Model::StackFrame) #

Returns the current call stack with demangled Crystal function and class names.


[View source]
def entrypoint : UInt64 | Nil #

Returns the address of __crystal_main or entry function if found.


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

Returns all Boehm GC related functions found in the binary.


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

Returns all Boehm GC related symbols found in the binary.


[View source]
def methods_for_class(class_name : String) : Array(Model::Function) #

Finds all analyzed functions belonging to a given Crystal class name.


[View source]
def parse_symbol(symbol : String) : CrystalSymbolInfo #

Parses a Crystal symbol into its constituent class and method parts.


[View source]
def read_array_header(address : UInt64) : CrystalArrayHeader #

Inspects and reads a Crystal Array(T) header from memory at address.


[View source]
def read_slice_header(address : UInt64) : CrystalSliceHeader #

Inspects and reads a Crystal Slice(T) struct header from memory at address.


[View source]
def read_string(address : UInt64, max_bytes : Int32 = 1048576) : CrystalString #

Inspects and reads a Crystal String from memory at address.


[View source]
def read_string_value(address : UInt64, max_bytes : Int32 = 1048576) : String #

Convenience method to read just the UTF-8 String value of a Crystal String at address.


[View source]
def read_type_id(address : UInt64) : Int32 #

Reads the 4-byte type_id of a Crystal reference object at address.


[View source]
def symbols_for_class(class_name : String) : Array(Model::Symbol) #

Finds all symbols belonging to a given Crystal class name.


[View source]