mirror 散播福音的祭司
註冊時間: 2007-07-27 文章: 174
828.60 果凍幣
|
發表於: 2007-10-25, AM 10:04 星期四 文章主題: VC++單機遊戲修改-鬼武者3 |
|
|
[鬼武者3]
自己做一個Timer,然後把下面程式碼寫入即可
代碼: |
CWnd *w; //視窗handle(MFC)
DWORD hThreadID ,hProcessID; //程序ID
HANDLE hProcess; //程序handle
w = FindWindow(NULL,"oni3"); //搜尋視窗
LPVOID B_Address = (LPVOID)0x03CAF1D4; //地址:鬼武者持續變身時間
LPCVOID BF; //緩衝變數
//開啟程序
hThreadID = GetWindowThreadProcessId(*w, &hProcessID);
hProcess = OpenProcess(PROCESS_ALL_ACCESS , 0, hProcessID);
//判斷用數值
int wi;
BF = (LPCVOID)&wi;
//讀取數值
ReadProcessMemory(hProcess, B_Address,(LPVOID)BF,sizeof(&BF),(SIZE_T*) 0);
//持續寫入數值
if(wi <= 100)
{
wi = 500;
//寫入 hProcess:程序 ,B_Address:數值 ,大小 ,讀寫起始位置
WriteProcessMemory(hProcess, B_Address,BF,sizeof(&BF),(SIZE_T*) 0);
} |
|
|