Unity Decompiling Guide

Decompiling is the process of converting machine code into a high-level format. This allows to inspect and partially retrieve code from a compiled program. There are many reasons you might want to decompile a product:

  • Find flaws in the product
  • Recover the source code
  • Learn from others' code
  • Extract assets
  • Modify the product

This guide focuses on Unity games. It will not work for Unreal Engine or other game engines.

Warning: This guide is intended for educational purposes. Decompiling games may violate Terms of Service or local laws. Do not use this guide to distribute pirated software.

Step 1: Obtain the Game

You need access to the game's executable files. Avoid pirating the game — it's both unethical and illegal. Always own the game you're working with.

Step 2: Extract the Unity Project

  1. Download the correct Unity Editor

    Use a tool like BepInEx to detect the Unity version. Match the Unity Editor version accordingly. Mismatched versions may cause bugs.

  2. Download AssetRipper
    Get it from AssetRipper GitHub.
  3. Open AssetRipper.
  4. Go to File > Open File and select the game executable.
  5. Click Export > Export All Files.
  6. Choose a destination folder.
  7. Click Export Unity Project.
  8. Open the ExportedProject folder in Unity.

Note: The initial export may take time. Future loads should be faster.

Step 3: Fix Common Errors

If Unity prompts to open in Safe Mode, there are likely issues to fix.

Broken DLLs

Error message: "Unloading broken assembly 'AnyDLLFile'"

  1. Go to the Plugins folder.
  2. Select the broken DLL.
  3. In the Inspector, set the OS to Windows.
  4. Click Apply.

Black Scene

If the Scene window is blank, check the OS settings for these DLLs:

  • Unity.RenderPipelines.Universal.Runtime.dll
  • Unity.RenderPipelines.Core.Runtime.dll

Broken or Invisible Text

  1. Locate the shader used in the font material.
  2. Replace it with a clean version. If using TextMeshPro/Mobile/Distance Field, you can use this shader.
  3. Create a file named TMPro_Properties.cginc in the Shader folder. You can get the file from this source or a blank Unity project.