Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Anti-Cheat Toolkit: stop cheaters easily!

Discussion in 'Assets and Asset Store' started by codestage, Aug 20, 2013.

  1. MoFaShi

    MoFaShi

    Joined:
    Oct 25, 2015
    Posts:
    43
    does this package support 2018.3.0b12 ? when I imported this package into 2018.3.0b12, there is an error which shows "Assets\Plugins\CodeStage\AntiCheatToolkit\Editor\Scripts\Windows\ACTkSettings.cs(205,41): error CS0117: 'SettingsService' does not contain a definition for 'FetchSettingsProviders'"
    how could I solve this error?
     
  2. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey @MoFaShi

    This is a known issue and already fixed in current dev version.
    It's not released yet since this beta changed public API few times already, so it was decided to postpone update release until final 18.3 release.

    Please drop me a PM with your invoice and I'll send you fixed version which works with Beta 12.
     
  3. ChaosRobin

    ChaosRobin

    Joined:
    Mar 28, 2013
    Posts:
    58
    @Dmitriy-Yukhanov

    Hey!

    I'm also using 2018.3 and have import errors, I tried to pm you but i dont use this system very much, I went to "start a conversation" it looks kinda like a public forum post but im not sure if its a pm or not, anyway I just left a review on your product, talking about how I dont have a invoice number anymore but hoping the review itself would help prove i own it. Can you send me the fixed file too? my email address is in the conversation!
     
    codestage likes this.
  4. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey @ChaosRobin

    Thanks for your purchase, review and for getting in touch ^^
    I've sent a fix in new PM and via email just in case.

    Going to release it to the store soonish for everyone - 18.3 RC1 is a good sign!
     
  5. Gamrek

    Gamrek

    Joined:
    Sep 28, 2010
    Posts:
    164
    Hi,

    What is the status of the update? I just updated my project to 2018.3 and only just found out this issue. Is it going to be in the next few days? or a week? please let me know, if it takes long I will send you my invoice so that I can get the Beta version out of you. Thanks.

    Gamrek
     
  6. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey, @Gamrek

    I'm sending it for review today, hope to see it live early next week.

    I'm sorry for the inconvenience, Unity release from release candidate was quite fast this time.

    In urgent case, feel free to send me a PM to get it before it hits the store.
     
  7. CBFGDev

    CBFGDev

    Joined:
    Aug 11, 2015
    Posts:
    1
  8. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey @CBFGDev,

    I don't see it can interfere in any way, should work together just fine.
     
  9. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    Hi! Thanks for this asset!. I have a virtual pet and I don't want the people cheat with the time. I add the prefab ACTk Detectors in the scene, just for test and then I added a easy event to show a text message, but it don't work. I have LunarConsole so I can debug on Android, and I don't have error or alert.
    I'm forgetting something?
    Thanks again!
     
  10. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey @gferrari

    Could you please share a bit more information?
    - how did you cheated time and by which value?
    - did you have an internet connection at your target device while making a time cheat?

    TimeCheatingDetector has 65 minute default allowed threshold (configurable from inspector) so it's allowed to cheat time up to 65 minutes by default and it will perform a detection check every 5 minutes by default.

    It's possible to get more information about detection checks if you'll subscribe to TimeCheatingDetector.Instance.CheatChecked after you start a detector (or at Start() MonoBehaviour phase).
    This event will get success checks and errors from the detector so you'll be able to know more what could happen not as you expected.
     
    gferrari likes this.
  11. gferrari

    gferrari

    Joined:
    Jan 14, 2015
    Posts:
    135
    - how did you cheated time and by which value?
    I just change the date of the phone, like a 2 or more days. (I don-t know if it the correct way of cheating haha)

    - did you have an internet connection at your target device while making a time cheat?
    Yes It have internet connection (I saw the url to check the date in the inspector setting)

    I'll see in more depth, maybe later. I wanted to do a quick test to see if it worked as expected. Thanks for answer so soon!
     
    codestage likes this.
  12. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Should be enough indeed =)
    Did you wait for 5 minutes more for the detection event to kick in?

    Thanks for providing extra information, still not sure why you did not get detection event though
    Looking forward to hear from you any additional data on this case.
     
    gferrari likes this.
  13. Expalphalog

    Expalphalog

    Joined:
    Dec 23, 2018
    Posts:
    1
    I have somehow triggered a false positive on your anti-cheat software. I have 130+ hours in this game (Throne of Lies) and did nothing different tonight than any other night. I was banned for "injecting code" 20 times in one minute. Like, I can't even type fast enough to write the WORD "code" 20 times in one minute, much less type some out.

    I'm on Linux Mint if that's relevant. Let me know what information/files you need from me to find out what went wrong. I'm not terribly upset about the ban (been spending too much time on that game anyway) but I want to make sure that this doesn't happen to anyone else.
     
  14. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey Mike, @Expalphalog

    Thanks for reporting this problem.
    I'm really sorry to hear this happened to you, seems to be a some glitch or some assembly was not whitelisted by mistake =(

    Just sent to you more details via email, hope we'll get this sorted out.

    Thanks for your help!
     
    Expalphalog likes this.
  15. MrLucid72

    MrLucid72

    Joined:
    Jan 12, 2016
    Posts:
    945
    Getting tons of false-positives on Mono builds with Linux on Unity 2018.2 D: had to deal with some embarrassing unbans. Specifically Linux (1 Arch Linux, 1 Mint, launched through Steam client).

    I don't think it did this with 5.6, just 2018.2. Another coincidental change is that I also moved from Steamworks.net to Facepunch.Steamworks.
     
  16. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey, @Xblade-Imperium42

    Thank you for contacting me first!

    I'm so sorry to hear you have those false positives but I'm eager to help get rid of them and thus I need a bit more information, if possible, to try reproduce it on my end or at least try to guess possible causes:
    - what's your ACTk version? Please note, 2018.2 support was added in 1.6.0
    - does those false positives happens at all platforms or only on Linux ones?
    - is it possible to figure out what Injection Detector sends in the "cause" argument to the detection event \ callback? It should send assembly information which it detected as foreign (so you could add it to the whitelist manually) or any other helpful information (in case if white list was damaged, removed, manipulated in either way).

    While I'm investigating this case, if it's not possible to figure out the detection event argument value at this moment, please ignore Injection Detector triggers or temporary disable it in your project, to avoid any further confusion of legit players.

    Also please try switching to IL2CPP where possible if you still didn't (it makes managed injections impossible).
     
  17. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    thanks for this incredible asset!

    but how can i lock data?
     
  18. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
  19. Davood_Kharmanzar

    Davood_Kharmanzar

    Joined:
    Sep 20, 2017
    Posts:
    411
    thanks ...
    you mean something like this?

    Code (CSharp):
    1. using CodeStage.AntiCheat.ObscuredTypes;
    2.  
    3. public class BlahBlahBlah: MonoBehaviour
    4. {
    5. [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
    6. static void OnBeforeSceneLoadRuntimeMethod()
    7. {
    8. ObscuredPrefs.ForceLockToDeviceInit();
    9. ObscuredPrefs.lockToDevice = ObscuredPrefs.DeviceLockLevel.Strict;
    10. }
    11. }
    is that working right??
     
  20. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Yeah, looks fine to me
     
  21. banksazero

    banksazero

    Joined:
    May 8, 2015
    Posts:
    77
    Hi

    I wonder do I need to add anti-cheat toolkit every scene?
    Or All I need is just change from PP to OP and int to obsecuredint.

    Ps. I use ACTK for protect playerpref and some int
     
  22. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey @banksazero

    Just replace sensitive variables with obscured types and sensitive prefs calls with ObscuredPrefs.
    Also, you may add ObscuredCheatingDetector to your startup scene and enable keep alive option to let it survive scene switches.
     
  23. Dreamer

    Dreamer

    Joined:
    Mar 8, 2011
    Posts:
    67
    It seems like using Unity IAP in project will trigger Injection Detector fasely. Injection Detector works fine before I import Unity native IAP plugin.
     
    codestage likes this.
  24. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey @Dreamer

    Thanks for reporting it, it will be fixed in next update.
    For now, please add it to the user-defined whitelist (see readme for details).
     
  25. vas_potapov1

    vas_potapov1

    Joined:
    Apr 10, 2018
    Posts:
    10
    Hello @Dmitriy-Yukhanov !
    Recently I updated from 1.4.1.1 to 1.6.6, and when I test game upgrading - all savings from previous release are gone. Can u tell please what can be the reason?
    UPD: problem only Android dependent
     
    Last edited: Feb 6, 2019
  26. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey, @vas_potapov1

    Could you please clarify, what you're using to save data which got lost? ObscuredPrefs?

    If you're using ObscuredPrefs, could you please clarify if you're using Lock To Device feature and which exact setting for it you're using?

    ADDED:
    Also please clarify if you updated Unity with ACTk too or not and which is your current Unity version.

    Thanks!
     
    Last edited: Feb 6, 2019
  27. vas_potapov1

    vas_potapov1

    Joined:
    Apr 10, 2018
    Posts:
    10
    Thanks! Sure! We are using ObscuredPrefs to store data with Strict device lock level. Current unity version is 2018.2.20f1 (previous was 2017.4.4f1) and yes, first we updated unity, and then immediately ACTk.
     
    Last edited: Feb 7, 2019
    codestage likes this.
  28. vas_potapov1

    vas_potapov1

    Joined:
    Apr 10, 2018
    Posts:
    10
  29. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    @vas_potapov1 I'm sorry for a long wait but I'm not able to reproduce it on my end so far =\
    Tried both in Editor and on actual Android device.

    Are you experience this issue both on the actual devices and in editor?
    Also, I wonder if you have OnPossibleForeignSavesDetected triggering when you try to read data? It could indicate you have device id changed.

    As a temporary workaround, while I'm investigating it further, try enabling Emergency Mode to see if you can get the data back.
     
  30. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    @vas_potapov1 all after all, I couldn't reproduce it, there should be something else :confused:
    Please let me know if emergency mode works for you.

    Also, if possible, send me a PM with your crypto key, device ID and
    /data/data/pkg-name/shared_prefs/pkg-name.xml file from the affected Android device for the further low-level investigation.

    Thanks!
     
  31. vas_potapov1

    vas_potapov1

    Joined:
    Apr 10, 2018
    Posts:
    10
    Hello @Dmitriy-Yukhanov ! I'm sorry for long response. Yes, it happens on both Editor and Android platforms. So far, I've found that problem in the CalculateChecksum(), it generates DeviceIdHash, that differs from previous version, although cryptoKey is same and DeviceId is same. That is why OnPossibleForeignSavesDetected didn't triggered. But if I change
    readForeignSaves = true;
    it works fine. Is it enough for your research or should I send PM with data you mentioned?
     
    codestage likes this.
  32. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey @vas_potapov1,

    Thanks for all the additional info!
    Though I'm afraid I still can't understand how it's possible 1.4.1.1 and 1.6.6 can have different results for the CalculateChecksum() since here are all changes in this method:

    upload_2019-2-8_11-47-42.png

    And here are all changes in xxHash:

    upload_2019-2-8_11-47-58.png

    Default cryptoKey was not changed, device ID lookup code didn't changed too.

    As you can see, there is nothing what could affect the calculation result at the first glance =\
     
  33. vas_potapov1

    vas_potapov1

    Joined:
    Apr 10, 2018
    Posts:
    10
    Hey, @Dmitriy-Yukhanov ! Thanks for researching. I've noticed interesting thing. In version 1.4.1.1 we set new cryptoKey with method SetNewCryptoKey like this
    Code (CSharp):
    1. public static void SetNewCryptoKey(string newKey)
    2.         {
    3.             encryptionKey = newKey;
    4.             deviceIDHash = CalculateChecksum(deviceID);
    5.         }
    and in our case deviceID comes as parameter with value of 'null'.
    In opposite - at the 1.6.0 SetNewCryproKey is obsolete and we can cryproKey through property
    ObscuredPrefs.CryptoKey = newKey;
    . But when it comes to
    CalculateChecksum(deviceID);
    - deviceID in this case will be what SystemInfo.deviceUniqueIdentifier return, i.e. not null..
     
    codestage likes this.
  34. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey @vas_potapov1.

    Thanks a ton for pointing out to this, looks like it's a cause!

    It was a bug in old versions where you could have empty deviceID when you set crypto key leading to empty device id hash being saved with your data. It was fixed lately.

    To work it around, you may call ForceLockToDeviceInit() before changing a crypto key with SetNewCryptoKey().

    So, your current saves are signed with empty device ID looks like and when you migrate to ACTk 1.6.6 you get them with proper deviceID and due to the lock to device feature you can't read them.

    My suggestions how to act here:

    - You can keep old ACTk version, but re-save all saved data with proper device ID:
    • read all saves
    • call ForceLockToDeviceInit
    • save all data again (with proper device id)
    • can update to new ACTk in next game updates
    - Or, you can keep using new ACTk with readForeignSaves = true and disable this flag in later updates, when you'll be sure all players already resaved their data with proper deviceID.
     
  35. vas_potapov1

    vas_potapov1

    Joined:
    Apr 10, 2018
    Posts:
    10
  36. gamesunrise69

    gamesunrise69

    Joined:
    Aug 7, 2018
    Posts:
    2
    hello! I have question, How i reset speed game when detected speed hack? what value cheat engine was change speed of game ?
     
  37. Qmaks2

    Qmaks2

    Joined:
    Jun 2, 2012
    Posts:
    25
    Hello, do you now how to lock game, if Game Guardian is Active on player phone?
     
  38. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey,

    It's not possible to reset it since Game Guardian changes timers out from the managed code reach.

    There is no cheat tools detection in ACTk yet, tough I'm not sure it will be implemented at all since many cheating tools like Game Guardian has different anti-detection tricks they perform having root access. ACTk can't require root access to counter-measure them and anyways it will be infinite cycles of bullet and armor.
    So it's much more productive to detect things Game Guardian affects - variables cheating, speed hack...
     
  39. gamesunrise69

    gamesunrise69

    Joined:
    Aug 7, 2018
    Posts:
    2
    oh, okay thanks for your answer!
     
  40. bnamkung

    bnamkung

    Joined:
    Oct 25, 2017
    Posts:
    3
    Hello! I am constantly getting the following errors. Im only having this problem on Mac OS unity ( I tried it on both unity 5.6.3 and 2018.3). I didn't have any of these problems on Windows Unity 5.6.3. Im not even using the timecheatingdetector for my project but because of this error, I can't build my project. Thanks in advance. Screen Shot 2019-03-10 at 12.41.03 AM.png
     
  41. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey, @bnamkung

    Could you please clarify what is your target platform and what ACTk version you're using?
    Also would be nice to know what scripting runtime do you use in 2018.3 - .NET 3 or 4?

    Can't reproduce this on my end so far =\
     
  42. bnamkung

    bnamkung

    Joined:
    Oct 25, 2017
    Posts:
    3
    @codestage After going through some googling, I was somehow able to fix the problem! Anyways I really appreciate your fast reply! Also anti cheat toolkit is awesome! It works like a charm. Many thanks :)
     
    codestage likes this.
  43. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Glad to let you know new 1.6.7 update is live on the store!
    It's a maintenance update mostly with fixes of lately reported issues:

    1.6.7 [Maintenance Update before big 2.0 release!]
    - update to Unity 5.6.1
    - improve random key generation performance in some cases
    - add few missing assemblies to the default InjectionDetector whitelist
    - prevent detectors duplicates on same Game Object
    - workaround for Android 4.2.* HEAD request bug
    - fix RandomRangeInt can only be called from the main thread in some cases
    - fix possible null ref exception in ObscuredPrefs.SetString
    - other minor changes

    And this is last or one of the latest updates for the 1.x, since new 2.0 version with massive changes and new features is on its way as a first paid upgrade to celebrate 5+ years of existence on the store!

    :rolleyes:
     
    Last edited: Mar 14, 2019
  44. mobilfactory

    mobilfactory

    Joined:
    Nov 11, 2014
    Posts:
    2
  45. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey, @mobilfactory

    Sure, Assembly Definition files will be added in new 2.0 version which is under development now.

    If you would like to get them in current version, please drop me a PM with your email and invoice id and I'll send you current release version with added asmdefs.
     
  46. SuperMiro

    SuperMiro

    Joined:
    Nov 23, 2018
    Posts:
    51
    @codestage I can confirm that this issue exists and appears when I used AnticheatToolkit in 2018.3.10f1

    Mind if you tell how you managed to do so ???
     
  47. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Hey @SuperMiro,

    Thanks for confirming this. Could you please clarify are you experiencing this on Mac or PC?
    Also it would help a lot if you would let me know if it does reproduces at the empty project for you.
    If it does not, could you please let me know which packages you have added to your project via Package Manager?

    Thanks!

    I would be glad to know this too!
     
  48. SuperMiro

    SuperMiro

    Joined:
    Nov 23, 2018
    Posts:
    51
    I use windows 10, Unity 2018.3.10f1

    I kept importing my assets one by one till the error come out when imported Bolt next to AntiCheatToolkit

    So I created a new project and imported only AntiCheatToolkit and Bolt and boooooom!

    Same errors as in this post


     
    codestage likes this.
  49. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    Thanks a ton, @SuperMiro!

    Seems to be Bolt adds some namespace-less scripts to your project which conflict with System.Threading.Tasks.Task or something like this happens.

    I'm going to investigate it further and introduce workaround from my end as well, to make sure it will not happen with Bolt or other third-party tools in future.

    It should be investigated on the Bolt side as well, since it may affect other assets and user code which uses Tasks, not ACTk alone.

    Hey, @Ludiq, could you please check it out?
     
    SuperMiro likes this.
  50. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,929
    @SuperMiro

    Problems seems to exist due to the System.Threading assembly Bolt adds to your project.
    It has Task type which conflicts with same type in same namespace from the built-in to the Unity netstandard assembly.

    I just reported it at the Bolt forum thread as well.