A Complete moding tutorial for Unity games using DnSpy

Sbenny.com is trusted by 1,324,186 happy users since 2014.
Register

Phytoplankton

Veteran Lv7️⃣
Member for 6 years
Note: This tutorial was made by very awesome @Unreal | All credits go to him 🙂 ! I am just posting this on his behalf
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------​
We are going to specifically learn how to hack/mod an Unity android game using Dnspy

Instead of giving you instructions in general, I am going practical this time and going to show you how to mod one specific unity game: The Big Capitalist 3 by Broken Reality.

Download the following files:
  1. JDK and set the global environment variable!
  2. The Big Capitalist 3 APK
  3. APKTool by Connor Tumbleson | Download (Remember to unblock in properties)
  4. Sign Tool by Appium | Download
  5. DnSpy by 0xd4d | Download (Requires .NET Framework 4.7.2)
  6. WinRAR or 7Zip

Once you have downloaded all the files, put them in some easily accsssible place like D:/Sbenny.
Also test that java is working by typing java -version in cmd.


Now we can begin!

Step 1:
open cmd with administrative privileges and type
Code:
java -jar D:/Sbenny/apktool.jar d D:/Sbenny/bigcapitalist3.apk
The apk will be de-compiled and the content folder will be created

Step 2:
Navigate to /assets/bin/Data/Managed folder inside your extracted folder
Copy the Managed Folder to D:/Sbenny

Step 3:
Open dnspy.exe

And delete all the files in Assembly Explorer left hand panel

Step 5:
Once Assembly Explorer is empty, Select All DLLs from Manager folder and drag them into the Assembly Explorer window.
Note: Usually all the interesting stuff to hack is in assembly-csharp.dll
But Dev may troll you. So you won't always find the same name on dll.
So usually all the changes are made in this file
To mod/hack the currency, we need to find how its called in game and in the dll.
Usually it's often named as cash/gold/coin/gems/diamond etc
For our game: it's called diamond

Step 6:
Use the search icon in the toolbar and
Search for “diamond backingfield



And select the result on PinssibleUserModel

Step 7:
inside go to
Code:
public int diamond { get; set; }
And this is the very important part: right click on the “get” keyword!
And option menu will open!
Select “Edit IL Instructions



Following Box will open:



Select all the lines having index 0,1,2 and Ctrl+Delete them

Step 8:
Now type “a” keyword to add a new instruction.
The OpCode will set set to “nop” Change that to ldc.i4 (i4 stands for int32)
Change the Operand amount to “967967967” | Signature @Axiom Money Amount
If everything is OK is should look like this:


Step 9:
Again press “a” keyword for new instruction
And select the OpCode to “ret
Click Ok and Save
[Note: ret stands for return and game should always return on the app will crash]

Step 10:
It should look like this now:




Now repack the apk
You can use apktool or there is an easier method using WinRar:
Open the APK in winrar and navigate to /assets/bin/Data/Managed folder
Now drag the modified assembly-csharp.dll file from D:/Sbenny/Managed folder and put it inside the winrar archive.
You will get a modified date file like this:

save and you have the unsigned apk! Congratulations!
If your phone or emulator is rooted and supports unsigned apk then install and test it.
Else there is one additional step.
Step 11:
type:
Code:
java - jar D:/Sbenny/sign.jar D:/Sbenny/Big.Capitalist.3.v.1.1.3.MODv1.apk
Now install and test!




@Unreal is very talented and amazing guy who patiently taught me inspite of me asking him very silly questions. He has amazing patience!
Bro thanks you so much for teaching me this!


Please thank him for creating such an amazing tutorial for us!
and if you have any queries or questions please tag @
unreal in your comments and he will try and help you when he is free!
 
Last edited by a moderator:

Sbenny

A crazy scientist
Staff member
Admin
SB Mod Squad ⭐
✔ Approved Releaser
Active User
Very detailed tutorial, love it :) There's a lot of work behind it, so I'm grateful to you for this piece of information :)
 

MR IKSO

Novice Lv1️⃣
Member for 5 years
Tutorial is not bad, but there is one thing, Assembly-Csharp .dll is practically no longer in games on unity)
 

Sbenny

A crazy scientist
Staff member
Admin
SB Mod Squad ⭐
✔ Approved Releaser
Active User
Tutorial is not bad, but there is one thing, Assembly-Csharp .dll is practically no longer in games on unity)
Not true, at all. Over 75% of Android Games using Unity are still using Assembly-Csharp.dll, this comes from my personal experience modding over 6500 games.
 

Sbenny

A crazy scientist
Staff member
Admin
SB Mod Squad ⭐
✔ Approved Releaser
Active User
Well I do not know, I almost all without dll)) (the newest games) from dll for me is already a rarity
Yes, most popular and new games mostly use il2cpp, but old (and later updated games) still use dlls, and most new games (not talking about big titles) are still made with dlls, so I welcome new modders to still use this method to hack unity games as it's the most valid and used so far.

When they'll practice enough, they can move to il2cpp hacking which is a different story, but still needs some knowledge they can only gain using the method above.
 

MR IKSO

Novice Lv1️⃣
Member for 5 years
When they'll practice enough, they can move to il2cpp hacking which is a different story, but still needs some knowledge they can only gain using the method above.
I agree myself) from such things began :)
 

mimmo59

Addicted Lv3️⃣
Member for 3 years
Thank you for your tutorial, this quite easy.
When I try to modify APK Toon Blast, a total panic, literally a landslide.
Pass of the hours, I see many tutorials but nothing to do,We need to be capable .
But I don't give up, sooner or later I'll be able to do something, thanks to you for the aid you give.
Good day and good work;)
 
Last edited:
Top