C++修改植物大战僵尸阳光
程序员文章站
2022-05-29 09:09:20
...
代码涉及基址与偏移地址
#include <iostream>
#include <windows.h>
using namespace std;
int main(){
HWND tmp1=FindWindow(NULL,"植物大战僵尸中文版");
DWORD pid,a;
GetWindowThreadProcessId(tmp1,&pid);
HANDLE h;
h=OpenProcess(PROCESS_ALL_ACCESS,false,pid);
ReadProcessMemory(h,(LPVOID)0x6A9ec0,&a,4,NULL);
ReadProcessMemory(h,(LPVOID)(a+0x768),&a,4,NULL);
a+=0x5560;
while(1){
int n;
cin>>n;
WriteProcessMemory(h,(LPVOID)a,&n,4,NULL);
}
return 0;
}