Rizin
unix-like reverse engineering framework and cli tools
|
Go to the source code of this file.
Classes | |
struct | rz_demangler_plugin_t |
struct | rz_demangler_t |
Macros | |
#define | rz_demangler_plugin_demangle(x, y) ((x) && RZ_STR_ISNOTEMPTY(y) ? (x)->demangle(y) : NULL) |
Typedefs | |
typedef struct rz_demangler_plugin_t | RzDemanglerPlugin |
typedef struct rz_demangler_t | RzDemangler |
typedef bool(* | RzDemanglerIter) (const RzDemanglerPlugin *plugin, void *data) |
Functions | |
RZ_LIB_VERSION_HEADER (rz_demangler) | |
RZ_API RZ_OWN char * | rz_demangler_java (RZ_NULLABLE const char *symbol) |
Demangles java symbols. More... | |
RZ_API RZ_OWN char * | rz_demangler_cxx (RZ_NONNULL const char *symbol) |
Demangles c++ symbols. More... | |
RZ_API RZ_OWN char * | rz_demangler_objc (RZ_NONNULL const char *symbol) |
Demangles objc symbols. More... | |
RZ_API RZ_OWN char * | rz_demangler_rust (RZ_NONNULL const char *symbol) |
Demangles rust symbols. More... | |
RZ_API RZ_OWN char * | rz_demangler_msvc (RZ_NONNULL const char *symbol) |
Demangles microsft vc symbols. More... | |
RZ_API RZ_OWN RzDemangler * | rz_demangler_new (void) |
Initializes the plugin list and returns a RzDemangler struct. More... | |
RZ_API void | rz_demangler_free (RZ_NULLABLE RzDemangler *demangler) |
Frees the RzDemangler struct. More... | |
RZ_API void | rz_demangler_plugin_iterate (RZ_NONNULL RzDemangler *demangler, RZ_NONNULL RzDemanglerIter iter, RZ_NULLABLE void *data) |
Iterates over the plugin list. More... | |
RZ_API bool | rz_demangler_plugin_add (RZ_NONNULL RzDemangler *demangler, RZ_NONNULL RzDemanglerPlugin *plugin) |
Adds a new demangler plugin to the plugin list. More... | |
RZ_API RZ_BORROW const RzDemanglerPlugin * | rz_demangler_plugin_get (RZ_NONNULL RzDemangler *demangler, RZ_NONNULL const char *language) |
Returns a demangler plugin pointer based on the language that is found. More... | |
RZ_API bool | rz_demangler_resolve (RZ_NONNULL RzDemangler *demangler, RZ_NULLABLE const char *symbol, RZ_NONNULL const char *language, RZ_NONNULL RZ_OWN char **output) |
Resolves a symbol based on its language and return an output that needs to be freed. More... | |
#define rz_demangler_plugin_demangle | ( | x, | |
y | |||
) | ((x) && RZ_STR_ISNOTEMPTY(y) ? (x)->demangle(y) : NULL) |
Definition at line 29 of file rz_demangler.h.
typedef struct rz_demangler_t RzDemangler |
typedef bool(* RzDemanglerIter) (const RzDemanglerPlugin *plugin, void *data) |
Definition at line 27 of file rz_demangler.h.
typedef struct rz_demangler_plugin_t RzDemanglerPlugin |
RZ_API RZ_OWN char* rz_demangler_cxx | ( | RZ_NONNULL const char * | symbol | ) |
RZ_API void rz_demangler_free | ( | RZ_NULLABLE RzDemangler * | demangler | ) |
Frees the RzDemangler struct.
Definition at line 112 of file demangler.c.
References free(), and rz_list_free().
Referenced by rz_bin_free(), and rz_bin_new().
RZ_API RZ_OWN char* rz_demangler_java | ( | RZ_NULLABLE const char * | symbol | ) |
Demangles java symbols.
Definition at line 38 of file demangler.c.
References libdemangle_handler_java().
Referenced by classdump_java(), demangle_type(), rz_bin_demangle(), rz_bin_java_class_as_source_code(), rz_bin_java_class_const_pool_as_text(), rz_bin_java_class_methods_as_symbols(), and rz_cmd_javar_handler().
RZ_API RZ_OWN char* rz_demangler_msvc | ( | RZ_NONNULL const char * | symbol | ) |
Demangles microsft vc symbols.
Definition at line 74 of file demangler.c.
References libdemangle_handler_msvc().
Referenced by pdb_set_symbols(), rz_bin_demangle(), and rz_core_bin_pdb_gvars_as_string().
RZ_API RZ_OWN RzDemangler* rz_demangler_new | ( | void | ) |
Initializes the plugin list and returns a RzDemangler struct.
Definition at line 81 of file demangler.c.
References demangler_static_plugins, free(), i, NULL, p, rz_demangler_t::plugins, RZ_ARRAY_SIZE, rz_list_append(), rz_list_new(), RZ_LOG_WARN, RZ_NEW0, and rz_warn_if_fail.
Referenced by rz_bin_new().
RZ_API RZ_OWN char* rz_demangler_objc | ( | RZ_NONNULL const char * | symbol | ) |
Demangles objc symbols.
Definition at line 56 of file demangler.c.
References libdemangle_handler_objc().
Referenced by rz_bin_demangle().
RZ_API bool rz_demangler_plugin_add | ( | RZ_NONNULL RzDemangler * | dem, |
RZ_NONNULL RzDemanglerPlugin * | plugin | ||
) |
Adds a new demangler plugin to the plugin list.
If two plugins handles the same language, then the old plugin is removed.
Definition at line 144 of file demangler.c.
References rz_demangler_plugin_t::language, NULL, rz_list_append(), rz_list_delete(), rz_return_val_if_fail, and rz_warn_if_fail.
Referenced by __lib_demangler_cb().
RZ_API RZ_BORROW const RzDemanglerPlugin* rz_demangler_plugin_get | ( | RZ_NONNULL RzDemangler * | dem, |
RZ_NONNULL const char * | language | ||
) |
Returns a demangler plugin pointer based on the language that is found.
This function returns NULL only when the requested language is not available.
Definition at line 168 of file demangler.c.
References rz_demangler_plugin_t::language, NULL, rz_return_val_if_fail, and RZ_STR_ISNOTEMPTY.
Referenced by rz_main_rz_bin().
RZ_API void rz_demangler_plugin_iterate | ( | RZ_NONNULL RzDemangler * | dem, |
RZ_NONNULL RzDemanglerIter | iter, | ||
RZ_NULLABLE void * | data | ||
) |
Iterates over the plugin list.
Iterates over the plugin list and passes a RzDemanglerPlugin pointer to the iter function; if the iter function returns false, then the iteration is halted.
Definition at line 127 of file demangler.c.
References rz_return_if_fail.
Referenced by rz_cmd_info_demangle_handler(), rz_cmd_info_demangle_list_handler(), and rz_main_rz_bin().
RZ_API bool rz_demangler_resolve | ( | RZ_NONNULL RzDemangler * | dem, |
RZ_NULLABLE const char * | symbol, | ||
RZ_NONNULL const char * | language, | ||
RZ_NONNULL RZ_OWN char ** | output | ||
) |
Resolves a symbol based on its language and return an output that needs to be freed.
This function fails only when the requested language is not available.
Definition at line 187 of file demangler.c.
References rz_demangler_plugin_t::demangle, rz_demangler_plugin_t::language, NULL, output, rz_return_val_if_fail, and RZ_STR_ISEMPTY.
Referenced by rz_bin_demangle(), and rz_cmd_info_demangle_handler().
RZ_API RZ_OWN char* rz_demangler_rust | ( | RZ_NONNULL const char * | symbol | ) |
Demangles rust symbols.
Definition at line 63 of file demangler.c.
References libdemangle_handler_rust(), and NULL.
RZ_LIB_VERSION_HEADER | ( | rz_demangler | ) |