Preventing Cheat Packs

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

animalmother
Newcomer
Posts: 1
Joined: May 2nd, 2020, 10:37 pm

Preventing Cheat Packs

Post by animalmother »

Hey, anyone got tips for preventing cheat injection? Is it even possible?
Thanks!
owner123
Super Moderator
Posts: 1943
Joined: February 3rd, 2009, 11:28 pm

Re: Preventing Cheat Packs

Post by owner123 »

You can never prevent it entirely, due to maps having the full source available. No matter how much effort you put in, there can always be someone who will take the time to remove your anti-cheat. If WC3 can open your scripts file, anyone else can too (and they can edit it). I've thought a lot about theoretical ways to prevent cheating by use of encryption/hashes and concluded it's impossible.

That said, some of the most common methods to make cheating more difficult are:
- Name some of your map variables/functions the same as ones from popular cheatpacks. Causes a collision and syntax error if cheatpacks are inserted (extremely easy to defeat)
- Corrupt MPQ so that it's harder to open
- Add anti-cheat function ingame. The easiest is detecting when someone writes commands, like -gold ###, and kicking them out. You can get as advanced or as basic as you want. You could make this quite hard to defeat, but someone could always just change the command names
- Logical anti-cheat: detect when someone's gold/level goes up and it wasn't caused by any functions in your map, and kick them out. This can be hard to program, depending on what your game is like.

Here's a theoretical anti-cheat tool:
- Define a way to detect JJCP and NZCP command strings (for example -gold ###)
- Write a tool that adds code to every method in the map to create a dynamic trigger based on this anti-cheat detection (that is, define a new function for every existing function and add your CreateTrigger in there linked to this new function which serves as anticheat)
This would be basically impossible to remove but would increase your map size to an incredible size. And it would be possible to change the cheat commands still. I had considered writing this (and I might still write it) but I'm really not sure there's much of a point.