LM_FindSymbolAddress
Finds the address of a symbol within a module.Signature
Parameters
The module where the symbol will be looked up from.
The name of the symbol to look up.
Return Value
Returns the address of the symbol, orLM_ADDRESS_BAD if it fails.
Description
This function searches for a symbol by name within a specified module and returns its memory address. Symbols can represent functions, variables, or other exported identifiers within a module.Example
Common Use Cases
- Finding function addresses for hooking
- Locating exported functions in DLLs or shared libraries
- Getting addresses of global variables
- Resolving API entry points
Error Handling
LM_FindSymbolAddressDemangled
Finds the address of a demangled symbol within a module.Signature
Parameters
The module where the symbol will be looked up from.
The demangled name of the symbol to look up (e.g.,
"MyClass::myMethod()").Return Value
Returns the address of the symbol, orLM_ADDRESS_BAD if it fails.
Description
This function searches for a symbol using its demangled (human-readable) name and returns its memory address. This is particularly useful when working with C++ binaries where you want to search using the readable function signature instead of the mangled name.Example
Notes
- This function is specifically designed for C++ symbols where names are mangled by the compiler.
- You can provide the human-readable function signature (e.g.,
"ClassName::methodName(int, char*)") instead of the mangled name. - The function internally demangles all symbols in the module to find a match.
- This may be slower than
LM_FindSymbolAddressif you already know the mangled name. - If the symbol cannot be found or demangled,
LM_ADDRESS_BADis returned.
Comparison with LM_FindSymbolAddress
| Function | Input Name Format | Use Case |
|---|---|---|
LM_FindSymbolAddress | Mangled name (e.g., _ZN6Player10takeDamageEi) | When you know the exact mangled symbol name |
LM_FindSymbolAddressDemangled | Demangled name (e.g., Player::takeDamage(int)) | When you want to use readable C++ signatures |