我有這個AA腳本(作弊引擎的腳本語言):幫助在AA腳本轉換爲C++
[ENABLE]
alloc(newmem,2048) //2kb should be enough
label(returnhere)
label(exit)
00415e19:
jmp newmem
returnhere:
newmem:
mov [00451104],0//moves 0 to the clock variable
//nop//nops the clock increaser
exit:
jmp returnhere
[DISABLE]
dealloc(newmem)
00415e19:
mov [00451104],eax
//Alt: db A3 04 11 45 00
它的工作 - 停止比賽計時鐘。現在,我試圖將此代碼轉換爲C++。這是我到目前爲止所做的:
#include <windows.h>
HWND FindIcyTower()
{
return FindWindowA(NULL, "Icy Tower v1.4");
}
void WPM(HWND hWnd,int address, byte *data, int dataSize)
{
DWORD proc_id;
GetWindowThreadProcessId(hWnd, &proc_id);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id);
if(!hProcess)
return;
WriteProcessMemory(hProcess, (LPVOID)address, data, dataSize, NULL);
CloseHandle(hProcess);
}
void EnableClockHack()
{
WPM(FindIcyTower(), 0x00415E19, {0xc7, 0x05, 0x04, 0x11 ,0x45, 0x00, 0x00, 0x00, 0x00, 0x00}, 9);
}
void DisableClockHack()
{
WPM(FindIcyTower(), 0x00415E19, {0xA3, 0x04, 0x11, 0x45, 0x00}, 4);
}
但它會崩潰的遊戲,而不是停止時鐘。任何想法?返回FindWindowA(NULL,「Icy Tower v1.4」);
'!IcyTower'和'NULL'是一樣的。只要'回到IcyTower;';或者更短'返回FindWindowA(NULL,「Icy Tower v1.4」);' – GManNickG 2010-01-16 17:12:01
謝謝,修正。但是任何想法爲什麼會讓遊戲崩潰? – 2010-01-16 17:14:52
作弊者在冰冷的塔,淘氣的男人:D – Skurmedel 2010-01-16 17:16:28