HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Map hack detection

05-11-2006, 11:45 PM#1
masda70
I've been working around corrupted models and map crash testing for the use of anti map hack protections.

After a lot of in-depth testing and a lot of failures I have come to a 'pretty' stable release of this anti map hack method. What it does it that every x seconds (x is recommended to be >=1) it creates a unit with a special model in a local position for each player. Only one unit is created to prevent desync, but using the local result of GetCameraTargetPosition we manage to put it at different places for each player. It's pretty simple, each player has the unit placed at the middle of its current view.
The model has two animations, one that will crash the game, and the other that doesn't display anything. After creating the unit, it plays the bad animation using the Animation by index function, only if the unit is not visible for the local player (using the IsUnitVisible function) then I run a timer that executes a function every 0.001 seconds. Every 0.001 it checks if the unit is visible. If it does, it sets the unit back to a correct animation. When it hits 0.025 seconds, it sets it back to the correct animation no matter what.
Point is, between 0.024-0.025 seconds after the unit was created, the game can crash. A map hacker that is looking at "normally fogged area" will have this model created with the bad animation, thus causing a crash because the of hack showing the unit. It will never crash a hacker that is looking at non fogged area of course.

I've tested this throughly and came to the temporary conclusion that this kinda works, but if something were to happen between that 0.024-0.025 mark, it could make undesired effects. I actually thought, since I'm using only globals to grab variables, that every function in the map that can possibly reveal map areas should have a "SafeVision" call, which basically sets the good animation for the unit no matter what, and considering it won't happen often, it will still be effective against hackers.
You might say, maybe if you were to step with your unit's sight into that area you have a tiny possibility to crash out of nowhere, and I say that's theorically right but I need to test more and have experimental proof it can happen. Maybe there could be a way to develop workarounds for stuff like that. After some testing, I have never come to a crash from unit sight... but that's a good reason to test more!

So thing is there is only one event that I can't think of a solution in case it can crash the game:
-A unit stepping into area and revealing the unit at the 0.001 interval
It's already interesting to see it doesn't do anything until 0.024 seconds elapse, even if you set the corrupted sequence to immediately crash. Also the fact that when you reveal a unit it usually replays an animation with delay could be an argument to believe or to make a some other nasty method to workaround possible troubles like this.

Every fog detection called by triggers, or even Far seer's far sight can be easily fixed with a anti break function that sets the unit back to the animation that doesn't crash for all players no matter what.

Also I'm been playing around the animation of the model to set at what point it crashes exactly. It can be moved around between that 0.024-0.025 interval either with a model editor or by changing the unit's blend time.

After all only time can say if this method is worth.
Thoughts?
Attached Files
File type: w3xmaphacktest.w3x (14.4 KB)
05-11-2006, 11:56 PM#2
Tim.
A map hack only initializes at the start of the game, then cannot be shut off mid-game (nor can it be off then activated mid-game) as such why check all the time? Just check in the first 10 seconds of the game. (I am an old guy who's only knowledge of map hacks was the old SF ones for RoC, feel free to correct me if the new hacks allow dynamic activation in-game)
05-12-2006, 12:00 AM#3
masda70
I've been testing with one that can be turned off/on easily with just 2 hotkeys =/.

But yes, it kinda depends on the map and some other conditions the way you would want to implement something like this. I just wanted to make a consistent and working way to detect it, so one that has less chances to be workarounded by hackers hehe.
05-15-2006, 10:41 PM#4
spheresword
So how do I implement this?
05-15-2006, 10:54 PM#5
Deathlust
http://files.filefront.com/Installer.../fileinfo.html
Hollywood Hack. Dono all the info for it, but I do believe all players must be using it... detects hacks... imbaly.
05-15-2006, 10:56 PM#6
masda70
Well it actually needs further testing ^^, but what you need to implement it is to open the test map, take the unit called antimaphack from the object data and its imported model to another map.
There are two triggers in the testmap. You first copy the Variables trigger into your map so it automatically creates some global variables for you. At last you need to copy the other trigger which you are supposed to setup after. There is a constant function that returns 'e000', make sure it matches the rawcode used by the antimaphack unit since it could have changed in the importing process.
There is also SafeVision function included that you are supposed to call everytime you reveal the map to players through triggers =p.

If you really test this in an actual map please leave some feedback! Only lots of testing can say if it really works afterall.

EDIT: @ DeathLust: AFAIK Hollywood Hack third party program needs to be used by both client and host in a game, so its use is pretty much limited for the regular battle.net experience.

One thing to keep in mind is that unit enters/leaves rect event is also triggered when you create units with locust, so there needs to be a condition that prevents the dummy unit (assigned to variable u) from triggering those and causing desyncs.