冰楓論壇

標題: TwMS v209.1 ICS 座標左右走(指定範圍) [打印本頁]

作者: prt    時間: 2018-8-1 16:54
標題: TwMS v209.1 ICS 座標左右走(指定範圍)
  1. //TwMS 209.1 ICS 座標左右走(指定範圍)
  2. //Author: Onion
  3. //修改:   PearDelicious, Thx to MS88088
  4. [Enable]
  5. RegisterSymbol(SwitchLR)
  6. RegisterSymbol(X)
  7. RegisterSymbol(RBound)
  8. RegisterSymbol(LBound)
  9. Alloc(AutoLRICS,512)
  10. Alloc(MyLR,4)
  11. Alloc(X,4)        //初始位置
  12. Alloc(Step,4)
  13. Alloc(LBound,4)        //左方距離
  14. Alloc(RBound,4)        //右方距離
  15. Alloc(SwitchLR,4)
  16. Label(InitFun)
  17. Label(AutoLR)
  18. Label(GetWall)
  19. Label(GetChrX)
  20. Label(GoRight)
  21. Label(GoLeft)

  22. //-----------------------------------------------
  23. LBound:
  24. DD 1A       //距離 16進制 1A=26
  25. RBound:
  26. DD 12C     //距離 16進制 12C=300
  27. X:
  28. ReadMem([[[036D9A9C]+B62C]+34]+60, 4)
  29. //-----------------------------------------------

  30. SwitchLR:
  31. DD 01
  32. Step:
  33. DD 0
  34. MyLR:
  35. DD 1 //開啟後先向右走

  36. AutoLRICS:
  37. Cmp [Esp],0096E9AF
  38. Jne GetFocus
  39. Mov Eax,[Step]
  40. Cmp Eax,0
  41. je  InitFun
  42. Mov Eax,[SwitchLR]
  43. Cmp Eax,01
  44. jne GetFocus
  45. Mov [Esp],AutoLR
  46. Jmp GetFocus

  47. InitFun:
  48. Mov [Step],1
  49. Mov Eax,[X]
  50. Sub Eax,[LBound]
  51. Mov [LBound],Eax
  52. Mov Eax,[X]
  53. Add Eax,[RBound]
  54. Mov [RBound],Eax
  55. Ret

  56. AutoLR:
  57. Call GetWall
  58. Mov  [ebp-1C],Eax
  59. Xor  Ecx,Ecx
  60. Xor  Eax,Eax
  61. Cmp  [ebp-1C],Eax
  62. Jmp  0096F1F7

  63. GetWall:
  64. call GetChrX
  65. Mov  Ecx,[LBound]
  66. Sub  Eax,Ecx
  67. Cmp  Eax,0
  68. Jle  GoRight
  69. call GetChrX
  70. Mov  Ecx,[RBound]
  71. sub  Ecx,Eax
  72. cmp  Ecx,0
  73. Jle  GoLeft
  74. Mov  Eax,[MyLR]
  75. Ret

  76. GetChrX:
  77. Mov Eax,[036D9A9C]
  78. Mov Eax,[Eax+B62C]
  79. Mov Eax,[Eax+34]
  80. Mov Eax,[Eax+60]
  81. ret

  82. GoRight:
  83. Mov [MyLR],1
  84. Mov Eax,1
  85. Ret

  86. GoLeft:
  87. Mov [MyLR],FFFFFFFF
  88. Mov Eax,FFFFFFFF
  89. Ret

  90. 039458C0:
  91. DD AutoLRICS

  92. [Disable]
  93. 039458C0:
  94. DD GetFocus

  95. DeAlloc(LBound)
  96. DeAlloc(RBound)
  97. DeAlloc(Step)
  98. DeAlloc(X)
  99. DeAlloc(MyLR)
  100. DeAlloc(AutoLRICS)
  101. UnRegisterSymbol(SwitchLR)
  102. UnRegisterSymbol(X)
  103. UnRegisterSymbol(RBound)
  104. UnRegisterSymbol(LBound)
複製代碼





歡迎光臨 冰楓論壇 (https://bingfong.com/) Powered by 冰楓