- Joined
- Mar 6, 2006
- Messages
- 282
I think about this all the time, and wonder why people don't talk about this, so if you have any methods that you know about or care to share, then do so!
Anywho, I'll start with my recent findings of detecting selection hack. Selection hack is when you can select units that are not normally visible to you, which means that a maphack is being used.
I found two viable ways to detect this:
Method 1.) When you force a player to select a unit with SelectUnit(), then the game will return true for IsUnitSelected() regardless of hacks. But... anyone who is NOT using selection hack will fire the event EVENT_PLAYER_UNIT_DESELECTED immediately after SelectUnit() was run.
Players who don't fire EVENT_PLAYER_UNIT_DESELECTED are maphacking.
Method 2.) I'll explain this one with steps.
ClearSelection() for player.
Do SelectUnit() on a visible unit owned by the player.
Do SelectUnit() on another unit that's fogged and owned by an enemy of the player.
* The game thinks that both the visible player owned unit, and non-visable enemy owned unit are selected
The game returns true for IsUnitSelected() on the enemy unit.
Now force the player to press Stop on his unit.
If the player is hacking, then the enemy unit is never removed from selection, and returns true for IsUnitSelected()
If the player is not hacking, then the enemy unit is removed from selection upon the order 'Stop', and will return false for IsUnitSelected()
Now you may be thinking, what if they used safeclick? As of right now, safeclick is pretty buggy and has been abandoned in almost all current maphacks. I haven't done much testing with safeclick, but I'm confident that the methods I described above can be reversed to exploit safeclick users. I could be wrong when I say that I don't think there's many people using safeclick, so if you know something, let me know. As of now, I'm not worried about it.
And lastly, what if they aren't using selection hack, but still have maphack on? Well, there used to be corrupted models that would crash maphackers when they saw them, but they seem non-existent now.
Truth is, they still work and a few maps have them. All the current maphacks don't work on those maps. I'm wondering why this hasn't become a standard for anti-maphack, or if anyone actually knows about it.
Anywho, I'll start with my recent findings of detecting selection hack. Selection hack is when you can select units that are not normally visible to you, which means that a maphack is being used.
I found two viable ways to detect this:
Method 1.) When you force a player to select a unit with SelectUnit(), then the game will return true for IsUnitSelected() regardless of hacks. But... anyone who is NOT using selection hack will fire the event EVENT_PLAYER_UNIT_DESELECTED immediately after SelectUnit() was run.
Players who don't fire EVENT_PLAYER_UNIT_DESELECTED are maphacking.
Method 2.) I'll explain this one with steps.
ClearSelection() for player.
Do SelectUnit() on a visible unit owned by the player.
Do SelectUnit() on another unit that's fogged and owned by an enemy of the player.
* The game thinks that both the visible player owned unit, and non-visable enemy owned unit are selected
The game returns true for IsUnitSelected() on the enemy unit.
Now force the player to press Stop on his unit.
If the player is hacking, then the enemy unit is never removed from selection, and returns true for IsUnitSelected()
If the player is not hacking, then the enemy unit is removed from selection upon the order 'Stop', and will return false for IsUnitSelected()
Now you may be thinking, what if they used safeclick? As of right now, safeclick is pretty buggy and has been abandoned in almost all current maphacks. I haven't done much testing with safeclick, but I'm confident that the methods I described above can be reversed to exploit safeclick users. I could be wrong when I say that I don't think there's many people using safeclick, so if you know something, let me know. As of now, I'm not worried about it.
And lastly, what if they aren't using selection hack, but still have maphack on? Well, there used to be corrupted models that would crash maphackers when they saw them, but they seem non-existent now.
Truth is, they still work and a few maps have them. All the current maphacks don't work on those maps. I'm wondering why this hasn't become a standard for anti-maphack, or if anyone actually knows about it.