![Quote](mpghv2/misc/quote_icon.png)
Originally Posted by
NB81
Hey!
Today I messed around with memory manipulation in C#. After I had to change a label's text to an adress that have been read from the memory, I noticed, after I change that value ingame, the adress will change too. So it is non-static. How can I work with these in C#? I read something about pointers or something, but I would be very happy if you could tell me about this(I'm new to cheat-engine things).
Thanks a lot!
Code:
uint RuntimePointer = *(uint*)(BaseModule + Pointer)
*(int*)(RuntimePointer + Offset) = 5;
and example:
Code:
uint pWeapon = *(uint*)(GetModuleHandle("Engine.dll") + Weapon);
*(int*)(pWeapon + Ammocount) = 9999;
This may change on the games... Some games uses Multi-level offsets, so you would need more offset...
Code:
uint RuntimePointer = *(uint*)(BaseModule + Pointer)
uint Pointer2 = *(uint*)(RuntimePointer + Offset1);
uint Pointer3 = *(uint*)(Pointer2 + Offset2);
uint Pointer4 = *(uint*)(Pointer3 + Offset3);
*(int*)(Pointer4 + FinalOffset) = 5;
I hope its help you...
If the Base Module is the process itself (game.exe) then
Code:
uint RuntimePointer = *(uint*)(Pointer);
You may change the uint to anything else, depends you must use a variable with the same size as the game...
Like:
DWORD ( 4 bytes) = uint / int (both 4 bytes)
IntPtr also 4 byte in x86 system, but 8 byte on x64 systems...
Good Luck...
If you need further help, call me, i'm also using C# to create hacks (for game called: Crossfire)