以下是原碼
Private Const W2I_CALL_BASE = &H98ADDC '總基址?!
Private Const W2I_CALL_BASE = &H98B460 '動態基址?! 這兩個都測試過 都會使遊戲當機
Private Sub cmdFlyclip_Click()
Call SendFlyClipPacket(1336.98, 711.52, 252.357, pid)
End Sub
Public Function Float2Int(ANS As Single) As Long
CopyMemory Float2Int, ANS, 4
End Function
Public Sub SendFlyClipPacket(ByVal x As Single, ByVal Y As Single, ByVal z As Single, ByVal pid As Long)
Dim asm As New clsASM
Const W2I_GOTO_COS_CALL1 = &H4637E0 '走路CALL1
Const W2I_GOTO_COS_CALL2 = &H467270 '走路CALL2
Const W2I_GOTO_COS_CALL3 = &H463BE0 '走路CALL3
With asm
.Mov_EAX_DWORD_Ptr W2I_CALL_BASE
.Mov_EBX_DWORD_Ptr_EAX_Add &H1C
.Mov_EBX_DWORD_Ptr_EBX_Add &H20
.Mov_ECX_DWORD_Ptr_EBX_Add &HC70
.Push 1
.Mov_EBX W2I_GOTO_COS_CALL1
.Call_EBX
.Mov_ESI_EAX
.Lea_EAX_DWORD_Ptr_ESP_Add &H50
.Push_EAX
.Push 1
.Mov_ECX_ESI
.Mov_EBX W2I_GOTO_COS_CALL2
.Call_EBX
.Mov_EAX_DWORD_Ptr W2I_CALL_BASE
.Mov_EBX_DWORD_Ptr_EAX_Add &H1C
.Mov_EBX_DWORD_Ptr_EBX_Add &H20
.Mov_ECX_DWORD_Ptr_EBX_Add &HC70
.Push 0
.Push 1
.Push_ESI
.Push 1
.Mov_EBX W2I_GOTO_COS_CALL3
.Call_EBX
.Mov_EAX_DWORD_Ptr W2I_CALL_BASE
.Mov_EBX_DWORD_Ptr_EAX_Add &H1C
.Mov_EBX_DWORD_Ptr_EBX_Add &H20
.Mov_ECX_DWORD_Ptr_EBX_Add &HC70
.Mov_EAX_DWORD_Ptr_EAX_Add &H30
.Mov_EAX_DWORD_Ptr_EAX_Add &H4
.Mov_DWORD_Ptr_EAX_ADD &H20, Float2Int(x)
.Mov_DWORD_Ptr_EAX_ADD &H24, Float2Int(z)
.Mov_DWORD_Ptr_EAX_ADD &H28, Float2Int(Y)
.Popad
.ret
End With
asm.inject pid
asm.Run_ASM pid, 0 '當機的位子都是跑在這一段 錯誤訊息是 此段記憶體無法寫入
asm.free pid, 0
End Sub
請問 這以上程式碼 有哪邊錯誤的地方嗎...
我是參考讓人物移動文章的寫出這段的 配合 133的基址
所以不知道是哪邊出了問題 導致寫入的記憶體位置錯誤?!
請幫我解答 感謝~ |