dnf123021 发表于 2014-9-25 18:38:34

请问VC++如何用Readprocessmemory读取基址中存放的十进制数

请问VC++如何用Readprocessmemory读取基址中存放的十六进制数,求大神解答{:9_236:}

百日维新 发表于 2014-9-25 20:27:43

void DisplaySun() {         HWND gameh = ::FindWindow(NULL,"植物大战僵尸中文版");//句柄         int sun = 0;                DWORD processid;         ::GetWindowThreadProcessId(gameh,&processid);         HANDLE processh = :: OpenProcess(PROCESS_ALL_ACCESS,false,processid);               DWORD byread;         LPCVOID pbase = (LPCVOID)6987456;         LPVOID rbuffer = (LPVOID)&sun;         ::ReadProcessMemory(processh,pbase,rbuffer,4,&byread);                pbase = (LPCVOID)(sun + 1896);                ::ReadProcessMemory(processh,pbase,rbuffer,4,&byread);                pbase = (LPCVOID)(sun + 21856);                ::ReadProcessMemory(processh,pbase,rbuffer,4,&byread);         printf("您当前阳光为:%d\n",sun);}

百日维新 发表于 2014-9-25 20:28:20

void DisplaySun()
{
        HWND gameh = ::FindWindow(NULL,"植物大战僵尸中文版");//句柄
        int sun = 0;
       
        DWORD processid;
        ::GetWindowThreadProcessId(gameh,&processid);
        HANDLE processh = :: OpenProcess(PROCESS_ALL_ACCESS,false,processid);       
        DWORD byread;
        LPCVOID pbase = (LPCVOID)6987456;
        LPVOID rbuffer = (LPVOID)&sun;
        ::ReadProcessMemory(processh,pbase,rbuffer,4,&byread);
       
        pbase = (LPCVOID)(sun + 1896);
       
        ::ReadProcessMemory(processh,pbase,rbuffer,4,&byread);
       
        pbase = (LPCVOID)(sun + 21856);
       
        ::ReadProcessMemory(processh,pbase,rbuffer,4,&byread);
        printf("您当前阳光为:%d\n",sun);

}

dnf123021 发表于 2014-9-25 21:44:31

百日维新 发表于 2014-9-25 20:28

谢谢版主的解答,,万分感谢{:9_236:}终于好了
页: [1]
查看完整版本: 请问VC++如何用Readprocessmemory读取基址中存放的十进制数