Triggering event on change in process memory?

  • Thread starter Thread starter anguish
  • Start date Start date
A

anguish

I'm using ReadProcessMemory from kernel32.dll to read specific bytes
from the process memory of a program. While the solution I have now
(which updates the memory content at regular intervals) works, I can
help thinking that it's a waste of resources. It also possible to miss
changes if the interval is set too long.

I'm a newbie when it comes to eventhandlers, and I guess I could
benefit from learning-by-doing on somewhat less complex examples, but I
thought I'd ask if this is the way to go in my situation, lest I waste
my time. Also, some pointers would be greatly appreciated! :)

Regards,
Mike
 
Mike,

I don't know if there is anything that would let you do this... And if
so, doing so is really not a solid way of determining whether or not there
are changes in a program.

Is there any way that you can get an event to fire when what you are
looking at changes? It's a much better way of handling this.

Hope this helps.
 
anguish said:
I'm using ReadProcessMemory from kernel32.dll to read specific bytes
from the process memory of a program. While the solution I have now
(which updates the memory content at regular intervals) works, I can
help thinking that it's a waste of resources. It also possible to miss
changes if the interval is set too long.

I'm a newbie when it comes to eventhandlers, and I guess I could
benefit from learning-by-doing on somewhat less complex examples, but I
thought I'd ask if this is the way to go in my situation, lest I waste
my time. Also, some pointers would be greatly appreciated! :)

Regards,
Mike

We need some more context about what you are trying to achieve, and why you
are using low level debugging API's from managed code.
But supposing you are reading another process memory, then the other process
must signal an event when writing is done, for instance by means of a
semaphore. The reading process could wait on the semaphore to get signaled.

Willy.
 
Back
Top