rdbo / libmem

Advanced Game Hacking Library for C, Modern C++, Rust and Python (Windows/Linux/FreeBSD) (Process/Memory Hacking) (Hooking/Detouring) (Cross Platform) (x86/x64/ARM/ARM64) (DLL/SO Injection) (Internal/External) (Assembler/Disassembler)
GNU Affero General Public License v3.0
784 stars 91 forks source link

Implement faster way of checking if process is alive (LM_IsProcessAlive) #80

Closed rdbo closed 1 year ago

rdbo commented 1 year ago

There's no need to enumerate every single process to do this. On *nix, you could check if the directory /proc/<pid> exists. If so, the process is alive. On Windows, you could try opening a handle. If the handle doesn't open, consider the process as dead. If the handle does open, check if it has an exit code. If not, the process is alive.

rdbo commented 1 year ago

Done: 6101a671ea77b9334216bf0fb1886d95cc5d1874