Standard hacking case. Hack injects into a started game process and writes over process memory using WriteProcessMemory call.
The situation is like this:
- we are hosting a game server
- clients join the server with their games, they can corrupt their games using various hacks
- we have no chance to change game source, it is as is. However we do have a possibility to enforce our program to be run before client can join the server.
So to put this clear: we can't obfuscate game memory but we do have a possibility to run a seperate program at the same time. I already tried to use a call EnumProcessModules which lists all process DLLs with no success. It seems to me that the hacks inject directly into process memory, therefore it is undetected. After doing a lot of "google research" I came down to a few options:
scan for running process names, files in game directory, byte patterns of files, byte patterns of running processes... this task is very time consuming since I'd have to get samples of all avalible hacks and update our program every time new one come sout. All hack information needs to be stored inside the source which can make the program very big.
Using ReadProcessMemory to monitor the changes in well known memory offsets (hacks usually use the same offsets to achieve something). I would need to run a few hacks, monitor the behaviour and get samples of hack behaviour when comparing to normal run. The program would basicaly do the same thing hacks do but in reverse.
detect WriteProcessMemory call inside memory. I am not sure if this would bring some false positives from legit DLLs but idea seems interesting. How would I scan the process memory for this call? How to get the byte value of it?
This is an example of a hack call:
The offset is actually fixed at least in low-level hacks. If we could somehow rearrange the stack or push it down somehow it could already mess up the hack to crash the game.
A few more facts:
- new hacks are rarely published and there is a fixed number of those that are publicly avalible and actually work. Most of them also work in a similar way.
- goal is to either detect the hack or confuse it from working
My question here is, what would be some good ways to achieve my goals here? Any idea that would confuse the hack or help to detect hack being injected or memory being changed is welcome.
I know there is NO WAY to have a 100% secure anti-hack system but if we catch only those who use publicly avalible hacks it is already 95% of hackers, we do not care about the minority of smart hackers.