I would like to monitor a var
(preferably in heap) for any kind of writing change.
To be exact, I would like to monitor a specific address range in my own process with a length of N
bytes.
The reason: A second process might change the value of the var externally via WriteProcessMemory
and an event should be triggered as soon as its address range has changed the value.
How can I monitor this?
This seems so unprofessional:
while true do
begin
if VarToMonitor <> OldMonitorValue then ...
// sleep (100) ???
end;
EDIT:
I would like to monitor this without a debugger at runtime.