LM_EnumSymbols
Enumerates symbols in a module and calls a callback function for each symbol found.Signature
Parameters
The module where the symbols will be enumerated from.
A function pointer that will receive each symbol in the enumeration and an extra argument.
The callback function should return
LM_TRUE to continue the enumeration or LM_FALSE to stop it.Callback Signature:A pointer to user-defined data that can be passed to the callback function.
It allows you to provide additional information or context.
Return Value
ReturnsLM_TRUE if the enumeration succeeds, LM_FALSE otherwise.
Symbol Structure
Thelm_symbol_t structure contains the following fields:
The name of the symbol.
The memory address of the symbol.
Example
LM_EnumSymbolsDemangled
Enumerates symbols in a module with demangled names and calls a provided callback function for each symbol found.Signature
Parameters
The module where the symbols will be enumerated from.
A function pointer that will receive each demangled symbol in the enumeration and an extra argument.
The callback function should return
LM_TRUE to continue the enumeration or LM_FALSE to stop it.Callback Signature:A pointer to user-defined data that can be passed to the callback function.
It allows you to provide additional information or context.
Return Value
ReturnsLM_TRUE if the enumeration succeeds, LM_FALSE otherwise.
Description
This function works similarly toLM_EnumSymbols, but automatically demangles C++ symbol names to their human-readable form. This is particularly useful when working with C++ binaries where symbol names are mangled by the compiler.
Example
Notes
- This function is particularly useful for C++ libraries where mangled names like
_ZN3foo3barEvare automatically converted to readable forms likefoo::bar(). - The demangling process may add some overhead compared to
LM_EnumSymbols. - If a symbol cannot be demangled, it will be returned in its mangled form.