![]() ![]() This GameController class however still does not inherit MonoBehaviour, which means that it is not a component of a GameObject. The method is getting called from GameController.Init(). This method call can once again be traced using dnSpy’s Analyze feature. We know, that the GameModel is getting initialized by that Execute method. This script class likely holds the GameModel instance we are searching for. This means that we can assume, that the game has a GameObject somewhere which has a script component managing the game. However, we can apply components to a GameObject, such as a C# script.Īll C# script classes have to inherit from the MonoBehaviour class.Īfter doing so, you can place methods like Start() or Update() in your code and the engine will call them for you at initialization or on each frame. To do so, we have to understand the engine’s structure first.Įvery scene holds GameObjects. We know that we have to find the GameModel instance. However, before that, we are going to take a quick dive into the engine’s principles. This means that we have to get this GameModel instance somehow. This is the Dictionary that stores the number of resources we have. This method seems to be initializing Generators for all kinds of resources.Īn object of type GameModel is passed into this method which contains a Dictionary called Resources. Now we do the same trick on the GeneratorData class: right-click -> Analyze.ĭnSpy will show us, that a GeneretorData object is being used to initialize an object of type GeneratorModel inside of the Execute method in the InitializeGameModelCommand class. The game has different types of “Generators” which generate items while you aren’t clicking. I noticed that the Enum was being used in a class called GeneratorData. A list is going to show up listing all types of usages of the Enum. We can list cross-references in dnSpy by right-clicking the Enums name and then clicking Analyze. ![]() We have to find the class that contains all values we need. Now, if you have some experience with IDA, the next thing you would do here is to look for cross-references. It’s an Enum with all types of resources that can be gathered in the game. The search tool can be found in the top bar, right next to the Start button. I started by using the search tool in dnSpy to search for Potato. Obviously, one could simply edit the save files, however, that would be very boring. Let’s try to increase the number of potatoes. This game is a clicker game and its goal is to gain as many resources as possible. ![]() I recommend dnSpy because it is very powerful. Decompiling the game’s codeĪll (non-il2cpp) Unity games have an Assembly-CSharp.dll located inside of GameRoot\TheNameOfTheGame_Data\Managed\. However, you can achieve the same results by using tools like Il2CppDumper and Il2CppAssemblyUnhollower. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |