Tutorial [Videotutorial] How to dump and mod Il2cpp games (advanced modders only!)

G-Bo ッ

Administrator
Staff member
Administrator



Video tutorial by TechX Original


il2cpp dumper helps you to find the right function + offset to mod.

This guide is for advanced modder only!

Requirements:
- IDA Pro: Download IDAPRO68.zip
- Notepad++: Notepad++ v7.3.3 - Current Version
- Any Hex Editor software. I'm using Hex Workshop: Hex Workshop: Hex Editor, Sector Editor, Base Converter and Hex Calculator for Windows (You can modify hex in IDA but editing the file in hex editor is the fastest way for me)
- Online ARM converter: ARM To HEX Converter Online
- Basic C# and ARM knowledge. You don't really need to learn C# but know simple codes of C#
- Know how to use IDA Pro

Extract required files from APK file:
Open the APK and extract the following files to dump:

\lib\armeabi-v7a\libil2cpp.so

\assets\bin\Data\Managed\global-metadata.dat

Using Perfare's Il2CppDumper:
Download released version: Releases · Perfare/Il2CppDumper · GitHub

Launch Il2CppDumper.exe, the program want you to select the ELF file or Mach-O file. Select libil2cpp.so file. The dialog box should appear again. Select global-metadata.dat file.

The program asks you to select mode. Manual (1) or auto (2)

Auto mode:
Automatically find the required offsets to dump il2cpp.

Press 2 and the file dump.cs will be created

Skip reading manual mode if you don't want to use manual mode.

Manual mode:
The manual mode is the complicated steps to dump il2cpp. Auto mode does tell you the offsets, but I would like to show you how to find offsets to manually dump il2cpp.

Disassemble libil2cpp.so in IDA Pro. Click on Search -> Sequence of bytes...

Search this hex

Code:
1C 00 9F E5 20 10 9F E5 00 20 8F E0

Click OK


iTfwE3U.png



IDA should jump to this function



vgz4o0q.png





But there's no unk offsets, right? now try this trick:
Right click on loc_xxxxxxx and select Create Function, you will get the unk offsets



3y4CFMu.png





In the console app, press 1, it will ask you to input the CodeRegistration(R0). Input the unk offset of R0, R12, R2. Example: 15C70C4. Hit enter. Input MetadataRegistration(R1), and Hit enter.

The dump.cs file will be created


Using Katy's Il2CppInspector:
Download released version: Releases · djkaty/Il2CppInspector · GitHub

Skip this if you are using Perfare's Il2CppDumper

Extract the ZIP file. The il2cppdumper.exe can't run with just double-click, so you have to use CMD, "cd" to the path of Il2CppInspector or click File -> Open commandprompt, and type this command.

Usage:
Code:
Il2CppDumper [<binary-file> [<metadata-file> [<output-file>]]]
What does these usage mean?

Il2CppDumper = Execute Il2CppDumper.exe file
<binary-file> = Path of libil2cpp.so
<metadata-file> = Path of global-metadata.dat
<output-file> = Output file. You can name the file. Example: dumpedfile.cs

This is my example:
Code:
il2cppdumper "D:\Android apps + data\Craft Royale\libil2cpp.so" "D:\Android apps + data\Craft Royale\global-metadata.dat" "D:\Android apps + data\Craft Royale\dumped.cs"
Hit enter and it will dump il2cpp for you. The dumped file will be created at the path you have given

If you want to use command anywhere, add the PATH environment variable in Advanced System Properties


1581346032098.png





View the dumped file with Notepad++:
Right click on the dumped file and select Edit with Notepad++

You'll see a C# code. It's not a full code but the code tells you function names and offsets to mod.

To search, click Search -> Find...

To find all keyword, click on Find All in Current Document



TD8RMia.png





If you never seen C# code before, I'll explain a bit what this method mean

Code:
public static int get_IsCheater(); // e8e9cc
public is an access modifier. It can be private, protected etc.This is not important to know

static is a static modified to declare a static member. This is not important to know

int is a data type. It can be float, double, boolean etc....

// e8e9cc is a comment. This tells you the real offset (sub_xxxxxx) to mod. You can search it in functions window in IDA

Fields and Properties are not modable, so don't look at them. Only look at fuctions under // Methods

