Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Library:Unity/Game folder layout

From ReverseEngineering.wiki
Topic page of Library:Unity.

Where a built Unity game keeps its player, data folder, Mono assemblies or IL2CPP library and metadata, per platform, as AssetRipper's game-structure detection expects it.

Overview

A Unity build has a native player, a data folder and a scripting backend. The backend is told apart by files: a data folder with Managed/*.dll is Mono; a native game library plus global-metadata.dat is IL2CPP (Format:IL2CPP global-metadata.dat). AssetRipper checks IL2CPP first (both the library and the metadata must exist), then Mono (at least one *.dll in the managed folder), else the backend is unknown (Source/AssetRipper.Import/Platforms/*GameStructure.cs, PlatformGameStructure.cs).

Layout per platform

Platform Data folder Native player IL2CPP library Metadata
Windows <Name>_Data/ next to <Name>.exe (or a folder Data/ when several exes exist) UnityPlayer.dll beside the exe GameAssembly.dll beside the exe <Name>_Data/il2cpp_data/Metadata/global-metadata.dat
Linux <Name>_Data/ next to <Name>.x86, .x64, .x86_64 or an extensionless file UnityPlayer.so GameAssembly.so <Name>_Data/il2cpp_data/Metadata/global-metadata.dat
macOS <Name>.app/Contents/Resources/Data/ Contents/Frameworks/UnityPlayer.dylib Contents/Frameworks/GameAssembly.dylib Data/il2cpp_data/Metadata/global-metadata.dat
Android (APK) assets/bin/Data/ not checked (libunity.so is named in the source) lib/<abi>/libil2cpp.so assets/bin/Data/Managed/Metadata/global-metadata.dat
iOS (IPA) Payload/<Name>.app/Data/ none (linked into the app) the app's main executable Payload/<Name>.app/<Name> Data/Managed/Metadata/global-metadata.dat
Nintendo Switch romfs/Data/ - exefs/main Data/Managed/Metadata/global-metadata.dat
PlayStation 4 Media/ (next to eboot.bin) - Media/Modules/Il2CppUserAssemblies.prx Media/Metadata/global-metadata.dat
WebGL Build/ (and Development/Release variants) - no IL2CPP library file: compiled into the .wasm -

The Switch and PS4 paths are as AssetRipper builds them; the folder names inside romfs and Media were not otherwise checked.

Inside the data folder

  • Primary engine files: globalgamemanagers, globalgamemanagers.assets, mainData (old games), resources.assets, levelN, sharedassetsN.assets. All are Format:Unity serialized files; Unverified: large ones may be split into .split0, .split1, ... parts (AssetRipper handles a multi-part stream class for them).
  • data.unity3d (and datapack.unity3d, only in Android universal APKs built from an AAB) is a Format:Unity asset bundle (UnityFS) that holds these files instead of loose ones; its header carries the Unity version.
  • StreamingAssets/ holds bundles copied as they are (Addressables bundles live under StreamingAssets/aa/<platform>/, see Library:Unity/Addressables catalog); on iOS the folder is Raw/ next to Data/. AssetRipper scans it recursively for UnityFS headers.
  • Resources/ holds unity default resources and unity_builtin_extra, which other files reference by name (older games keep them in a unity/ folder).
  • boot.config, see Library:Unity/Version and boot.config.
  • Mono only: Managed/ with Assembly-CSharp.dll, UnityEngine*.dll, mscorlib.dll (see Library:Mono). When no Managed/ exists, AssetRipper looks for assemblies in the data folder and in lib/.

Crash handler

Unverified: Windows builds of recent Unity versions also ship UnityCrashHandler64.exe (UnityCrashHandler32.exe for 32-bit builds) beside the player; it is a separate crash reporter process that the player starts, not game code, and can be ignored when reversing the game. The AssetRipper source read does not mention it. To check: look for it next to the exe and at its start in a process monitor.

Pitfalls

  • AssetRipper pairs <Name>.exe with <Name>_Data; Unverified: a renamed exe or folder also breaks the player's own lookup.
  • Unverified: protected games may encrypt global-metadata.dat or move the Mono assemblies elsewhere; absence of the files is not proof of the other backend.

Related

Library:Unity, Library:Mono, Format:IL2CPP global-metadata.dat.