ProcMemInterface.dll (64 & 32-bit)ProcMemInterface is one of my foundations for making quick game trainers since early 2020.
CreateCave(uintptr_t TargetPtr, SIZE_T AllocSize)
WriteMem(bool AddBaseAddr, uintptr_t WriteAddr, unsigned char* WriteBuf, SIZE_T BufSize)
ReadMem(bool AddBaseAddr, uintptr_t ReadAddr, unsigned char* ReadBuf, SIZE_T BufSize)
PrepProcess(const wchar_t* ExeProcessFileName)
AobScan(const unsigned char* Pattern, const char* Mask)
GetModBaseAddr(const wchar_t* NameOfModule, bool EndAddrInsteadOfBaseAddr)
Where the last one, SmartHook, is the heart and motivation of the project.
While the other functions are also exported and can be used for manual hooking.
Process handle and debug rights is automatically sorted by PrepProcess().
Multithreaded and optimized memory scanning added late April 2020
Resulting in very fast AOB search results (w/mask), e.g. when turning hacks on and off.
Even in modern games (32 & 64-bit) with very large data allocations (4GB+ RAM usage).
General InformationMade for C# GUI projects.
I called it "Smart" hooking because it does a few things automagically that saves me time and effort from having to redo jump and hook management manually every time I want to hack a game. It remembers addresses for jumps and caves as well as original bytes that was replaced in an internal register so it can turn hooks on/off easily. The register supports up to 100 hacks by default. An arbitrary number, easily adjusted.
It will automatically scan the entire game (and its modules) for AOB patterns and register these locations for instant use thereafter. It always reuses individual code caves. It automatically calculates near E9 jumps from/back between hooks and caves, and makes sure the jump is never more than 32-bit long, even in 64-bit processes (Code caves generated from CE may have multiple short 5-byte jumps, this means we would be risking the skew of byte count if replacing return jumps with 64-bit/near 12-14 byte jumps, unnecessarily complicating things. So it sticks strictly to 32-bit near jumps, with guaranteed integrity.)Posted for reference. Most of my trainers will include this library for direct usage.
Updated May 3rd, 2020. (Fixed automatic restoration of original bytes when heavily relying on AOB mask wildcards.)
SHA-1 Signature: ADCFBBA4A34EB2AEB29A2154A5F41ECF9706DD9C
SHA-1 Signature: E7467F3D0EDDEC3E48EBDCA08C0B56FA97D8987D
Files are digitally signed by Dag J Nedrelid (also when dynamically created from trainers).