hi. i got a small problem. i want to write a program that is able to "freeze" a memory address. by freezing i mean a memory address that doesn't/can't change its value. how do i do that? a timer solution would be too "unprofessional" i think. does anyobody have a "real professional" solution? thanks in advance!
Posted on 2001-06-07 13:05:00 by Hakinomo
Declare the variable in a segment and mark it read-only. This message was edited by karim, on 6/7/2001 3:17:24 PM
Posted on 2001-06-07 15:10:00 by karim
i want to freeze memory addresses of other processes (forgot to say that hehe). how does that work? set the memory address to read-only? if yes, how? maybe one of those VirtualProtect-API-Functions?
Posted on 2001-06-07 15:38:00 by Hakinomo
oh, and what, if the process tries to write to the address that i just set to read-only? there will be an exception or not?
Posted on 2001-06-07 15:40:00 by Hakinomo
any access to the other's process memory will generate exeption why u want to "freeze" the part of memory that belong to the other process??
Posted on 2001-06-07 21:28:00 by Alexey
VirtualProtectEx can change the access protection of any process. From the MSDN :
The VirtualProtectEx function changes the access protection on a region of committed pages in the virtual address space of a specified process. BOOL VirtualProtectEx( HANDLE hProcess, // handle to process LPVOID lpAddress, // region of committed pages SIZE_T dwSize, // size of region DWORD flNewProtect, // desired access protection PDWORD lpflOldProtect // old protection ); Parameters hProcess Handle to the process whose memory protection is to be changed. The handle must have PROCESS_VM_OPERATION access...
You will have to make some tests.
Posted on 2001-06-08 02:59:00 by karim
thanks for the answers. i'll try out that virtualprotectex. i want to freeze addresses cause i'm writing some kind of a game hacking tool and i want it to be able to freeze the health stat (or whatever) in game.
Posted on 2001-06-08 03:53:00 by Hakinomo
Hakinomo, I think if you try this it will end up trashing the program when it attempts to write there, possible a better solution is to freeze it by readint the value initially, then writing the value back every 100 milliseconds or so. The best solution though is to find the piece of code which modifies this value, and NOP it out. umbongo
Posted on 2001-06-08 06:36:00 by umbongo