All Projects → ookii-tsuki → SafeValues

ookii-tsuki / SafeValues

Licence: MIT license
A simple Unity library for cheating prevention

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to SafeValues

protection
Flexible server protection system (development)
Stars: ✭ 23 (-69.33%)
Mutual labels:  protection, anticheat
UnityNativeTool
Allows to unload native plugins in Unity3d editor
Stars: ✭ 147 (+96%)
Mutual labels:  unity3d-plugin
LMS.Version
Super simple auto build version tool
Stars: ✭ 40 (-46.67%)
Mutual labels:  unity3d-plugin
automate-branch-rules-cli
The tool lets you automate the addition, removal or alteration of the branch protection rules for 1 or more branches & repositories in one go.
Stars: ✭ 29 (-61.33%)
Mutual labels:  protection
PATCH
The PATCH repository for issues tracking, wiki and shared material.
Stars: ✭ 34 (-54.67%)
Mutual labels:  unity3d-plugin
karaoke
Karaoke is a neat plugin to parse and display karaoke subtitle files such as SSA/ASS inside Unity
Stars: ✭ 19 (-74.67%)
Mutual labels:  unity3d-plugin
download.unity.com
Unity Download http://unity3d.com/unity/download/archive
Stars: ✭ 90 (+20%)
Mutual labels:  unity3d-plugin
Rat-Hunter
detect trojans by easy way 🛡️
Stars: ✭ 24 (-68%)
Mutual labels:  protection
Unity-IMGUI-TreeView
Simple Tree View implementation for IMGUI (Editor GUI) in Unity. Includes a special type for working with asset paths, but base data structure and view can be easily extended to support anything.
Stars: ✭ 73 (-2.67%)
Mutual labels:  unity3d-plugin
TinyECS
Tiny ECS is an easy to use Entity-Component-System framework that's designed specially for Unity3D.
Stars: ✭ 20 (-73.33%)
Mutual labels:  unity3d-plugin
Flex-AntiCheat
Flex AntiCheat - Optimized Configs For Multiple AntiCheats
Stars: ✭ 37 (-50.67%)
Mutual labels:  anticheat
MidiJack
MIDI input / output plugin for Unity
Stars: ✭ 19 (-74.67%)
Mutual labels:  unity3d-plugin
smashblock
📡 🛡️A self-updating extensive blocklist filter for AdGaurd. Be sure to 🌟 this repository for updates!
Stars: ✭ 66 (-12%)
Mutual labels:  protection
Webview-unity-3d-2017.3-or-higher-
Webview unity 3d 2017.3 or higher - can be open website url on unity3d or open Html5, html and js on unity offline
Stars: ✭ 18 (-76%)
Mutual labels:  unity3d-plugin
MultiGame
MultiGame is a tool for rapid development in Unity
Stars: ✭ 16 (-78.67%)
Mutual labels:  unity3d-plugin
SAC
An AntiCheat software for PockeMine-MP made to detect unfair gamplay advantages.
Stars: ✭ 52 (-30.67%)
Mutual labels:  anticheat
Unity.Blog.Override App Delegate
A maintainable way to extend / override app delegate in Unity iOS / OSX standalone player. (Much) more at http://eppz.eu/blog/override-app-delegate-unity-ios-osx-1/
Stars: ✭ 28 (-62.67%)
Mutual labels:  unity3d-plugin
UBind
UBind is a value binding component for Unity, which is used to quickly realize the association binding between UI and logical data.
Stars: ✭ 57 (-24%)
Mutual labels:  unity3d-plugin
UnityProminentColor
Tool to gather main colors of an image using Unity.
Stars: ✭ 40 (-46.67%)
Mutual labels:  unity3d-plugin
Scythe-AntiCheat
Scythe AntiCheat - The best minecraft bedrock anticheat designed for realms, worlds and servers
Stars: ✭ 87 (+16%)
Mutual labels:  anticheat

Safe Values

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Demo
  5. License
  6. Contact

About The Project

This is a small project I have been working on for anti cheating in Unity Engine. It allows you to protect your game from cheating tools but it doesn't protect its files from being ripped off.

Key Features
  • Hides variables in memory.
  • Encrypts and extends PlayerPrefs.
  • Detects speedhacks.

Getting Started

