冰楓論壇
標題:
TwMS v209.1 ICS 座標左右走(指定範圍)
[打印本頁]
作者:
prt
時間:
2018-8-1 16:54
標題:
TwMS v209.1 ICS 座標左右走(指定範圍)
//TwMS 209.1 ICS 座標左右走(指定範圍)
//Author: Onion
//修改: PearDelicious, Thx to MS88088
[Enable]
RegisterSymbol(SwitchLR)
RegisterSymbol(X)
RegisterSymbol(RBound)
RegisterSymbol(LBound)
Alloc(AutoLRICS,512)
Alloc(MyLR,4)
Alloc(X,4) //初始位置
Alloc(Step,4)
Alloc(LBound,4) //左方距離
Alloc(RBound,4) //右方距離
Alloc(SwitchLR,4)
Label(InitFun)
Label(AutoLR)
Label(GetWall)
Label(GetChrX)
Label(GoRight)
Label(GoLeft)
//-----------------------------------------------
LBound:
DD 1A //距離 16進制 1A=26
RBound:
DD 12C //距離 16進制 12C=300
X:
ReadMem([[[036D9A9C]+B62C]+34]+60, 4)
//-----------------------------------------------
SwitchLR:
DD 01
Step:
DD 0
MyLR:
DD 1 //開啟後先向右走
AutoLRICS:
Cmp [Esp],0096E9AF
Jne GetFocus
Mov Eax,[Step]
Cmp Eax,0
je InitFun
Mov Eax,[SwitchLR]
Cmp Eax,01
jne GetFocus
Mov [Esp],AutoLR
Jmp GetFocus
InitFun:
Mov [Step],1
Mov Eax,[X]
Sub Eax,[LBound]
Mov [LBound],Eax
Mov Eax,[X]
Add Eax,[RBound]
Mov [RBound],Eax
Ret
AutoLR:
Call GetWall
Mov [ebp-1C],Eax
Xor Ecx,Ecx
Xor Eax,Eax
Cmp [ebp-1C],Eax
Jmp 0096F1F7
GetWall:
call GetChrX
Mov Ecx,[LBound]
Sub Eax,Ecx
Cmp Eax,0
Jle GoRight
call GetChrX
Mov Ecx,[RBound]
sub Ecx,Eax
cmp Ecx,0
Jle GoLeft
Mov Eax,[MyLR]
Ret
GetChrX:
Mov Eax,[036D9A9C]
Mov Eax,[Eax+B62C]
Mov Eax,[Eax+34]
Mov Eax,[Eax+60]
ret
GoRight:
Mov [MyLR],1
Mov Eax,1
Ret
GoLeft:
Mov [MyLR],FFFFFFFF
Mov Eax,FFFFFFFF
Ret
039458C0:
DD AutoLRICS
[Disable]
039458C0:
DD GetFocus
DeAlloc(LBound)
DeAlloc(RBound)
DeAlloc(Step)
DeAlloc(X)
DeAlloc(MyLR)
DeAlloc(AutoLRICS)
UnRegisterSymbol(SwitchLR)
UnRegisterSymbol(X)
UnRegisterSymbol(RBound)
UnRegisterSymbol(LBound)
複製代碼
歡迎光臨 冰楓論壇 (https://bingfong.com/)
Powered by 冰楓