[RELEASED v5.5.0] Obfuscator - Protect your game source code!

An Obfuscator is a software tool designed to transform the source code of a game, app or program into a version that is significantly more difficult for humans to understand, while still maintaining its original functionality. It does this by renaming variables, methods, and classes to nonsensical or misleading names, and by altering the code structure in ways that obscure its logic and flow.

GuardingPearSoftware’s developed Obfuscator is designed for Unity, it considers Unity’s unique characteristics, like MonoBehaviours, ScriptableObjects, Serialization and Reflection, giving you a powerful but easy, and out-of-the box working tool.

Integration

Game developers face a mountain of tasks every day. That’s why our Obfuscator was designed for seamless integration into your existing workflow. No complex setup, no headaches – just pure plug & play functionality. Once activated, it automatically obfuscates your code during each build, effortlessly safeguarding your game without slowing you down.

Code - Example

The most important and known feature of an Obfuscator is the so called ‘Lexical Obfuscation’. This technique targets the most accessible elements of your code: the identifiers. For instance, class names like ‘Game’ could be transformed into ‘a’, method names such as ‘Fly’ might become ‘e’, and field names like ‘Speed’ could turn into ‘c’. This process strips away the semantic meaning that makes the code understandable, significantly increasing its difficulty to interpret.

String - Example

String obfuscation is a technique that transforms readable strings in your code into a format that is difficult to understand or recognize. This provides the advantage of protecting sensitive information, from being easily extracted or deciphered by unauthorized users.

Control Flow - Example

Deliberate obscuring the natural flow of your code, dictated by loops, conditional statements, and function calls. Imagine a labyrinthine structure where the path is convoluted, making it difficult to follow the program’s logic.

Security - Example

Additional security measures are also available to enhance your application’s protection. These include generating random code, suppressing ILDasm (the disassembler in the IDE), and implementing micro checks. These techniques make your code more difficult for attackers to read and analyze, thereby increasing overall security.

Settings

Since every game is unique, it requires a customized approach to protection. The Obfuscator offers a wide range of customizable settings that allow you to fine-tune the protection strategy that best suits the needs of your game.

Documentation

Obfuscator Pro is packed with plenty of manuals and tutorials, enabling you to dive straight into securing your game!

Documentation and Scripting Api Reference

Platforms

All platforms Unity supports. Includes Mono and IL2CPP.

Contact

From developers for developers since 2017! If you have any questions feel free to ask.

Contact: guardingpearsoftware@gmail.com

Website: guardingpearsoftware.com

Release of Obfuscator 5.3.0: iOS Update

  • Improvement: Unity animation compatibility - You can now customize where animation callbacks should be automatically searched (models, animation clips, animator controllers).
  • Improvement: Unity event compatibility - You can now customize where event callbacks should be automatically searched (scenes, prefabs).
  • Fix: iOS build - MonoBehaviours were not obfuscated correctly in Unity 2022+ iOS builds. Resulting in MonoBehaviours failed to be resolved while runtime.

Release of Obfuscator 5.3.1: Hotfix Update

  • Fix: Error while obfuscating data.unity3d file : Unable to read beyond the end of the stream.

Hello.
I bought this tool in 2018 and used it a couple of times, because it took forever to finish the processes it does.

Today I got it working again, and it takes more than 20 minutes. My game is usually compiled in 7-8 minutes.

Will this time be like this always or only the first time?

Thank you.

image

After 42 minutes, the process has been completed. However, when I run the game, I get a black screen.

And nothing more than that.

I have left the parameters as they came by default.

Hello @Barritico, thank you for your long trust.

The Obfuscator analyzes the assets (scenes, prefabs, …) for compatibility with obfuscation. This might take some time, but you can deactivate it under the Compatibility tab:

But then you have to skip unity event methods, attached through the editor, manually from obfuscation using the “DoNotRename” attribute.

To the blackscreen, feel free to write me an email at guardingpearsoftware@gmail.com and we can have a look at this together.

Hi GuardingPearSoftware !

  1. Is it possible to specify a list of folders that you want to be ofuscated ? (or a list of folders to be excluded from ofuscation ?) Is it possible in the free version ?

  2. How do it differs the free version from the Unity built-in Minify option from Publishing Settings ?

  3. I made a test on a new project with some sample class and a sample struct and it seems that it doesn’t rename the struct names.

  4. It doesn’t work with Fishnet asset, because it enters in build loop. To test, just import Fishnet free version from Unity Asset Store.

  5. It would be nice to see the changed code in the project and then build it and, lastly, undo changes with Git.

