Solved How to mod libil2cpp.so when its returning double?

Status
Not open for further replies.

timmyyy19977

Platinian
Hi, I am new to modding games, and I found it very interesting. I have tried modding a game, and I successfully changed the return value for int types.

For any method returning int, I made the following hex code and had a success.
00 00 A0 E1 1E FF 2F E1 = NOP
00 00 A0 E3 1E FF 2F E1 = False or number 0
01 00 A0 E3 1E FF 2F E1 = True or number 1
02 00 A0 E3 1E FF 2F E1 = number 2
0A 00 A0 E3 1E FF 2F E1 = number 10
96 00 A0 E3 1E FF 2F E1 = number 150
C8 00 A0 E3 1E FF 2F E1 = number 200
2C 01 00 E3 1E FF 2F E1 = 300 (12C)
E7 03 00 E3 1E FF 2F E1 = 999 (3E7)
DC 0F 00 E3 1E FF 2F E1 = number 4060
DC 0F 0F E3 1E FF 2F E1 = number 65500

However, when it comes to float type and double type. it never worked. Like the following method:
1619932185444.png

I tried:
return 999float: 7A 04 04 E3 1E FF 2F E1.
In game it showed '0' instead.
I also tried return 999double
01 00 A0 E3
10 0A 00 EE
C0 0A B8 EE
10 0A 10 EE
1E FF 2F E1
Again, its a zero return.

Same goes with float returns:
1619932593039.png

I tried:
return 999float
7A 04 04 E3 1E FF 2F E1.
It never worked, always a wrong number. For the second float method, it is possible that the game logic won't allow modding.

What is the correct way of getting the hex code for returning a double or float? What do I need to learn or are there templates?
 
Always better to hook, you can still doing this. Try to use Game Guardian for see if it works. Set the value and copy the hex that Game Guardian tells you. You can calculate offsets with Game Guardian so it should be more easier.
 
I found my final answer.

return 2.000xxxxxx
00 10 44 E3 1E FF 2F E1

return 131072.070218983
00 11 44 E3 1E FF 2F E1

return 8.5c
00 12 44 E3 1E FF 2F E1

Honestly, I still don't understand how the hex code "00 11 44 E3 1E FF 2F E1" translates to "return 131072.070218983". I understand the return part, but not the number part. Will try to dig deeper. Thanks for your help!
 
I found my final answer.

return 2.000xxxxxx
00 10 44 E3 1E FF 2F E1

return 131072.070218983
00 11 44 E3 1E FF 2F E1

return 8.5c
00 12 44 E3 1E FF 2F E1

Honestly, I still don't understand how the hex code "00 11 44 E3 1E FF 2F E1" translates to "return 131072.070218983". I understand the return part, but not the number part. Will try to dig deeper. Thanks for your help!
@timmyyy19977 then change help to solved
 
Status
Not open for further replies.
Back
Top Bottom