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:
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:
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?
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:
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:
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?