以下是源碼,不知那裡有問題,只要在程式中執行 walkto(x,y.z) 這個程序就會當掉。
謝謝!
這源碼是在網路上找到的,謝謝提供這源碼的大大!
const
W2i_Base_ADDR=$A5BFB0;
W2I_BASE_Call=$A5B90C;
W2I_SEND_PACK_CALL=$60E310;
W2I_Walk_Call1=$469F00;
W2I_Walk_Call2=$46E090;
W2I_Walk_Call3=$46A340;
procedure WalkCall(aPParams:PParams); Stdcall;
var
Address1:pointer;
Address2:pointer;
Address3:pointer;
x,y,z:Single;
r_POSITION1:Integer;
begin
Address1:=Pointer(W2I_Walk_Call1);
Address2:=pointer(W2I_Walk_Call2);
Address3:=pointer(W2I_Walk_Call3);
x:=aPParams^.Param3;
y:=aPParams^.Param4;
z:=aPParams^.Param5;
asm
pushad
mov eax, dword ptr [W2I_BASE_ADDR]
mov eax, dword ptr [eax+$1C]
mov esi, dword ptr [eax+$20]
mov ecx, dword ptr [esi+$dd4] //Bcc+8=BD4 dd4 fec
push 1
call Address1
mov edi, eax
lea eax, dword ptr [esp+$18]
push eax
push 0 //r_POSITION1 //0地面 1空中
mov ecx, edi
call Address2
mov ecx, dword ptr [esi+$dd4] //Bcc+8=BD4 dd4 fec
push 0
push 1
push edi
push 1
call Address3
mov eax, dword ptr [W2I_BASE_ADDR]
mov eax, dword ptr [eax+$1C]
mov eax, dword ptr [eax+$20]
mov eax, dword ptr [eax+$dd4] //Bcc+8=BD4 dd4 fec
mov eax, dword ptr [eax+$30]
mov ecx, dword ptr [eax+4]
mov eax, x
mov dword ptr[ecx+$20], eax
mov eax, z
mov dword ptr[ecx+$24], eax
mov eax, y
mov dword ptr[ecx+$28], eax
popad
end;
end;
procedure TForm1.WalkTo(x, y, z: single);
var
aParams : TParams;
aParamsSize: DWORD;
begin
aParams.Param3:=x;
aParams.Param4:=y;
aParams.Param5:=z;
aParamsSize:=SizeOf(aParams);
if hCurrentHandle<>0 then
begin
injectfunc(@WalkCall, @aParams, aParamsSize);
end;
end; |