📖 Tutorial How to hack Unity Android Games when there's no Assembly-Csharp.dll (libil2cpp.so method)

Sbenny.com is trusted by 1,323,540 happy users since 2014.
Register

kapeyy

Lurker Lv0️⃣
Member for 4 years
Hello, I'm trying to mod a game...
I don't know how to code with ARM

All I want to do is just replace the Random function
Here's a pic from dnSpy (its from the older version of the game)
Screenshot_2.png
The random range is actually (40f, 300f), (-50, 80), 0
I already tried with the method you given, and this is what I got
Screenshot_1.png
I'm seriously don't understand about ARM opcodes... and I can't understand tutorials I found at google.
 

Whistler

Lurker Lv0️⃣
Member for 4 years
Hey, I've very recently started to try and get into modding so i dont know a lot and maybe theres something I'm missing, but I've been trying my luck with a singleplayer mobile game, night of the full moon, it does have global metadata and an il2cpp folder, but no lib folder or libil2cpp.

Maybe it was changed recently? Maybe mobile builds are different?
 

TheLGL

Novice Lv1️⃣
Member for 4 years
Nice tutorial!
It's called Il2Cpp scripting backend. Unity Editor have option to choose Mono (DLL) or Il2Cpp backend (SO)
Native is basically faster than mono because it does not need translation or anything
 

agriz

Lurker Lv0️⃣
Member for 4 years
After editing, i build the game using apktool.
But it is not installing and throws error. Unable to install apk.

Editing part is confusing.
Can you please write in details?
 

tahooo

Lurker Lv0️⃣
Member for 4 years
hello, man i have a question
lets say that i dumped a protected ilcpp2.so from memory and then i used the dumper to extract function names and classes .
so,after i get the values that i want to change.
the question is :how iam gonna be able to modify the original library with hex editor and it is protected,any idea.
 

Sbenny

A crazy scientist
Staff member
Admin
SB Mod Squad ⭐
✔ Approved Releaser
Active User
The file dump.cs has the offset position of the funcion inside hxd. For example:

get_Money // 0x123456

where 123456 is the offset, so you just press Ctrl+G from hxd and paste your offset, then, press enter. It will show you the beginning of the function, and it's from that point that you need to replace the original values with the modified ones you want to put there.
 

tahooo

Lurker Lv0️⃣
Member for 4 years
i know but did that work even if libil2cpp.so is protected because the bytes from offset is diffrent from the dump of libil2cpp.so.
 
Last edited:

bestkings

Lurker Lv0️⃣
Member for 3 years
could you help me know how to return a double value?
ldc.i8
ret
with mov r0 isn't work
 

Sbenny

A crazy scientist
Staff member
Admin
SB Mod Squad ⭐
✔ Approved Releaser
Active User
Double isn't ldc.i8 but ldc.r8, please explain better what you'd like to do, if an INT64 or a DOUBLE value, thanks :)
 

Dementor99

Lurker Lv0️⃣
Member for 3 years
Does anyone know a good binary to Arm/arm64 opcode convertor
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
I use this one ....
Post automatically merged:

You mean hex to Arm right ?
Post automatically merged:

could you help me know how to return a double value?
ldc.i8
ret
with mov r0 isn't work
Double isn't ldc.i8 but ldc.r8, please explain better what you'd like to do, if an INT64 or a DOUBLE value, thanks :)
Bro @Sbenny I have a same kind of question ...
If I have Int64 or Single or Double should I also use Mov r0 , #xxxx or something else ?

And as you know ,
Max return value of 4 bytes Mov is 65535 . So for returning more should I use like
Mov r0 , #xxxx
Mul/Add r0 , r0

Or,
Ldr r0 , =xxxx ?
 
Last edited:

Dementor99

Lurker Lv0️⃣
Member for 3 years
No I ment a tool/plugin that could take raw ARM ML bytes and convert them into ARM opcodes, guess I'd have to write one myself :rolleyes: BTW, could we modify these elfs the same way it's done to MONO dlls, as in add/remove instructions and recalculate offsets and the final binary still be valid?

