module Cradare2::Util::Demangler

Overview

Demangler for Crystal, C++, and Rust symbol names, with full support for LLVM/MSVC PDB hex-escaped symbols, operator overloads, and generic types.

Defined in:

cradare2/util/demangler.cr

Constant Summary

MAX_CACHE_ENTRIES = 50000

Class Method Summary

Class Method Detail

def self.cache_size : Int32 #

Returns the number of cached demangled symbols.


[View source]
def self.clean_crystal_symbol(symbol : String) : String #

Cleans Crystal mangled names for human-readable display


[View source]
def self.clear_cache : Nil #

Clears the demangling cache.


[View source]
def self.decode_pdb_escapes(symbol : String) : String #

Decodes LLVM/MSVC PDB hex escapes such as: _2A. -> *, .3A. -> :, .23. -> #, .28. -> (, .29. -> ), .3C. -> <, .3E. -> >, .20. -> ' ', etc.


[View source]
def self.demangle(symbol : String, client : Transport::Base | Nil = nil) : String #

Demangles a symbol name. If an optional radare2 command runner is given, it can query radare2's built-in demangler (?m) for C++/Rust/MSVC symbols.


[View source]
def self.is_crystal_symbol?(symbol : String) : Bool #

Checks if symbol matches common Crystal mangled symbol conventions


[View source]
def self.is_mangled_native?(symbol : String) : Bool #

Checks if symbol looks like Itanium (_Z...) or MSVC (?...) mangled C++


[View source]
def self.parse_crystal_method(symbol : String) : Tuple(String, String, Bool) | Nil #

Parses a cleaned or mangled Crystal symbol into {class_name, method_name, is_instance_method} Returns nil if the symbol cannot be decomposed into a Crystal class and method.


[View source]
def self.strip_r2_prefixes(symbol : String) : String #

Strips common radare2 symbol prefixes (sym.imp., sym., pdb., sym.pdb.)


[View source]