问题在标题中,我使用写入进程内存来更改内存中的一些值我在 64 位窗口中尝试过它并且它工作得很好,但问题是在 32 位窗口中它没有写入我想要读取进程内存的值64位窗口和32位窗口,但问题是书面请帮助我(:
编辑:代码是:
#include "stdafx.h"
#include <iostream>
#include <fstream>
#include <windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
cout << "Loading..."<< endl;
int address = 0x3458CBC0;
int address2 = 0x3458CBC4;
int value = 20;
DWORD pid;
HWND hwnd = FindWindowA(NULL,"some window");
GetWindowThreadProcessId(hwnd,&pid);
HANDLE phandle;
cout << "Found Proccess ID:" << pid << endl;
phandle = OpenProcess(0x1F0FFF,0,pid);
cout << "Loaded Successfully."<< endl ;
ReadProcessMemory(phandle,(LPVOID)address,&value,4,0);
cout << "Readed Value:" << value << endl;
ReadProcessMemory(phandle,(LPVOID)address2,&value,4,0);
cout << "Readed Value:" << value << endl;
address = 0x3458CBC0;
address2 = 0x3458CBC4;
value = 20;
WriteProcessMemory(phandle,(LPVOID)address,&value,4,0);
WriteProcessMemory(phandle,(LPVOID)address2,&value,4,0);
cin.get();
return 0;
}
解决方案:
该应用程序挂钩了在内核中写入内存的 api,该挂钩在 64 位 Windows 中不起作用,因此我可以写入内存
感谢大家!