Or do you think the ELF format puts stricter limitations on applicable changes?
 

Sbenny

A crazy scientist
Staff member
Admin
SB Mod Squad ⭐
✔ Approved Releaser
Active User
No I ment a tool/plugin that could take raw ARM ML bytes and convert them into ARM opcodes, guess I'd have to write one myself :rolleyes: BTW, could we modify these elfs the same way it's done to MONO dlls, as in add/remove instructions and recalculate offsets and the final binary still be valid?

Or do you think the ELF format puts stricter limitations on applicable changes?
On the same site there's also HEX to ARM converter, which converts bytes into readable ARM instructions.

As per @Gourov 's question, when talking about float (single) it's a different story. Look at this example I created: Float (IEEE754 Single precision 32-bit)

Basically, if you want to return 128 in float you need to write MOV R0, 0x43000000 but unforutnately you can't return ANY values in this way. This is a "hacky" way to put a float value into an INT32 instruction, because normally R registers (like R0, R1 and so on) are used to store INT32 values, and not float which are usually put into S registers (where S stands probably for Single).

So, to return 128 float you can do:

MOV R0, 0x43000000
BX LR

I hope it helps.
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
On the same site there's also HEX to ARM converter, which converts bytes into readable ARM instructions.

As per @Gourov 's question, when talking about float (single) it's a different story. Look at this example I created: Float (IEEE754 Single precision 32-bit)

Basically, if you want to return 128 in float you need to write MOV R0, 0x43000000 but unforutnately you can't return ANY values in this way. This is a "hacky" way to put a float value into an INT32 instruction, because normally R registers (like R0, R1 and so on) are used to store INT32 values, and not float which are usually put into S registers (where S stands probably for Single).

So, to return 128 float you can do:

MOV R0, 0x43000000
BX LR

I hope it helps.
Thanks a lot bro ... At least now I can do some experiment :D Lol @Sbenny bro , I will annoy you again if come across any problem :LOL:
 

Sbenny

A crazy scientist
Staff member
Admin
SB Mod Squad ⭐
✔ Approved Releaser
Active User
Anytime :) Also, please note you can't put any values you want in float, you have a limited range in multiples of 2 (16 - 32 - 64 - 128 - 256 and so on)
 

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
Anytime :) Also, please note you can't put any values you want in float, you have a limited range in multiples of 2 (16 - 32 - 64 - 128 - 256 and so on)
Ok I will keep that in mind 😊
 

bestkings

Lurker Lv0️⃣
Member for 3 years
Double isn't ldc.i8 but ldc.r8, please explain better what you'd like to do, if an INT64 or a DOUBLE value, thanks :)
Sorry my wrong, it's double value. In C# it look like "public double blahblah"
I don't know about ARM. Go around, I have this thing, but it's only half work (mean have double value but can't control it). Please teach me
bvc #0xff851ec0
eormi sl, r8, r4, lsl lr
 

Legacy

⭐???? ?? ??????⭐
Verified 18+ user
Member for 4 years
Anytime :) Also, please note you can't put any values you want in float, you have a limited range in multiples of 2 (16 - 32 - 64 - 128 - 256 and so on)
Its kinda possible using the IEEE-754 Floating-Point Conversion from Floating-Point to Hexadecimal. The range is only from 1 - 2000 and only works for ARMv7.
Post automatically merged:

No I ment a tool/plugin that could take raw ARM ML bytes and convert them into ARM opcodes, guess I'd have to write one myself :rolleyes: BTW, could we modify these elfs the same way it's done to MONO dlls, as in add/remove instructions and recalculate offsets and the final binary still be valid?

Or do you think the ELF format puts stricter limitations on applicable changes?
I did find a tool a while ago. I has its limitations but overall it does the job. Link
 
Last edited:

Gourov

Dimitri Petrenko
✌️ Community Team
Member for 5 years
Top