Help! Trying to mod IL2CPP

mydogsocute

*1st-Class-Platinian*
Original poster
VIP
Oct 31, 2021
12
1
3
22
TX
Hello, I've gone through a majority of the tutorials, the ones I was able to find, and I seem to still be struggling with making a simple mod for il2cpp games. Not sure which part I'm messing up on, so I'll give a run down on what I'm doing to see if anyone could point out my mistakes! (I'm trying this on an emulator running 64 bit so the game is ARM64. I just finished reading G-Bo's entry on Hex Codes in ARM64.)

The gaming I'm trying to mod seems very simple. It's called Idle RPG Adventure Hero, it's got a small player base of 50k players and it uses il2cpp as mentioned above.

Firstly, I use APK Tool Easy to unpack the apk, not required I don't believe as I can just drag out the required files, modify them, then resign with APK Tool Easy. After I unpack the apk I'm grabbing the globalmetadata and the largest .so file in the lib, "libil2cpp.so". I use an IL2CPP Dumper to get the dumps.cs file, but I mainly use the Dummy dll files for looking around in dnspy. In the 64 bit version of the game I get the following offset for _hp on the EnemyCtr (EnemyController or EnemyCharacter, I'm assuming.) They use a getter for it so the method is called get__hp.

Code:
[CompilerGenerated]
// RVA: 0x146ABB4 Offset: 0x1469BB4 VA: 0x146ABB4
public float get__hp() { }

(P.s. I tried doing this with the 32 bit version of the game, but it only supports Android 9+ so it will instantly crash while booting.)

After getting the offset for the _hp getter, I open hxd and press Shift + G to access the address inside of the "libil2cpp.so" file. Once I find the address I am replacing it with this, which I found on G-Bo's post about Hex Codes:

Code:
ARM:
MOV X0, #1
ret

HEX:
20 00 80 D2 C0 03 5F D6
I input the hex starting at the beginning of the offset for the _hp getter. Once I finish I drag the "libil2cpp.so" file back into the apk using WinRaR to replace the normal one. I then use APK Tool Easy to resign the app and then load it into LDPlayer9 on a 64 bit Android 9 Instance. The app runs correctly without any issues, and I've even checked the apk inside once on the emulator. I've tried multiple things such as deleting the lib for 32 bit and it still doesn't change anything inside of the app. If anyone has any ideas please help me out. Just started learning a little bit back and have a little experience with cheat engine and c# modding on unity games for pc. Thank you.

If I'm missing any info that is required for assistance please just let me know and I can provide you with a step-by-step of what I did. I tried to include as much as possible in this post. Hopefully I didn't forget any steps!
 
  • Sad
Reactions: nowhere_222

mydogsocute

*1st-Class-Platinian*
Original poster
VIP
Oct 31, 2021
12
1
3
22
TX
You're using ARM while your target is ARM64
ARM: <====
MOV X0, #1
ret

HEX:
20 00 80 D2 C0 03 5F D6
I just copied that arm thing from G-Bo's post. I'm assuming he's referring to ARM64 in the post as that isn't ARM because it isn't using Register 0 and BX LR but instead uses ret.
 

mIsmanXP

Approved Modder
Approved Modder
Feb 20, 2022
205
8,881
193
Republic of Indonesia
I just copied that arm thing from G-Bo's post. I'm assuming he's referring to ARM64 in the post as that isn't ARM because it isn't using Register 0 and BX LR but instead uses ret.
Alright
One thing i have encounter is the offset generated by dumper differ at runtime, maybe that's your case?
 

mydogsocute

*1st-Class-Platinian*
Original poster
VIP
Oct 31, 2021
12
1
3
22
TX
Alright
One thing i have encounter is the offset generated by dumper differ at runtime, maybe that's your case?
Seems possible, the game doesn't seem to be affected at all by my changes. I've tried many things with this game including HeroCtr and PetCtr which should affect my main character and pet, but they also seem to do nothing as well. Is there a way around this? I haven't seen anything about it on forums, so if you know anything lmk pls! :)
 

mydogsocute

*1st-Class-Platinian*
Original poster
VIP
Oct 31, 2021
12
1
3
22
TX
It's also very likely it's my own fault as I've been unable to mod any il2cpp games, so I cannot really fully blame the game lol.
 

mIsmanXP

Approved Modder
Approved Modder
Feb 20, 2022
205
8,881
193
Republic of Indonesia
It could also be that the function your patching is not used by the game
It says that function is CompilerGenerated
Which could indicate that it's not used?
 

mydogsocute

*1st-Class-Platinian*
Original poster
VIP
Oct 31, 2021
12
1
3
22
TX
It could also be that the function your patching is not used by the game
It says that function is CompilerGenerated
Which could indicate that it's not used?
Possible, I don't really have much experience with this, but in my experience with java and OSRS botting that is just how default getters are generated for vars. If it doesn't use those values then I am stumped because I looked through the entire dumps.cs file and only found more default getters and setters for values that definitely didn't affect main character or enemies.
 

mydogsocute

*1st-Class-Platinian*
Original poster
VIP
Oct 31, 2021
12
1
3
22
TX
If possible and if you're interested, do you mind taking a few minutes when you're free and looking at the game? It's a VERY small game and a quick look might show you my mistake.
 

TERROR

Platinian
Jun 11, 2018
8
1
3
some place
@mIsmanXP Hello, sorry for intruding, I have been trying to install frida-il2cpp-bridge on my cell phone for a while now and I have compilation errors, any tips on how to fix it?
 

mIsmanXP

Approved Modder
Approved Modder
Feb 20, 2022
205
8,881
193
Republic of Indonesia
@mIsmanXP Hello, sorry for intruding, I have been trying to install frida-il2cpp-bridge on my cell phone for a while now and I have compilation errors, any tips on how to fix it?
You're not showing what you do, not even the error you got, how am i gonna help you?
I could've written my answer to your problem here instead you need me to ask you
what's the problem?