Modding il2cpp game is the same as modding other .so file.

That's all.

Happy modding!

Credits:
iAndroHacker (this tutorial)
djkaty (Il2CppInspector)
Perfare (Il2CppDumper)
 
Last edited:
When i use II2CppDumper like a video, all games send this error on end of process and don't create a dump file

* Binary file: C:\xxxxxxxxxxxxxx\Il2CppDumperGUI\libil2cpp.so
* global-metadata.dat: C:\xxxxxxxxxxxxx\Il2CppDumperGUI\global-metadata.dat
* Output direcotry: C:\xxxxxxxxxxxx\Il2CppDumperGUI\
Dumping...
System.Exception: Exceção do tipo 'System.Exception' foi acionada.
em Il2CppDumper.FormGUI.A(Object , DoWorkEventArgs ) Try another mode.
em Il2CppDumper.FormGUI.A(Object , DoWorkEventArgs )
----------------------------

- Can you help me plx????? I want learning about moding games.... Thx Bro....
 
When i use II2CppDumper like a video, all games send this error on end of process and don't create a dump file



- Can you help me plx????? I want learning about moding games.... Thx Bro....
try one of the other dumping methods, like advanced auto , auto plus etc
 
I opened libil2cpp.so in IDA and have the unk offset appeared but I don't know what to do next. OP said
"In the console app, press 1, it will ask you to input the CodeRegistration(R0). Input the unk offset of R0, R12, R2. Example: 15C70C4. Hit enter. Input MetadataRegistration(R1), and Hit enter. "
Just got myself into modding, hope you guys can help me
 
I opened libil2cpp.so in IDA and have the unk offset appeared but I don't know what to do next. OP said
"In the console app, press 1, it will ask you to input the CodeRegistration(R0). Input the unk offset of R0, R12, R2. Example: 15C70C4. Hit enter. Input MetadataRegistration(R1), and Hit enter. "
Just got myself into modding, hope you guys can help me
You don't need anymore this Method, sure it's better to have the old basics too but the new il2cpp Dumper have now the possibility to make " dummydll's ", with that method you need only HxD ( to change the hexcodes from the .so file ) and dnSpy.
It is like .dll modding then, the only difference is that you work with the .so binary and hex codes instead with c#

Simple download that:

And it's way easier
 
Last edited:
@DaRealPanDa Thank you! It is easier now but I'm still confused with the whole Hex Editor thing. I found hex using Notepad++ (Is that okay?) and search it in HexEditor and it gives me the result. The problem here is I don't know much about Hex numbers and I'm not sure what should I change in HexEditor. I saw one of the video about ll2Cpp Dump by KingTrauma but I am quite confused about the range of value I should edit and the number. Thank you in advance!

Capture.PNG

(I want to edit the Heart and Ticket value, this is in Notepad++)
153113

(Search 15F0198 in HexEditor and it points my cursor in front of the number "28" as I highlight in the picture)
 
ARM modding:

01 00 A0 E3 1E FF 2F E1 = True or as example Weak Enemies
00 00 A0 E3 1E FF 2F E1 = False or as example Instant Win
12 07 A0 E3 1E FF 2F E1 = High Value for as example Gold, Damage etc.
1E FF 2F E1 = Return ( BX LR )
 
Hello! In IDA pro, how can I modify the parameter values that are being passed to a specific function? I can't really hardcode a specific return value because the game that I am modding has functions that don't return any values (public void)
 
@G-Bo ッ , just curious to ask whether there is any way to compare what is being change between original and mod apk after i have succesfully dump the il2cpp.so file?
before at IDA i can compare the result. when it comes to assembly.dll (C#) file i compare it using another application (forget the name since it's been 4 years i last play with Reverse Engineering).
Thanks :)
 
@G-Bo ッ , just curious to ask whether there is any way to compare what is being change between original and mod apk after i have succesfully dump the il2cpp.so file?
before at IDA i can compare the result. when it comes to assembly.dll (C#) file i compare it using another application (forget the name since it's been 4 years i last play with Reverse Engineering).
Thanks :)
The Question is, why you would compare a original with a mod apk, when it's your own then you know what you have done.
Cuz we don't support leeching here and we don't support it to look into Mod Apks from any Modder or even compare these to get any informations out of it.
 
Back
Top Bottom