Secure your Game with Unity Game Shield - An open-source anti-cheat and encryption toolkit
Devs Daddy
Posted on April 11, 2024
Hey, everybody. Today I'd like to talk about a new set of tools I've been developing lately. Unity Game Sheild is an open-source comprehensive suite of tools for your apps and games, including many anti-cheat and securty tools. This framework is easy to use on any projects and platforms.
āWhy GameShield?
- Easy to install (only 4 steps basic installation);
- Easy to configure each module;
- Reporting system;
- Lightweight;
- Event-based and modular;
ā Features:
- Memory Protection and Secured Types;
- Secured Game Saves;
- Teleport Protector;
- SpeedHack Detector;
- WallHack Detector;
- Time Skip Detector with Network Compare;
- Injection Scanner;
- Rewarded Captcha;
- Secured Web Requests;
- Large Crypto Library;
- Cheating Reporting;
- Ready-to-Use UI;
Get Started
GameShield installs into your project as easily as possible - basic installation and configuration takes only 4 steps. Below we will consider both automatic initialization and manual configuration.
Basic Installation:
- Download Latest Release from GitHUB;
- Import .unitypackage into your project;
- Run Setup Wizzard at Unity Top Menu (GameShield -> Setup Wizzard);
- Check all settings and press "Complete";
- Done!
Manual Installation:
- Download Latest Release from GitHUB;
- Import .unitypackage into your project;
- Place Prefab with GameShield main script at scene;
- Write initialization code at your game installer script (see how to here);
- Done!
Dependencies:
- Unity 2019+
- Unity Event Framework (Included);
- Unity Crypto Library (Included);
About Modules
Memory Protector
The Memory Protection module allows you to protect your application from external access to RAM. In this way you can organize a simple and fast protection against software like CheatEngine.
This module includes SecuredTypes, which serve as a protected island for basic types in your game or application.
Secured Types
Secured Types allow you to hide the real value of variables from users in memory by embedding symmetric encryption in basic types. In turn, Memory Detector reports on attempts to swap values, because each assignment checks the real and fake value of the variable.
Usage Example:
SecuredInt myInt = 32; // Yeah, it's that simple. Now you can use it in your game objects / serialization
Note! Turn-On Memory Protector to get events of cheating detection for any secured type!
Secured (Encrypted) Game Saves
The Secured Saves module allows you to store your data on the user's device in encrypted form. It is also recommended to use it together with Memory Protector - which simplifies working with objects in memory.
Module serialize your objects using JSON and Encryption Providers such as AES, DES, and other popular encryption methods available to you. The module uses the Unity Crypto Library, which is already included in GameShield. Standard .Net methods are used for serialization/deserialization to files.
Injection Scanner (Assembly Protector)
The injection scanning module allows you to protect your application from external access when malware attempts to tamper with or inject its own libraries.
During the application development process, you specify a list of valid libraries that will be used after the product is built. Thus, during the application build process, GameShield captures the internal hashes of the libraries and their build versions to scan for spoofing at runtime or at startup.
SpeedHack Detector
This module allows you to track the tick rate in the game and compare it to the actual CPU tick time that has passed on the device to detect game speed spoofing - aka SpeedHack Cheat. When detected, it sends an event.
At each interval, the module checks how many game ticks and real device ticks have passed, requesting a specific number of ticks per interval from the processor. This allows you to synchronize Update in Unity and lets you know where the speed has changed.
Wallhack Detector
This module allows you to use physics simulation to check the presence of Wallhack in the game. It simulates the behavior of both Rigidbody and Character Controller for both types of player controllers
When passing the next physics tick - check modules are created on the basis of Rigidbody and Character Controller, if these components were detected a change in Velocity on the Z-axis more than the maximum allowable value, then most likely WallHack was used.
Teleport Detector
Teleport Detector is a small module that allows you to compare the speed and position of targets to the maximum allowed values to check for possible player teleportation. Works well in conjunction with SpeedHack Detector.
The detector checks the distance of positions between ticks of a game cycle to make sure that it is not greater than the maximum allowed distance for that tick. The check is based on the formula of the distance between two vectors and the maximum speed variable. It also supports tracking multiple targets in the game.
Time Skip Detector
This module checks the system time by comparing it with the network time to see if the time in the game has been rewound. It also checks local time rewind from the previous value. The server of choice is used for operation. You can also run your own time check server.
Secured Web Request
This module is a wrapper over Unity Web Request - it handles encrypted data both sending and receiving. It uses one of the crypto providers of your choice, which will perform encryption/decryption. It uses Unity Crypto Library already embedded in GameShield for its operation.
Rewarded Captcha
This module provides functionality to implement a simple client-side captcha. The method of operation is quite simple - the user needs to click on the icons in the sequence indicated at the top of the screen.
After successful completion, you can give him a reward:
Cheating Reporting
This module allows you to send cheating / custom reports to your server where you can track and manage them. You can easily use it for normal user feedback as well.
Note that for this module to work, you need to implement your own message reception on your server side.
In conclusion
To summarize - Unity Game Shield is a large library that includes many modules already, with a number more in development.
I'm preparing a server-side solution for GameShield soon, including reporting, secure authorization, and more. You can follow the progress here.
I also suggest you visit the Wiki for full documentation.
Thanks for reading! If you still have any questions, feel free to contact me:
Posted on April 11, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
April 11, 2024