ProcMemInterface.dll (64 & 32-bit)ProcMemInterface is one of my foundations for making quick game trainers.
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().
VirusTotal, April 1st 2020.
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 in an internal register up to 1000 by default, as well as original bytes that was replaced so it can turn hooks on/off easily.
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.)
[ Gated Project Download ] (includes the following sample C# trainer projects: ARK, Far Cry 5, 7 Days to Die, and documented code.)