Search Unity

Anti-Cheat Toolkit: stop cheaters easily!

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

  1. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Sure, there are various protectors for different platforms, such as VMProtect for PC, DexGuard for Android and so on.
    I'd also suggest taking a look at the Mfuscator which does encrypts IL2CPP metadata and defeats most one-click hacking tools for IL2CPP builds.
     
  2. Mad_Llama

    Mad_Llama

    Joined:
    Aug 18, 2013
    Posts:
    5
    Thanks!! Very useful information!
     
  3. vnqq23021998

    vnqq23021998

    Joined:
    Nov 21, 2023
    Posts:
    1
    hi guys, i got error when load file json from resources after decrypt from class ObscuredFile with password, i don't know why, but in the editor, it also working, this is my path file in editor,
    Please let me know what I'm missing
    upload_2024-1-31_9-52-3.png upload_2024-1-31_9-48-40.png
     
  4. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Greetings, looks like you're trying to read a file from Unity's Resources using a direct path, but file is actually compressed in Android builds and should be read using Resources.* API. Just try opening your apk with any zip archiver and you'll see there is no file you're looking for inside the apk in the loose form.

    You can read it from Resources using Unity API into the byte array, save it to the regular file into the persistent or temporary location with usual File IO and then open it with ObscuredFile.
     
  5. OkeanixTR

    OkeanixTR

    Joined:
    Jan 28, 2017
    Posts:
    46
    How to use with Opsive's Ultimate Character Controller not just Behaviour Designer, if i try to make opsive classes obscured whole things break.
     
    Last edited: Feb 1, 2024
  6. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Hey @OkeanixTR UCC doesn't have an integration with ACTk unfortunately, please reach out to the UCC support to find out if it's possible to use custom classes in there and for any further assistance.
     
  7. OkeanixTR

    OkeanixTR

    Joined:
    Jan 28, 2017
    Posts:
    46
    I banned 30 speedhackers in 2 days in an Android game. They somehow managed to bypass the Speedhack detector. When I try using tools like Cheat Engine, it detects my speedhack.
    (They don't modify character movement speed, every code they execute is a lot faster)

    Did they somehow disable Anti-Cheat Toolkit (ACTK) detectors? How can I write a script that checks if the detector is running or stopped? If it's stopped, how can I force the player to restart the game?

    I also use Obfuscation.
     
  8. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    You could have some advanced hackers who know how to reverse-engineer and patch obfuscated apps.

    I'd suggest trying native protector to cover your app from this threat and prevent debugging, runtime code patching and such. There are plenty of various protectors for Android to choose from, with different pricing models: MFuscator, LIAPP, Skyforce, DexGuard etc.
     
  9. GiangPuzzle

    GiangPuzzle

    Joined:
    Mar 11, 2021
    Posts:
    9
    Hello, I have found that when using ObscuredInt, cheating is still possible using GameGuardian with the following method: Perform a search by adding X4 after the number to be searched, for example, if the ObscuredInt variable a = 2000, simply searching for 2000X4 in GG will reveal the memory address of hiddenValue within the ObscuredInt struct, and when changing the value like that, the InternalDecrypt() function will detect the cheater, at which point the cheater will change the position of StartDetected to StopDetected or ~A8 RET method callback of the cheat detection event. So, in this case, cheating and value changes still occur normally. Is there any way to fix this issue? Thank you.
    upload_2024-2-18_23-0-18.png
     
  10. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Hey, yeah, advanced skilled cheaters who know how to reverse-engineer can hack anything on the client side and can patch game code in memory, for example.
    ACTk doesn't resist the reverse-engineering threat. Thus, I do always recommend hardening your build with obfuscation and native protection, please read more in the readme's "Code obfuscation and overall code protection notes" chapter, and you are welcome to pm any specific questions on reverse-engineering resistance, I'll be happy to help!
     
  11. GiangPuzzle

    GiangPuzzle

    Joined:
    Mar 11, 2021
    Posts:
    9
    Hi @codestage , I met the issue when building game with IL2CPP, but if select Script Backend is Mono, it's working. I using the latest anti cheat toolkit version. The issue detail:

    Exception: Failed running C:\Program Files\Unity\Hub\Editor\2020.3.47f1\Editor\Data\il2cpp\build/deploy/netcoreapp3.1/UnityLinker.exe @D:/Projects/WoodPlusBlock/Temp/StagingArea/assets/bin/Data/Managed/response.rsp

    stdout:
    ERROR: Failed to resolve base type [[]][][][]][[][]]]]]]][[[]]]][[][]][[[[[][]][]] for type [[[][[[]][[[[[][][][[][[]]]]][[]][][[]]][[][[]] in assembly ACTk.Runtime.dll when linking against the UnityAot profile
    Fatal error in Unity CIL Linker
    Unity.Linker.StrippingResolutionBaseTypeException: ERROR: Failed to resolve base type [[]][][][]][[][]]]]]]][[[]]]][[][]][[[[[][]][]] for type [[[][[[]][[[[[][][][[][[]]]]][[]][][[]]][[][[]] in assembly ACTk.Runtime.dll when linking against the UnityAot profile
    at Unity.Linker.MonoBehaviorUtilities.DerivesFrom(UnityLinkContext context, TypeDefinition type, String[] possibleBaseNames)
    at Unity.Linker.MonoBehaviorUtilities.IsOrDerivesFrom(UnityLinkContext context, TypeDefinition type, String[] possibleBaseNames)
    at Unity.Linker.MonoBehaviorUtilities.IsMonoBehaviourOrScriptableObject(UnityLinkContext context, TypeDefinition type)
    at Unity.Linker.Steps.Rooting.ResolveFromMonoBehaviours.<Process>b__6_0(TypeDefinition t)
    at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
    at Unity.Linker.Steps.Rooting.ResolveFromMonoBehaviours.Process(LinkContext context)
    at Mono.Linker.Pipeline.ProcessStep(LinkContext context, IStep step)
    at Unity.Linker.UnityPipeline.ProcessStep(LinkContext context, IStep step)
    at Mono.Linker.Pipeline.Process(LinkContext context)
    at Unity.Linker.UnityDriver.UnityRun(ILogger customLogger)
    at Unity.Linker.UnityDriver.RunDriverWithoutErrorHandling(ILogger customLogger)
    at Unity.Linker.UnityDriver.RunDriver()
    stderr:

    UnityEditorInternal.Runner.RunProgram (UnityEditor.Utils.Program p, System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser) (at <3e401efa0ce4422582abd640a807e261>:0)
    UnityEditorInternal.Runner.RunNetCoreProgram (System.String exe, System.String args, System.String workingDirectory, UnityEditor.Scripting.Compilers.CompilerOutputParserBase parser, System.Action`1[T] setupStartInfo) (at <3e401efa0ce4422582abd640a807e261>:0)
    UnityEditorInternal.AssemblyStripper.RunAssemblyLinker (System.Collections.Generic.IEnumerable`1[T] args, System.String& out, System.String& err, System.String linkerPath, System.String workingDirectory) (at <3e401efa0ce4422582abd640a807e261>:0)
    UnityEditorInternal.AssemblyStripper.StripAssembliesTo (System.String outputFolder, System.String& output, System.String& error, System.Collections.Generic.IEnumerable`1[T] linkXmlFiles, UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <3e401efa0ce4422582abd640a807e261>:0)
    UnityEditorInternal.AssemblyStripper.RunAssemblyStripper (UnityEditorInternal.UnityLinkerRunInformation runInformation) (at <3e401efa0ce4422582abd640a807e261>:0)
    UnityEditorInternal.AssemblyStripper.StripAssemblies (System.String managedAssemblyFolderPath, UnityEditorInternal.BaseUnityLinkerPlatformProvider unityLinkerPlatformProvider, UnityEditorInternal.IIl2CppPlatformProvider il2cppPlatformProvider, UnityEditor.RuntimeClassRegistry rcr, UnityEditor.ManagedStrippingLevel managedStrippingLevel) (at <3e401efa0ce4422582abd640a807e261>:0)
    UnityEditorInternal.IL2CPPBuilder.Run () (at <3e401efa0ce4422582abd640a807e261>:0)
    UnityEditorInternal.IL2CPPUtils.RunIl2Cpp (System.String tempFolder, System.String stagingAreaData, UnityEditorInternal.IIl2CppPlatformProvider platformProvider, System.Action`1[T] modifyOutputBeforeCompile, UnityEditor.RuntimeClassRegistry runtimeClassRegistry) (at <3e401efa0ce4422582abd640a807e261>:0)
    UnityEditor.Android.PostProcessor.Tasks.RunIl2Cpp.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <22b0bbbaead14b9cb1b4d2a9a9cd4275>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <22b0bbbaead14b9cb1b4d2a9a9cd4275>:0)
    UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <22b0bbbaead14b9cb1b4d2a9a9cd4275>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <22b0bbbaead14b9cb1b4d2a9a9cd4275>:0)
    UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <3e401efa0ce4422582abd640a807e261>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
  12. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Greetings, looking weird!

    Could you please let me know your Unity version and target platform?
    Does it also reproduce in a new empty project for you?
    And do you use obfuscation of any sort?
     
  13. GiangPuzzle

    GiangPuzzle

    Joined:
    Mar 11, 2021
    Posts:
    9
    I use Unity 2020.3.47f1 and build to Android platform.
    I upgrade project with Anti cheat toolkit ver 2021 to new version. I was deleting toolkit 2021 before importing new version of anti-cheat toolkit.
    My project use Obfuscation of Beebyte.
     
  14. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Thanks for all the details!

    I tried making a demo scene build in a new project from 2020.3.47 and couldn't reproduce the problem so far.

    Could you try disabling obfuscation and check if the problem still persists? If so, will it have a different error message?

    Also still wonder if it reproduce in a new empty project for you