Reinforcement Learning – Hacking Unity Games, Part 2

In the first part I analyzed the folder structure of a Unity game. The next step is to access the data of the game.

In this blog, I will go over common tools for hacking Unity games.

Unity Assets Bundle Extractor

This tool can be used to analyze (and edit) the assets of any Unity game. After starting the application, the hacker can load any assets- or scene file into a separate window. This window lists all assets of the selected file on the left hand side and available actions on the right hand side, as shown in Figure 1.

Figure 1 – UABE

 

‚View Data‘ opens a new window which describes a selected asset to its smallest detail.
‚Export Raw‘ extracts the asset as a file.
‚Export Dump‘ extracts the asset as its type of file.
‚Plugins‘ lists all installed plugins.
‚Import Raw‘ loads an asset from a file.
‚Import Dump‘ loads an asset from its type of file.
‚Remove‘ deletes the selected asset.

Editing assets can be performed with dedicated tools made for the particular types of assets. For example, meshes might be edited with modelling software like 3DS Max while MonoBehaviors might be edited with any coding IDE.

 

AssetStudio

In comparison to UABE, AssetStudio provides a graphical user interface (GUI). After opening a project, all of its assets can be inspected in a quite user-firendly fashion. There are three different inspection options: Scene hierachy, Asset List and Asset Classes.

The scene hierachy displays all scenes in the game, along with their respective assets, as shown in Figure 2. Assets can be selected to be extracted, so that they can be modified with third party programs like 3DS Max.

Figure 2 – AssetStudio’s Scene Hierachy

 

The Asset List contains all types of object the game makes use of. Examples of such object types include Fonts, Meshes, MonoBehavior Scripts and Shaders. This tab also offers a preview option that showcases the object is possible, as shown in Figure 3.

Figure 3 – AssetStudio’s Asset List with preview

 

The Asset Classes simply lists all custom classes of the game if there are some. In this case, the list is empty.

 

dnSpy

dnSpy focusses on debugging and editing assembly code. It does not require source code – an executable file is already sufficient enough. After opening the file, the program instantly shows everything it consists of, as shown in Figure 4.

Figure 4 – dnSpy

 

The program seems not friendly for beginners in this field. However, after a few first impressions it can be used effectively, as shown in Media 1, which depicts adding code to crash an application.

Media 1 – dnSpy in action (cf. [https://github.com])

ILSpy

In comparison to dnSpy, this tool is more beginner friendly – by showing error messages when opening files that have the wrong format. After opening the Assembly-CSharp.dll file, it is possible to browse through all compiled scripts, as shown in Figure 5.

Figure 5 – ILSpy

 

I am sure that I will need at least one script editing tool to make progress in this project – the scripts contain valuable information the AI might need to be able to learn.

 

Sources:

[https://github.com]
dnSpy: https://github.com/0xd4d/dnSpy (21.10.2019)
ILSpy: https://github.com/icsharpcode/ILSpy (21.10.2019)
AssetStudio: https://github.com/RaduMC/AssetStudio (21.10.2019)

[https://7daystodie.com]
Unity Assets Bundle Extractor: https://7daystodie.com/forums/showthread.php?22675-Unity-Assets-Bundle-Extractor (21.10.2019)

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

zwei × 3 =