![](/img/trans.png)
[英]WriteProcessMemory() returns 487? Value found using CheatEngine
[英]ReadProcessMemory CheatEngine Value
我想从进程中获取一个值,这是一个使用“计算器”的简单测试。 首先,我使用 CheatEngine 获取地址。 其次,我把它放在 ReadProcessMemory 中。 但是 ReadProcessMemory 返回 0,我想我错过了一些东西,我用 BaseAddress 找到了一些东西,但我仍然有不好的结果。 谷歌对我来说没有结果,所以我问你!
#include <windows.h>
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int value;
DWORD pid;
HWND hwnd = FindWindow(NULL,"Calculatrice");
if(!hwnd)
{
cout << "Window not found!";
}
else
{
GetWindowThreadProcessId(hwnd,&pid);
HANDLE phandle = OpenProcess(PROCESS_ALL_ACCESS,0,pid);
if(!phandle)
{
cout <<"Could not get handle!";
}
else
{
cout << ReadProcessMemory(phandle,(LPVOID)0xC71657E900,&value,sizeof(value),0) << endl;
cout << value;
getch();
return 0;
}
}
}
解决 ! 当地址过大时,因为是64bit地址,程序改成32bit地址,所以不工作。
因此,在 Visual Studio 中,设置为 x64。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.