Protecting Unity compiled game with Enigma Protector

This thread is for tutorials only!
Post Reply
snura
Posts: 15
Joined: Sat Sep 05, 2009 11:58 pm

Protecting Unity compiled game with Enigma Protector

Post by snura »

This is my second installment after quite understanding ins and outs of unity compiled games,
The most important things in unity compiled game are :

Code: Select all

unity-player-exe-name_Data/sharedassets[NUMBERS].assets
unity-player-exe-name_Data/Managed/Assembly-CSharp*.dll
unity-player-exe-name_Data/Managed/Mono*.dll
unity-player-exe-name_Data/Managed/System*.dll
unity-player-exe-name_Data/Managed/Unity*.dll
Note : * (asterisk) means all filename matching any alphabetically naming for example : Assembly-CSharp-firstpass.dll, System.Core.dll, Mono.Security.dll, UnityEngine.UI.dll, UnityEngine.Networking.dll, etc.

The Idea behind these is to using "CHECK-UP" -> "External Files" for protecting unity-player-exe-name_Data/sharedassets[NUMBERS].assets and engima protector's virtual box function to protect the dll.

Why not protecting the sharedassets[NUMBERS].assets inside virtual box? because as you know, most of the unity's assets are bundled into those sharedassets[NUMBERS].assets format, and some times the file size might goes above gigabytes of size (depending on your project). So it wise to just use checksum, filesize, datetime check in this "CHECK-UP" -> "External Files" checks.

Enough into, let gets into working on protections :
  • 1. Build the attached example project using unity (in this example, it reside "Built" folder.
    2. Open Up enigma protector, setup the Input -> "select file to protect" as "Enigma.exe" (in this example project), and tick "Output file name is same as input file".
    3. Enter any details or left as it is the "Produt Information"
    4. Make sure to left minimal protection options in enigma protector as we need to make sure first that the protected files are working as it should.
    5. Now go to "CHECK-UP" (expand it) -> "External Files"
    6. Right click on "Checkup Files", "New Root Folder" -> "%DEFAULT FOLDER%", why this means is to make sure enigma correctly checking in to current folder in which the "Enigma.exe" is located.
    7. Highlight and right click the "%DEFAULT FOLDER%" and put it the name "unity-player-exe-name_Data" in this example the unity player executable name is "Engima.exe" so put it "Enigma_Data"
    8. Highlight and right click the "Enigma_Data" and choose "Add File(s)", a browse dialog box will appear, and browse into "Enigma_Data" folder, and pick one file "sharedassets0.assets" -> Click "Open" Button.
    9. Highlight and right click the "sharedassets0.assets" and pick "properties", tick "checksum", "datetime", "size".
    10. Now protecting the sharedassets files has finished in this unity example project, go on next steps.
    11. On "VIRTUAL-BOX" -> "Files", tick the "Enable Files Virtualization", "Delete Extracted files on exit" and "Compress files" (might slow down the protected executable loading times! but minizing the protected executable file!.).
    12. Highlight and right click the "Virtual Box Files" and pick "%DEFAULT FOLDER%" -> click "OK".
    13. Highlight and right click the "%DEFAULT FOLDER%" and choose "New Folder" and name it as "Enigma_Data"
    14. as the dll is inside the "%DEFAULT FOLDER%/Enigma_Data/Managed", highlight and right click the "Enigma_Data" and choose "New Folder" and name it as "Managed".
    15. Highlight and right click the "Managed" and choose "Add file(s)", browse to "Enigma_Data/Managed", and pick files "Assembly-CSharp.dll", "Mono.Security.dll" , "System.Core.dll", "System.dll", "UnityEngine.dll", "UnityEngine.Networking.dll", "UnityEngine.UI.dll".
    16. This is quite important, on "VIRTUAL BOX" -> "Options", check / tick the "share the virtual system to child processes".
    17. Click "Protect" button.
As "Assembly-CSharp.dll", "Mono.Security.dll" , "System.Core.dll", "System.dll", "UnityEngine.dll", "UnityEngine.Networking.dll", "UnityEngine.UI.dll" is already inside the protected executable, you can delete now the :

Code: Select all

Enigma_Data\Managed\Assembly-CSharp.dll
Enigma_Data\Managed\Mono.Security.dll
Enigma_Data\Managed\System.Core.dll
Enigma_Data\Managed\System.dll
Enigma_Data\Managed\UnityEngine.dll
Enigma_Data\Managed\UnityEngine.Networking.dll
Enigma_Data\Managed\UnityEngine.UI.dll
Congratulations!, now you have protected the example unity compiled game with no noticeable performance downgrade (you can check it by noticing the fps counter on top left corner).

Note : I suggest to obfuscating the codes or dlls first before protecting it with enigma protector, as enigma protector specific use is not for protecting .net applications, enigma protector only means to add another layer of 'security' & 'protection', this doesn't means that 'motivated' & 'experienced' individuals won't be able to crack/hack your games but it just mean to protect you from 'script kiddies'.

Notable unity specifics obfuscator can be found hereand here.

Video tutorial coming soon.

You can download the Enigma protector & Unity Project files in here.

Note : Needs winrar 5.x to open the archive!.
Enigma
Site Admin
Posts: 3019
Joined: Wed Aug 20, 2008 2:24 pm

Re: Protecting Unity compiled game with Enigma Protector

Post by Enigma »

Hi snura,

Very great and carefully explianed tutorial!

Thank you very much!

Could you please contact us at support@enigmaprotector.com, we would like to share your tutorial on our blog site!
Post Reply