1.准备工具
OD
OllyDbg吾爱专版:http://download.csdn.net/detail/zang141588761/9602504
2.找到加速地址
Const SleepBase=$0041d6bd //加速 90,90,6A,01,90 //原速 EB,02,33,C9,51 NewSpeed:array[1..5] of byte=($90,$90,$6a,$1,$90); OldSpeed:array[1..5] of byte=($EB,$02,$33,$C9,$51); var readByte:DWORD; //终极加速 WriteProcessMemory(hprocess,Pointer(SleepBase),@NewSpeed,5,readByte);
3.编码
//常量定义 Const SleepBase=$0041d6bd; //加速 90,90,6A,01,90 //原速 EB,02,33,C9,51 var NewSpeed:array[1..5] of byte=($90,$90,$6a,$1,$90); OldSpeed:array[1..5] of byte=($EB,$02,$33,$C9,$51); Function addSpeed():integer; //终极加速 var Gameh:HWND; GamePid:DWORD; Gamehprocess: THandle; WriteByte:DWORD; //实际写入字节数 begin //获取游戏窗口句柄 Gameh:=findwindow(nil,'对对碰角色版'); //获取进程ID GetWindowThreadprocessID(Gameh,GamePid); //获取进程句柄 gamehProcess:=OpenProcess(windows.PROCESS_ALL_ACCESS,false,GamePid); //根据坐位号码 读出相应棋盘数据 Writeprocessmemory(gamehProcess,Pointer(SleepBase) ,@NewSpeed[1],5, WriteByte); result:=Writebyte; end;