Saturday, September 22, 2018

Example - The AntiCheat - KCryptor


Example - The AntiCheat - KCryptor



You have awesome game and want to protect it against cheater using some tool to hack your game? Your game contain some values about gold, ruby or score when player pickup. This code is exmaple that how the normal code is:

     int gold  = 14298;
     int ruby  = 500;
     int score = 200;

But all the value is store directly in device's memory and the user that want hack his gold and score can be easy find some tools to do that such as CheatEngine, GameGuadian...


User in game with 14298 gold

Use Game Guardian to find and repace gold value


An with that tools he will modify the value of gold 1000 to 999999999 or any value he want and you will become hopless when that user is in top leaderboard and can't do anything.

And simple solution is using custom data type with encryption and descryption: KCryptor

KCryptor provide many base types that can help your protect all in memory value.
  • KInt can work as default int
  • KLong can work as default long
  • KFloat can work as default float
  • KDouble can work as default double
Replace your code above with KCryptor types:

     KInt gold  = 14298;
     KInt ruby  = 500;
     KInt score = 200;

And from your code, you can access your value by calling: gold.Value

     //this show log that gold You have      
     Debug.Log("My Gold = " + gold.Value);
 


You can wrap your variables by use C# properties and never mind about what variable type of gold, ruby, score.

     public int Gold  { get { return gold.Value; }  set { gold  = value; } }
     public int Ruby  { get { return ruby.Value; }  set { ruby  = value; } }
     public int Score { get { return score.Value; } set { score = value; } }

From now, you can access and store gold, ruby, sccore via that properties and never mind about what hackers can do because the values you want to protect will be hide from all cheat tools. Cheer!!

If you want know more about features or descriptions KCryptor, please visit The AntiCheat - KCryptor.


This is just small utility make by Khoi Nguyen
Contact to me if you want resell this utility or other purposes.

Contact: BrillianT Studio
Email: khoint.uit@gmail.com

No comments:

Post a Comment