Overview
The Find Module APIs allow you to search for a specific module (library/DLL) by name and retrieve its information. You can search by exact name or relative path.lm_module_t Structure
Thelm_module_t structure contains information about a loaded module:
Fields
Base address where the module is loaded in memory
End address of the module in memory
Total size of the module in bytes
Full file system path to the module
Name of the module (filename)
LM_FindModule
Finds a module by name and populates themodule_out parameter with the found module information.
Signature
Parameters
The name of the module to find (e.g
game.dll). It can also be a relative path, such as /game/hello for a module at /usr/share/game/hello.A pointer to a
lm_module_t structure. This function populates this structure with information about the found module, containing information such as base, end, size, path and name.Returns
ReturnsLM_TRUE if the module is found successfully, otherwise it returns LM_FALSE.
Example
LM_FindModuleEx
Finds a module by name in a specified process and populates themodule_out parameter with the found module information.
Signature
Parameters
The process that the module will be searched in.
The name of the module to find (e.g
game.dll). It can also be a relative path, such as /game/hello for a module at /usr/share/game/hello.A pointer to a
lm_module_t structure. This function populates this structure with information about the found module, containing information such as base, end, size, path and name.Returns
ReturnsLM_TRUE if the module is found successfully, otherwise it returns LM_FALSE.
Example
Usage with Relative Paths
Both functions support relative path matching, which is useful when the full path is too long or when you want to match modules in subdirectories:See Also
- Enumerate Modules - Enumerate all modules in a process
- Load Module - Load a module into a process
- Unload Module - Unload a module from a process