Description
Searches for a process by name and returns whether the process was found or not. This is a convenient alternative to manually enumerating all processes withLM_EnumProcesses.
Function Signature
Parameters
The name of the process you are trying to find (e.g.,
"game.exe"). It can also be a relative path, such as /game/hello for a process at /usr/share/game/hello.Note: lm_string_t is defined as const char *A pointer to the
lm_process_t structure that will be populated with information about the found process.Return Value
Returns
LM_TRUE if the process with the specified name was found successfully, or LM_FALSE otherwise.Process Structure
Theprocess_out parameter is populated with the following structure:
Examples
Find Process by Exact Name
Find Process by Relative Path
Monitor Target Process
Cross-Platform Process Finding
Name Matching Behavior
- Exact name:
"game.exe"matches only processes namedgame.exe - Relative path:
"/bin/sh"matches any process whose path ends with/bin/sh - Case sensitivity: Depends on the operating system (case-sensitive on Linux, case-insensitive on Windows)
- First match: If multiple processes have the same name, the first one found is returned
Notes
- This function internally uses
LM_EnumProcessesto search for the process - If multiple processes have the same name, only the first match is returned
- The process must be running at the time of the call
- On some systems, you may need elevated privileges to find all processes
- Use
LM_IsProcessAliveto verify the process is still running after finding it - For more control over the search, use
LM_EnumProcesseswith a custom callback
Common Use Cases
- Process injection: Find target process before injecting a DLL
- Process monitoring: Check if a specific application is running
- Game hacking: Locate game process for memory manipulation
- Anti-cheat bypass: Detect if anti-cheat processes are running
- Automation: Wait for a specific process to start before performing actions
See Also
- LM_EnumProcesses - Enumerate all processes with custom callback
- LM_GetProcess - Get information about the current process
- LM_GetProcessEx - Get information about a process by PID
- LM_IsProcessAlive - Check if a process is still alive