Thanks !

Unfortunately no, in the “context” of build code, you only know the namespace and class name. But you can define namespaces you want to exclude/include from obfuscation.

The Android Minify option uses Gradle’s minimize component which is very similar to the Free Obfuscator version in case of Android.

It is possible that the Obfuscator automatically detects the struct as a serializable data class, which will be skipped by default from obfuscation. To make sure no stored data will break. But you can activate the obfuscation of those. And you can also see the specific cause for not obfuscation in the obfuscation build logs.

Thank you, I will have a look at this!

The Obfuscator only obfuscates build assemblies and so applies only at build time. So obfuscation of the source files in the project itself is not possible.

1 Like

hello, the asset store listing mentions this works for IL2CPP and iOS/Android builds.
Can you explain how it works? does it obfuscate the CPP code after compilation, or is it before?

hi, can you explain better how to do builds with CI pipeline? does it work automatically? I didn’t understand the documentation. Why is it starting the game as part of the build process?

using UnityEditor;
using System.Diagnostics;

public class ScriptBatch 
{
    [MenuItem("MyTools/Windows Build With Postprocess")]
    public static void BuildGame ()
    {
        // Get filename.
        string path = EditorUtility.SaveFolderPanel("Choose Location of Built Game", "", "");
        string[] levels = new string[] {"Assets/Scene1.unity", "Assets/Scene2.unity"};

        // Build player.
        BuildPipeline.BuildPlayer(levels, path + "/BuiltGame.exe", BuildTarget.StandaloneWindows, BuildOptions.None);

        // Copy a file from the project folder to the build folder, alongside the built game.
        FileUtil.CopyFileOrDirectory("Assets/Templates/Readme.txt", path + "Readme.txt");

        // Run the game (Process class from System.Diagnostics).
        Process proc = new Process();
        proc.StartInfo.FileName = path + "/BuiltGame.exe";
        proc.Start();
    }
}

Thank you for your question. Unity builds the c# source code into assemblies (.dll files), and here the Obfuscator hooks in, and obfuscates those assemblies. If you build a mono game, the build process is done after this. If you build a il2cpp game, Unity takes this build and obfuscated assemblies and interprets them to cpp.

This methods starts the internal Unity build process (The build window does the same, but only by pressing a button). The build process has multiple hooks a developer can hook in. And so does the Obfuscator do obfuscate the build game code.

Release of Obfuscator 5.3.2: Hotfix Update 2

  • Fix: Error while obfuscating data.unity3d file ‘…/data.unity3d’: Value cannot be null. Parameter name: _Assembly
  • Compatibility: Most compatibility components can now be manually activated or deactivated. Default is activated.

Release of Obfuscator 5.4.0: Mapping - Update

  • Feature: The obfuscation mapping can now be loaded from a web endpoint (Get) and saved at a web endpoint (Post).
  • Improvement: If an obfuscation mapping could not be saved in the location specified by the user, it is saved in the obfuscator temp directory ‘Assets\OPS\Obfuscator\Temp’ [thanks David].

Before building the game with a script, I would like to turn on/off the global settings of OPS. Is there a way to do it with a script?

And can you tell me how to specify the mapping file save file name/location before building?

I think found that.

var setting = ObfuscatorSettings.Load();
setting.Add_Or_UpdateSettingElement("Global_Enable_Obfuscation", enable);
setting.Save();

Yes, that’s the best way to do it, the obfuscator only listens to the settings file at the moment, a programmatic way to enable/disable is not currently added. So manipulating the settings file directly is the best option.

When you got to: OPS->Obfuscator->Settings in the Optional Tab under the Renaming Settings, you can define a custom file to load/save the mapping from/to. The path can be a full or relative path. I recommend using a relative path, so the mapping file is relative to your unity project directory.

You can also use a web endpoint with the new version to GET or POST the mapping file. For the future I will try to support Github actions too.

Hello,

I am using Unity 6000.0.25 and Obfuscator Pro 5.4.0. As shown in the screenshot, there is an issue where no buttons are visible in the settings window.

How can I resolve this?

Thanks,

Thanks @JoonShim for your question. This happens if you move the Obfuscator directory. At the moment it has to stay at the installation location because of fixed file paths.


obfuscator compete?