我已经大概知道编程 , 但是却无法修改游戏中的数值 , 请高手指正我哪边错误了 ? 谢谢 !
程式可以运行 , 我在输入 address 有加上16进位的 0x , value 这是修改直接要得值 ?
开启时会叫出client.exe , client.exe会显示 0x440004= 7474
代码是外国高手帮忙的 , 我不知到哪边错误 , 请版上高手帮帮忙 谢谢 ~
====================================
首先 run MemoryEdit.exe
佢会 CreateProcess and run Client.exe
Client.exe 会 不断 咁 print 会 int 既 address and value
之后 MemoryEdit.exe 会要你 input 个 address 你要 edit 既
个 address 可以 抄返 Client.exe Show 出 o黎 既
e.g. 010E9008 就 input 0x010E9008 <= 0x 开头 hex
之后 要你 input 个 value e.g. input 8888
之后 等 5 秒
check 返 Client.exe
佢个 value 会 唔同左
=====================================
Client.exe
复制程式
#include <windows.h>
#include <iostream>
int addr = 7474;
int main()
{
int i=0;
while(++i < 1000)
{
std::cout << &addr << " = " << addr << std::endl;
Sleep(1000);
}
return 0;
}
MemoryEdit.exe
复制程式
#include <windows.h>
#include <iostream>
#include <string>
using namespace std;
HANDLE g_hProcess;
DWORD g_arList;
int iVal;
BOOL WriteMemory(DWORD dwAddr, DWORD dwValue)
{
return ::WriteProcessMemory(g_hProcess, (LPVOID)dwAddr, &dwValue, sizeof(DWORD), NULL);
}
int main()
{
char szFileName[] = "Client.exe";
STARTUPINFO si = {sizeof(si)};
PROCESS_INFORMATION pi;
::CreateProcess(NULL, szFileName, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi);
cout << "Please enter the addr [0x1234567...]: ";
cin >> hex >> g_arList;
cout << "Please enter the value: ";
cin.clear();
cin >> dec >> iVal;
Sleep(5000);
CloseHandle(pi.hThread);
g_hProcess = pi.hProcess;
if(WriteMemory(g_arList, iVal))
cout << "Memory: " << g_arList << " [Written]\n";
CloseHandle(g_hProcess);
return 0;
}
::CreateProcess(NULL, szFileName, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si,
&pi);
程式码尾
π 这边是 & pi