I have online game for which I wrote a simple external anticheat in c#, it checks my game's process modules and handles for suspicious activity. And so it works like this:

  • player starts launcher (anticheat) which then starts the game with its pid as parameter
  • actual game (upon starting) reads that pid, locates anticheat path using this pid and fetches md5 hash of my anticheat
  • If it doesn't match the game closes. Also if you close anticheat the game closes too.

So theoretically there's no way user could exit anticheat without exiting the game except he could for instance suspend anticheat process and then its of no use. What simple thing I could do to prevent this from happening? I was thinking - make a thread in the game that would check in a loop if anticheat process is suspended and exit if it is. Would that be a correct approach?

Is my architecture flawed or is it ok?

  • 2
    \$\begingroup\$ What's to stop a cheater from simply disabling the piece of code that closes your game if the anticheat is modified / closed? It's in their hands to modify to their heart's content. \$\endgroup\$
    – DMGregory
    Oct 2 '18 at 3:41

It's flawed. All online games have the same problem. Only way to keep em secure, is to shut it down, disconnect internet, seal in cement and send to space and never ever mention that you created a online game.

Problem is, that you have to give code to the client and you should always expect, that client sees all the code and is willing to create harm.

No matter how many processes you start, how often you check and compare, there is still just one boolean that needs to be flipped. Somewhere in your code, there is an if (externalMD5 == internalMD5). That if can be changed to return always true.

Custom launcher can be made, that starts the game with the wanted PID and after that your check means nothing.

Your first problem is to get players for your game. Design your game from start to end with cheating in mind and don't trust the client. Users will do what ever they can to break the game, with full intentions and by accidents.

Secure your networking, only ask input from user, do not allow client to create, move, edit or interact with anything directly. Always have server issuing commands.

Valve, blizzard, Epic, ubisoft, EA. Everyone fails with this. Only reason you see some games banning someone, is because users use public hacks. Private, closed circle cheating is so easy, that you really should not focus on that.

Don't send anything to client, that he absolutely should not know. If that information gives edge to the player, you should assume he knows it.

TL;DR; Forget anticheat, never trust the client


Not the answer you're looking for? Browse other questions tagged or ask your own question.