Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by sambid123sameer · Aug 09, 2016 at 06:04 PM · unity 5protectioncheathacking

Cheat Engine Detection?

Hello

Im here trying to protect my game from cheats!

As we all know the worlds most used memory editing software is cheat engine

So what i want to know is do we have the ability to detect cheat engine? I guess we have to select the app in the cheat engine for editing

Is there anyway we can detect cheat engine , If the user tries to scan a value , the app detects it and does a Application.Quit()

I tried anticheat toolkit by codestage but it protects only speed hacks(or maybe i dont know) , i kind of want more explanation on this

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by ElementalVenom · Aug 09, 2016 at 07:31 PM

The best way that I have done it is by doing simple checks on your variables.

For instance lets say you have a health variable. You have it between 0-100. One simple check you can do is if its over 100 then they've messed with it.

Another way would be to make 2 variables one called health one called tmpHealth and make tmpHealth always 20 points higher than normal health. Then always make sure health is 20 less than tmpHealth. And if not they've messed with it. Simple checks like that can do what you want.

EDIT: You can also just detect if cheat engine is running on the computer using this:

 foreach (Process pro in Process.GetProcesses())
             {
                 if (pro.ProcessName.ToLower().Contains("cheat") && pro.ProcessName.ToLower().Contains("engine"))
                 {
                     //Cheat engine is running!
                 }
             }


Then you can either do Application.Quit() or do pro.Kill() to force close cheat engine. You should do this a few times while the program is running to make sure they dont start it after they start your game.

I think its good to note though that if its a singleplayer game it doesnt really matter if they hack it because its only effecting them. If its multiplayer then there is much more you can do to prevent this some of the methods even involve streaming your entire DLL to the server for validation.(Which only takes 1-2 seconds)

EDIT2:

Getting the hash of a DLL is simple. Then its just a matter of sending it to the server and having the server get the hash as well. Then the server verifies if the hashes match. You're going to want to hash the 'Assembly-CSharp.dll' file that Unity3D makes for every game(Found in _Data/Managed/Assembly-CSharp.dll)

You can get the files hash with this code:

 static string GetHash(string FilePath)
         {
             FileStream fStream = null;
             try
             {
                 fStream = new FileStream(FilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
             }
             catch (Exception ex)
             {
                 Console.WriteLine("ERROR:" + ex.Message);
                 Console.ReadLine();
             }
             byte[] myArray = new byte[fStream.Length];
             fStream.Read(myArray, 0, myArray.Length);
             fStream.Close();
             fStream.Dispose();
             string hash;
             using (SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider())
             {
                 return Convert.ToBase64String(sha1.ComputeHash(myArray));
             }
         }


BUT BE WARNED! They can modify the code client-side to send the server a false hash! Dont use this as your only authentication!

Comment
Add comment · Show 5 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image sambid123sameer · Aug 10, 2016 at 03:00 AM 0
Share

Thanks a lot

BTW i didnt get the part where you say 'Strea$$anonymous$$g your entire DLL to the server'

Can i get more explanation on this? :p

avatar image ElementalVenom sambid123sameer · Aug 10, 2016 at 10:41 PM 1
Share

Just edited the main answer. If this was actually helpfull please accept it as the answer :3

Also I ment hashing it not strea$$anonymous$$g it. This is the fastest method and sending the entire DLL wouldnt help at all.

avatar image sambid123sameer ElementalVenom · Aug 11, 2016 at 11:22 AM 0
Share

Thanks a lot I got the cheat engine detection working :) And i understood what you said about the dll Great help Thanks!

avatar image ElementalVenom sambid123sameer · Aug 10, 2016 at 10:46 PM 1
Share

Another thing to note is that this will only prevent modification of the actual files. If they change the variables with cheat engine the hash wont change(Because they arnt modifying the actual files)

avatar image mrscarl3t · Jul 18, 2017 at 05:48 PM 0
Share

Check for all the things above b4 saving any data client side or b4 sending to server

avatar image
0

Answer by kaway · Apr 25, 2018 at 04:54 PM

use anticheat toolkit perfect for obscuredType

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Sam-DreamsMaker · Jul 20, 2018 at 02:21 PM

Hi, Process.GetProcesses() give only processes of the current user, Cheat Engine can be started by the admin user.

To be sure I suggest you to use a script on a GameObject like that :

using System; using UnityEngine; using UnityEngine.UI;

 public class CheckFlowOfTime : MonoBehaviour {
     //attributes to see changes during tests
     [SerializeField]
     private Text time;
     [SerializeField]
     private Text systemeTime;
     [SerializeField]
     private Text updatedText;
     [SerializeField]
     private Text lifeText;
     [SerializeField]
     private Text toleranceText;

     [SerializeField]
     private int life = 3;
     [SerializeField]
     private int gapTolerance = 3;

     private DateTime startDateTime = System.DateTime.Now;
     private DateTime updatedDateTime = System.DateTime.Now;
     

     public void Start() {
         InvokeRepeating(nameof(checkTime),0,1);
     }

     //not optimized, remove it when you will finish tests
     private void Update() {
         time.text =        "time       " + Time.time.ToString();
         systemeTime.text = "systemTime " + System.DateTime.Now.ToString();
         updatedText.text = "updateTime " + updatedDateTime.ToString();
         lifeText.text =    "life       " + life.ToString();
         toleranceText.text =    "tolerance  " + gapTolerance.ToString()+" s";
     }

     private void checkTime() {
         updatedDateTime = updatedDateTime.AddSeconds(1);
         if (updatedDateTime > System.DateTime.Now.AddSeconds(gapTolerance)) {
             updateLife();
         }
         
     }
     private void updateLife() {
         life--;
         if (life == 0) Application.Quit();
         TimeSpan timeSpan = updatedDateTime - System.DateTime.Now;
         double realGap = timeSpan.TotalSeconds;
         gapTolerance += Convert.ToInt32(realGap);
     }
 }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

103 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Any way to add a layer of protection for asset from getting rip from apk 0 Answers

Need urgent help integrating a Unity 5 + Vuforia 6 project into a native iOS App 1 Answer

URP , shader error,,,implicit truncation of vector type error! 2 Answers

I want to use Berkeley DB In Unity3D, What should i do? please give a detailed steps. 0 Answers

ProBuilder: texture UVs mess up badly 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges