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) (DLL/SO Injection) (Internal/External) (Assembler/Disassembler)
GNU Affero General Public License v3.0
812 stars 98 forks source link

*nix: don't read the whole files at once #27

Closed rdbo closed 1 year ago

rdbo commented 1 year ago

It would be more optimized to read a section of the /proc/<pid>/maps file at a time and parse it; if the results were found, free the buffer and return; else, just read once again. This might be applicable to other files, such as /proc/<pid>/status, but since they're not so big, it might not be necessary for performance increase. Instead, it might be a good idea to read until the end of life and pass the read line to a function.

rdbo commented 1 year ago

Done: from 1ec4676d3ee51124e2d435ade3ed0d1f79caa7d5 to 1a48c2535d3a449073871887806f88b117532a19