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
764 stars 92 forks source link

Improve thread APIs #113

Closed rdbo closed 1 year ago

rdbo commented 1 year ago

The thread APIs seem kind of useless as of now. You get a thread ID, then what? Not much you can do. I'm thinking of something like LM_GetProcessFromThread, which would actually be useful (especially on *nix, where threads are different processes) And then I would start using a struct lm_thread_t instead of lm_tid_tbecause I learned the hard way that using only an identifier is not a good idea, maybe I have to pass more information in a later version of libmem and suddenly I have to redesign the whole library. Windows has GetProcessIdOfThread which I could use to retrieve a handle and get process information. On Linux/FreeBSD, threads IDs are the same as process IDs, so I would just get information as if it were a PID.

rdbo commented 1 year ago

Done: from 115e8e3d6dc0b8f944cee4528eae965089cdaae1 to e34008ef28267f43b9b6a2486be570df7983e9be