Skip to content

Commit 440df18

Browse files
author
imadr
authored
Merge pull request #10 from Virtual-World-RE/master
An improved, up-to-date and fixed guide.
2 parents 4bb385e + 1a2241c commit 440df18

File tree

1 file changed

+89
-69
lines changed

1 file changed

+89
-69
lines changed

README.md

Lines changed: 89 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,131 @@
1+
# Unity Game Hacking Guide
2+
13
This is a small guide for extracting and modifying assets or code from games made with the Unity engine. Feel free to contribute.
24

35
1. [Unity game folder structure](#unity-game-folder-structure)
46
2. [Extracting and editing code](#extracting-and-editing-code)
57
3. [Extracting assets](#extracting-assets)
68
4. [Hacking memory](#hacking-memory)
79

10+
811
## Unity game folder structure
912

1013
```
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
14+
│ *.exe
15+
└──*_Data
16+
│ globalgamemanagers
17+
│ globalgamemanagers.assets
18+
│ level0
19+
│ level0.resS
20+
...
21+
| levelN
22+
| levelN.resS
23+
| resources.assets
24+
| resources.assets.resS
25+
| resources.resource
26+
│ sharedassets0.assets
27+
│ sharedassets0.assets.resS
28+
...
29+
| sharedassetsN.assets
30+
| sharedassetsN.assets.resS
31+
├──Managed
32+
│ Assembly-CSharp.dll
33+
│ Assembly-UnityScript.dll
34+
│ Mono.Security.dll
35+
│ mscorlib.dll
36+
│ System.Core.dll
37+
│ System.dll
38+
│ UnityEngine.dll
39+
│ UnityEngine.dll.mdb
40+
│ UnityEngine.Networking.dll
41+
│ UnityEngine.UI.dll
42+
├──Mono
43+
│ │ mono.dll
44+
│ └──etc
45+
│ └──mono
46+
│ │ browscap.ini
47+
│ │ config
48+
│ ├──1.0
49+
│ │ DefaultWsdlHelpGenerator.aspx
50+
│ │ machine.config
51+
│ ├──2.0
52+
│ │ │ DefaultWsdlHelpGenerator.aspx
53+
│ │ │ machine.config
54+
│ │ │ settings.map
55+
│ │ │ web.config
56+
│ │ └──Browsers
57+
│ │ Compat.browser
58+
│ └──mconfig
59+
│ config.xml
60+
└──Resources
61+
unity default resources
62+
unity_builtin_extra
5863
```
5964

60-
\* : Name chosen during building
61-
6265
File/Directory | Description
6366
--- | ---
6467
*.exe | Executable file of the game
65-
*_Data | Data folder containing the game resources
68+
`*_Data` | Data folder containing the game resources
6669
level0-levelN | Files containing game scenes data, each scene has its own file
6770
sharedassets0-sharedassetsN | Game assets are split into sharedassets and .resS files (sharedassets.assets.split0 - ..splitN on platforms like Android/iOS)
6871
resources.assets | Raw Assets found in the project resources folders and their dependencies are stored in this file (as well as raw audio files, even if outside of Resources folder in Unity, AudioClips with references to .resource and info such as audio size/offset still stored inside .assets)
69-
Managed | Folder containing unity DLLs
72+
`Managed` | Folder containing unity DLLs
7073
Assembly-CSharp.dll | DLL file containing compiled C# files
7174
Assembly-UnityScript.dll | DLL file containing compiled UnityScript files
7275

76+
With ``*`` : The name of the main executable (.exe).
77+
78+
7379
## Extracting and editing code
7480

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.
81+
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.
7682

77-
DLLs can be decompiled using [ILSpy](http://ilspy.net/) or [dnSpy](https://github.com/0xd4d/dnSpy) which allow modifying and recompiling assembly files.
83+
DLLs can be decompiled using ILSpy, dnSpy, DotPeek or JustAssembly which allow modifying and recompiling assembly files.
84+
85+
If DLLs are missing from the managed directory, try dumping them using ``MegaDumper`` tool.
86+
87+
Tool | Decription
88+
--- | ---
89+
[ILSpy](https://github.com/icsharpcode/ILSpy) | Cross-platform .NET Decompiler with support for PDB generation, ReadyToRun, Metadata (&more).
90+
[DotPeek](https://www.jetbrains.com/decompiler/) | JetBrains DotPeek is a free .NET Decompiler and Assembly Browser.
91+
[dnSpyEx](https://github.com/dnSpyEx/dnSpy) | Unofficial revival of the well known .NET debugger and assembly editor, dnSpy. <br /> **Fork of ``dnSpy``.**
92+
[Telerik JustAssembly](https://www.telerik.com/justassembly) | Decompile and Compare .NET Assemblies. Binary Code Diff. Method Diff.
93+
[Cpp2IL](https://github.com/SamboyCoding/Cpp2IL) | Work-in-progress tool to reverse unity's IL2CPP toolchain.
94+
[Il2CppDumper](https://github.com/Perfare/Il2CppDumper) | Unity il2cpp reverse engineer.
95+
[dnSpy](https://github.com/dnSpy/dnSpy) <br /> ![No Longer Maintained](https://img.shields.io/badge/No%20Longer%20Maintained-red.svg) | dnSpy is a debugger and .NET assembly editor. You can use it to edit and debug assemblies even if you don't have any source code available. <br /> **Working but you can use ``dnSpyEx`` instead.**
96+
[MegaDumper](https://github.com/CodeCracker-Tools/MegaDumper) <br /> ![No Longer Maintained](https://img.shields.io/badge/No%20Longer%20Maintained-red.svg) | Dump native and .NET assemblies.
7897

79-
If DLLs are missing from the managed directory, try dumping them using this tool [MegaDumper](https://github.com/CodeCracker-Tools/MegaDumper)
8098

8199
## Extracting assets
82100

83-
Assets are stored in the .assets and .resS files. Content of these files can be unpacked with one of these tools :
101+
Assets are stored in the .assets and .resS files.
102+
Content of these files can be unpacked with one of these tools :
84103

85104
Tool | Description
86105
--- | ---
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) |
106+
[AssetRipper](https://github.com/AssetRipper/AssetRipper) | AssetRipper is a tool for extracting assets from serialized files (CAB-*, *.assets, *.sharedAssets, etc.) and assets bundles (*.unity3d, *.bundle, etc.) and converting them into the native Unity engine format. <br /> **Fork of ``uTinyRipper``.**
107+
[Unity Assets Bundle Extractor](https://github.com/SeriousCache/UABE) | UABE is an editor for 3.4+/4/5/2017-2021.3 .assets and AssetBundle files. It can create standalone mod installers from changes to .assets and/or bundles.
108+
[QuickBMS](https://aluigi.altervista.org/quickbms.htm) with [this script](https://aluigi.altervista.org/bms/unity.bms) or [this one for webplayer](https://aluigi.altervista.org/bms/unity3d_webplayer.bms) | universal script based files extractor and reimporter. QuickBMS supports tons of games and file formats, archives, encryptions, compressions, obfuscations and other algorithms.
92109
[DevXUnityUnpacker](https://devxdevelopment.com/Unpacker) | A (paid) tool with a friendly GUI meant for restoring unity projects by inputting the built game/app including a previewer for individual files as image, hex, text etc.
93-
[UnityEX](https://yadi.sk/d/m3vFWoQ3j62Cr) | Tool for extracting/converting files from .assets bundles and replacing files (Mostly used for replacing textures).
94-
110+
[uTinyRipper](https://github.com/mafaca/UtinyRipper) <br /> ![No Longer Maintained](https://img.shields.io/badge/No%20Longer%20Maintained-red.svg) | 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. <br /> **Use ``AssetRipper`` Instead**
111+
[Unity Studio / AssetStudio](https://github.com/RaduMC/AssetStudio) <br /> ![No Longer Maintained](https://img.shields.io/badge/No%20Longer%20Maintained-red.svg) | AssetStudio is an independent tool for exploring, extracting and exporting assets.
112+
[Unity Assets Explorer](https://zenhax.com/viewtopic.php?t=36) <br /> ![No Longer Maintained](https://img.shields.io/badge/No%20Longer%20Maintained-red.svg) | Unity Assets Explorer is used to view the contents of Assets-files (Unity 3D engine). Allows you to: Extract all files, extract one file (from context menu), convert tex-files into a picture format DDS (on extraction), import the changed DDS-images to the archive.
95113

96-
#### DDS files :
114+
> **Do not use UnityEX**, it is most likely a virus.
97115
98-
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).
116+
### DDS files :
99117

100-
#### Another way of extracting meshes and textures :
118+
The [DDS](https://en.wikipedia.org/wiki/DirectDraw_Surface) files can be opened/converted/edited with the following tools :
101119

102-
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/).
103-
104-
Alternatives:
105120
Tool | Tutorial
106121
--- | ---
122+
[Ninja Ripper](https://ninjaripper.com/) | Extract (rip) 3D scenes from games and explore them in 3D editor (Blender, 3D Max, Noesis). <br /> [An old guide](http://cgig.ru/en/2012/10/ho-to-use-ninja-ripper/) on how to use Ninja Ripper. <br /> The official [YouTube Channel](https://www.youtube.com/channel/UCgT-ET20KlC4AcECNtW9gyw) can be usefull for latest video tutorial.
107123
[RenderDoc](https://renderdoc.org/) | [Tutorial](https://www.youtube.com/watch?v=yPLxCm3SyPU) on how to use RenderDoc.
108-
[Intel® Graphics Performance Analyzers](https://software.intel.com/content/www/us/en/develop/tools/graphics-performance-analyzers.html) | [Tutorial](https://forum.xentax.com/viewtopic.php?t=12262) on how to use the Intel Graphics Analyzers to extract graphics.
124+
[NVIDIA Texture Tools Exporter](https://developer.nvidia.com/nvidia-texture-tools-exporter) | The NVIDIA Texture Tools Exporter allows users to create highly compressed texture files - that stay small both on disk and in memory - directly from image sources using NVIDIA’s CUDA-accelerated Texture Tools 3.0 compressor technology. <br /> **Can be used as a standalone software or as an Adobe Photoshop Plugin**.
125+
[Intel® Graphics Performance Analyzers](https://www.intel.com/content/www/us/en/developer/tools/graphics-performance-analyzers/overview.html) | Improve your game's performance by quickly identifying problem areas. <br /> [Tutorial](https://forum.xentax.com/viewtopic.php?t=12262) on how to use the Intel Graphics Analyzers to extract graphics.
126+
[Gimp Plugin](https://code.google.com/archive/p/gimp-dds/downloads) | This is a plugin for GIMP version 2.8.x. It allows you to load and save images in the Direct Draw Surface (DDS) format.
127+
[3D Ripper DX](http://www.deep-shadows.com/hax/3DRipperDX.htm) | This soft doesn't support 64 bits binaries.
128+
109129

110130
## Hacking memory
111131

0 commit comments

Comments
 (0)