|
| 1 | +This is a small guide for extracting and modifying assets or code from games made with the Unity engine. Feel free to contribute. |
| 2 | + |
| 3 | +1. [Unity game folder structure](#unity-game-folder-structure) |
| 4 | +2. [Extracting and editing code](#extracting-and-editing-code) |
| 5 | +3. [Extracting assets](#extracting-assets) |
| 6 | +4. [Hacking memory](#hacking-memory) |
| 7 | + |
| 8 | +## Unity game folder structure |
| 9 | + |
| 10 | +``` |
| 11 | +│ *.exe |
| 12 | +└───*_Data |
| 13 | + │ globalgamemanagers |
| 14 | + │ globalgamemanagers.assets |
| 15 | + │ level0 |
| 16 | + │ level0.resS |
| 17 | + ... |
| 18 | + | levelN |
| 19 | + | levelN.resS |
| 20 | + │ sharedassets0.assets |
| 21 | + │ sharedassets0.assets.resS |
| 22 | + ... |
| 23 | + | sharedassetsN.assets |
| 24 | + | sharedassetsN.assets.resS |
| 25 | + | resources.assets |
| 26 | + ├───Managed |
| 27 | + │ Assembly-CSharp.dll |
| 28 | + │ Assembly-UnityScript.dll |
| 29 | + │ Mono.Security.dll |
| 30 | + │ mscorlib.dll |
| 31 | + │ System.Core.dll |
| 32 | + │ System.dll |
| 33 | + │ UnityEngine.dll |
| 34 | + │ UnityEngine.dll.mdb |
| 35 | + │ UnityEngine.Networking.dll |
| 36 | + │ UnityEngine.UI.dll |
| 37 | + ├───Mono |
| 38 | + │ │ mono.dll |
| 39 | + │ └───etc |
| 40 | + │ └───mono |
| 41 | + │ │ browscap.ini |
| 42 | + │ │ config |
| 43 | + │ ├───1.0 |
| 44 | + │ │ DefaultWsdlHelpGenerator.aspx |
| 45 | + │ │ machine.config |
| 46 | + │ ├───2.0 |
| 47 | + │ │ │ DefaultWsdlHelpGenerator.aspx |
| 48 | + │ │ │ machine.config |
| 49 | + │ │ │ settings.map |
| 50 | + │ │ │ web.config |
| 51 | + │ │ └───Browsers |
| 52 | + │ │ Compat.browser |
| 53 | + │ └───mconfig |
| 54 | + │ config.xml |
| 55 | + └───Resources |
| 56 | + unity default resources |
| 57 | + unity_builtin_extra |
| 58 | +``` |
| 59 | + |
| 60 | +\* : Name chosen during building |
| 61 | + |
| 62 | +File/Directory | Description |
| 63 | +--- | --- |
| 64 | +*.exe | Executable file of the game |
| 65 | +*_Data | Data folder containing the game resources |
| 66 | +level0-levelN | Files containing game scenes data, each scene has its own file |
| 67 | +sharedassets0-sharedassetsN | Game assets are split into sharedassets and .resS files |
| 68 | +resources.assets | Assets found in the project resources folders and their dependencies are stored in this file |
| 69 | +Managed | Folder containing unity DLLs |
| 70 | +Assembly-CSharp.dll | DLL file containing compiled C# files |
| 71 | +Assembly-UnityScript.dll | DLL file containing compiled UnityScript files |
| 72 | + |
| 73 | +## Extracting and editing code |
| 74 | + |
| 75 | +C# and UnityScript files are compiled into the Assembly-CSharp.dll and Assembly-UnityScript.dll DLLs respectively, which can be found inside the Managed folder. |
| 76 | + |
| 77 | +DLLs can be decompiled using [ILSpy](http://ilspy.net/) or [dnSpy](https://github.com/0xd4d/dnSpy) which allow modifying and recompiling assembly files. |
| 78 | + |
| 79 | +If DLLs are missing from the managed directory, try dumping them using this tool [MegaDumper](https://github.com/CodeCracker-Tools/MegaDumper) |
| 80 | + |
| 81 | +## Extracting assets |
| 82 | + |
| 83 | +Assets are stored in the .assets and .resS files. Content of these files can be unpacked with one of these tools : |
| 84 | + |
| 85 | +Tool | Description |
| 86 | +--- | --- |
| 87 | +[UtinyRipper](https://github.com/mafaca/UtinyRipper) | uTinyRipper is a tool for extracting assets from serialized files (CAB-*, *.assets, *.sharedAssets, etc.) and assets bundles (*.unity3d, *.assetbundle, etc.) and conveting them into native Engine format. |
| 88 | +[Unity Studio](https://github.com/RaduMC/UnityStudio) | A tool for exploring, extracting and exporting assets from Unity games and apps. |
| 89 | +[Unity Assets Bundle Extractor](https://7daystodie.com/forums/showthread.php?22675-Unity-Assets-Bundle-Extractor) | UABE is a tool that allow modification of assets file and extraction of assets in usable formats (png/tga for textures, obj for meshes). |
| 90 | +[Unity Assets Explorer](http://zenhax.com/viewtopic.php?f=9&t=36) | Can extract textures to .DDS format, meshes to .43 format. |
| 91 | +[QuickBMS](http://aluigi.altervista.org/quickbms.htm) with [this script](http://aluigi.altervista.org/bms/unity.bms) or [this one for webplayer](http://aluigi.org/papers/bms/unity3d_webplayer.bms) | |
| 92 | + |
| 93 | +#### DDS files : |
| 94 | + |
| 95 | +The [DDS](https://en.wikipedia.org/wiki/DirectDraw_Surface) files can be opened/converted/edited with this [gimp plugin](http://registry.gimp.org/node/70) or this [photoshop plugin](https://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop). |
| 96 | + |
| 97 | +#### Another way of extracting meshes and textures : |
| 98 | + |
| 99 | +Use [3D Ripper DX](http://www.deep-shadows.com/hax/3DRipperDX.htm) (doesn't support 64 bits binaries) or [Ninja Ripper](http://cgig.ru/en/2012/10/ho-to-use-ninja-ripper/). |
| 100 | + |
| 101 | +## Hacking memory |
| 102 | + |
| 103 | +Cheat engine have a feature called [Dissect mono](https://wiki.cheatengine.org/index.php?title=Mono) that can help hacking game's memory. This [video series](https://www.youtube.com/playlist?list=PLNffuWEygffbue0tvx7IusDmfAthqmgS7) about using cheat engine is really useful. |
0 commit comments