In order to get more comfortabel with memory and memory editing I decided to create a 'cvar viewer' for Enemy territory(a nice free downloadable game), everything is working fine for cvars like com_maxfps(which is set to 85) or r_gamma(which is set to 1.3) problems arise for all cvars with an integer value less than 10, for example, r_picmip is set to 1(so where is the 1 stored???).
It comes down to this: I search the cvar names as ascii strings(com_maxfps, r_picmip etc.), when I find com_maxfps the value of this cvar is close to the com_maxfps string. After the value another cvar string follows. I can modify the 85 that I find and it changes nicely in the game, no problem so far.
Here is what I find in the memory for com_maxfps:
- Code: Select all
0245649C 63 6F 6D 5F 6D 61 78 66 70 73 00 00 11 4A 1D 00 com_maxfps..J.
024564AC 1C 00 00 00 04 00 00 00 C8 64 45 02 88 64 45 02 ......ÈdEˆdE
024564BC 11 4A 1D 00 38 35 00 AA 11 4A 1D 00 1C 00 00 00 J.85.ªJ....
024564CC 04 00 00 00 E4 64 45 02 AC 64 45 02 11 4A 1D 00 ...ädE¬dEJ.
024564DC 38 35 00 AA 11 4A 1D 00 28 00 00 00 04 00 00 00 85.ªJ.(......
024564EC 0C 65 45 02 C8 64 45 02 11 4A 1D 00 63 6F 6D 5F .eEÈdEJ.com_
024564FC 68 75 6E 6B 4D 65 67 73 hunkMegs
However with r_picmip the value '1' is nowhere to be found, in fact - if I write 00's between the r_picmip string and the next cvar string, nothing changes in-game, the r_picmip value is still 1.
Here is what I find for r_picmip:
- Code: Select all
02452793 72 5F 70 69 63 6D 69 70 00 11 4A 1D 00 2C 00 00 r_picmip.J.,..
024527A3 00 04 00 00 00 CC 27 45 02 7C 27 45 02 11 4A 1D ....Ì'E|'EJ
024527B3 00 75 69 5F 72 5F 73 75 62 64 69 76 69 73 69 6F .ui_r_subdivisio
024527C3 6E 73 ns
So nulling everything between r_picmip and ui_r_subdivision has no effect.
Now the thing that I can't get my head around:
- I set r_picmip to 2.0000 in-game, then search for 2.0000 with MHS, and it finds 2.0000 somewhere 'random' in the memory but the r_picmip string is nowhere near it. If I change this 2.0000 value that I found into 3.0000 everything changes nicely in-game.
So now I restart the game(r_picmip is still 2.0000) and I search 2.0000 again, and guess what, r_picmip and 2.0000 are grouped together, if I change to 3.000 in-game the memory updates nicely.
Next I change r_picmip to 1, the 3.000 disappears in memory and is replaced by hex 04. I change r_picmip back to 2.000, the 04 is still in place, the value 2.000 is somewhere completely different again with no r_picmip string to be found near it, so the whole circus starts again.
I hope my problem is a bit clear to you and I hope that you can help me find values of cvars that are in range 0-9, I just can't understand why 'double' values and values of 10 and more are right after the cvar name and that 0-9 values are somewhere different.
Thanks in advance