Internal Operations
Internal operations work within the same process where your code is running. These functions operate on the current process’s memory space directly.Characteristics
- Fast: Direct memory access without system calls
- No special permissions required: Operating within your own process
- Typical use case: Injected DLLs, shared libraries, or self-modification
Example Functions
LM_GetProcess()- Get information about the current processLM_ReadMemory()- Read from current process memoryLM_WriteMemory()- Write to current process memoryLM_FindModule()- Find a module in the current processLM_HookCode()- Hook a function in the current process
Internal operations are ideal when your code is running inside the target process, such as when developing game mods or plugins.
External Operations
External operations work across different processes. These functions allow you to manipulate another process’s memory from your application.Characteristics
- Process separation: Operate on a different process’s memory
- Requires elevated permissions: May need administrator/root privileges
- Typical use case: Trainers, debuggers, analysis tools
- Function naming: Identified by the
Exsuffix (e.g.,LM_ReadMemoryEx)
Example Functions
LM_GetProcessEx()- Get information about a target process by PIDLM_ReadMemoryEx()- Read from another process’s memoryLM_WriteMemoryEx()- Write to another process’s memoryLM_FindModuleEx()- Find a module in another processLM_HookCodeEx()- Hook a function in another process
External operations require you to pass a pointer to an
lm_process_t structure that identifies the target process.Function Naming Convention
The naming convention is consistent throughout libmem:| Mode | Function Pattern | Example |
|---|---|---|
| Internal | LM_FunctionName() | LM_ReadMemory() |
| External | LM_FunctionNameEx() | LM_ReadMemoryEx() |
Code Examples
Internal Operation Example
External Operation Example
When to Use Each Mode
Use Internal Operations When:
- Your code is injected into the target process
- Building plugins, mods, or extensions
- Maximum performance is required
- You have control over the target process
Use External Operations When:
- Building standalone trainers or cheats
- Creating debugging or analysis tools
- The target process cannot be modified
- You need to monitor or manipulate multiple processes
Most libmem APIs have both internal and external variants, providing flexibility for different use cases.