各位高手,如何能像cheat engine一样实时监控内存的变化?
比如我想对某一进程的固定几个地址进行实时监控,有没有例如消息这样的机制?
本人现在的实现方式是通过多线程,一直while循环来监控,但即使利用多线程也会一卡一卡,效率不是那么高。当然也用过定时器,但是多线程中工作线程好像无法响应WM_TIMER消息。
我想问一下cheat engine是怎么做到对地址进行实时监控的?

解决方案 »

  1.   

    多线程的可以用CreateTimerQueue和
    CreateTimerQueueTimer
    创建定时器
      

  2.   


    谢谢,我清楚的他是开源的,我有源码,是用delphi写的,由于我不懂delphi,因此看起来有些累,而且实际情况在时间上也不允许我了解完了源码再来做开发。
      

  3.   

    我只是想知道cheat engine对内存监控所采用的方式
      

  4.   

    ToolHelp32BOOL WINAPI Toolhelp32ReadProcessMemory( 
      DWORD th32ProcessID,
      LPCVOID lpBaseAddress, 
      LPVOID lpBuffer, 
      DWORD cbRead, 
      LPDWORD lpNumberOfBytesRead 
    );
      

  5.   

    定义消息响应函数,在里面用postthreadmessage函数给工作者线程发消息,在线程里面响应消息这样可以吧
      

  6.   


    我用的ReadProcessMemory,请问两者有什么区别么
      

  7.   

    Toolhelp32ReadProcessMemory
    Copies memory allocated to another process into an application-supplied buffer.ReadProcessMemory
    Reads data from an area of memory in a specified process. The entire area to be read must be accessible or the operation fails.你说有没有区别?
      

  8.   

    Toolhelp32ReadProcessMemory
    Copies memory allocated to another process into an application-supplied buffer.ReadProcessMemory
    Reads data from an area of memory in a specified process. The entire area to be read must be accessible or the operation fails.你说有没有区别?