Library:Unity/Game folder layout
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(anddatapack.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 underStreamingAssets/aa/<platform>/, see Library:Unity/Addressables catalog); on iOS the folder isRaw/next toData/. AssetRipper scans it recursively for UnityFS headers.Resources/holdsunity default resourcesandunity_builtin_extra, which other files reference by name (older games keep them in aunity/folder).boot.config, see Library:Unity/Version and boot.config.- Mono only:
Managed/withAssembly-CSharp.dll,UnityEngine*.dll,mscorlib.dll(see Library:Mono). When noManaged/exists, AssetRipper looks for assemblies in the data folder and inlib/.
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>.exewith<Name>_Data; Unverified: a renamed exe or folder also breaks the player's own lookup. - Unverified: protected games may encrypt
global-metadata.dator 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.