Installation

  • Download the Latest release then extract SfVal.zip and place the SfVal.dll and SfVal.xml files in Assets/Plugins of your project.
  • It is recommended to build your game with IL2CPP.

Usage

Safe Values

These structs hide values from cheating tools by making an offset to them

  • Example of hiding a float/integer from cheating tools.

    using Med.SafeValue;
    using UnityEngine;
    
    public class Test : MonoBehaviour
    {
        SafeFloat speed = new SafeFloat(500f);
        SafeInt health = new SafeInt(100);
        SafeLong plId = new SafeLong(57821103964721L);
    
        public RigidBody rb;
    
        public void DealDamage(int amount)
        {
            health.Value -= amount;
        }
        public long GetID()
        {
            return pl.Value;
        }
        void Update()
        {
            rb.velocity = Vector3.forward * speed.Value * Time.deltaTime;
        }
    }

Player Saves

This class saves and loads various data types and classes using AES encryption to playerprefs.

  • Example of Encrypting/Decrypting and saving/loading a custom serializable class to/from PlayerPrefs using AES encryption

    using Med.SafeValue;
    using UnityEngine;
    
    public class Test : MonoBehaviour
    {
        public Card card;
    
        void Awake()
        {
            //It is recommanded to set an encryption key, otherwise it is going to use a default key
            //Warning: always use the same key when encrypting or decrypting
            PlayerSaves.Key = "/A?D(G+KbPeShVmYq3t6w9z$C&E)H@Mc";
        }
    
        public void SaveCard()
        {
            //will encrypt and save the class in playerprefs
            PlayerSaves.EncryptClass(card, "card1");
        }
        public Card LoadCard()
        {
            //will load the class from playerprefs and decrypt it
            return PlayerSaves.DecryptClass<Card>("card1");
        }
    
        [System.Serializable]
        class Card
        {
            public string title;
            public int number;
            public bool isLegendary;
        }
    }
  • Example of Encrypting/Decrypting and saving/loading values to/from PlayerPrefs using AES encryption

    using Med.SafeValue;
    using UnityEngine;
    using System;
    
    public class Test : MonoBehaviour
    {
        SafeFloat speed = new SafeFloat(500f);
        SafeInt health = new SafeInt(100);
        string title = "Plane 1";
        char plClass = 'C';
        long id = 15120548466974L;
        DateTime lastSaved = DateTime.Now;
        bool isActive = true;
    
        void Awake()
        {
            //It is recommanded to set an encryption key, otherwise it is going to use a default key
            //Warning: always use the same key when encrypting or decrypting
            PlayerSaves.Key = "/A?D(G+KbPeShVmYq3t6w9z$C&E)H@Mc";
        }
    
        public void SaveValues()
        {
            //will encrypt these values and save them in playerprefs
            speed.Value.EncryptFloat("plSpeed");
            health.Value.EncryptInt("plHealth");
            title.EncryptString("plTitle");
            plClass.EncryptChar("plClass");
            id.EncryptLong("plId");
            lastSaved.EncryptDateTime("plLastSaved");
            isActive.EncryptBool("plAct");
        }
    
        public void LoadValues()
        {
            //will load these values from playerprefs and decrypt them
            speed.Value = PlayerSaves.DecryptFloat("plSpeed");
            health.Value = PlayerSaves.DecryptInt("plHealth");
            title = PlayerSaves.DecryptString("plTitle");
            plClass = PlayerSaves.DecryptChar("plClass");
            id = PlayerSaves.DecryptLong("plId");
            lastSaved = PlayerSaves.DecryptDateTime("plLastSaved");
            isActive = PlayerSaves.DecryptBool("plAct");
        }
    }

Anti-Speedhack

This class detects speed hack attempts

  • Example of setting up an anti speed hack to detect speed hacks

    using Med.SafeValue;
    using UnityEngine;
    
    public class Test : MonoBehaviour
    {
        void Awake()
        {
            //starts the anti speed hack detection process and calls CloseGame() when a speed hack is detected
            StartCoroutine(AntiSpeedHack.Start(CloseGame, 2f, true));
        }
    
        //This will be called if the AntiSpeedHack class detected a speed hack
        void CloseGame()
        {
            Application.Quit();
        }
    }

Demo

Try a WebGL Demo

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Med Ben Chrifa - [email protected]

Project Link: Safe Values

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].