冰楓論壇

標題: TwMS v228.1 ICS Item Filter [打印本頁]

作者: 麗麗    時間: 2020-9-21 15:06
標題: TwMS v228.1 ICS Item Filter
  1. // TwMS v228.1 ICS Item Filter

  2. [ENABLE]
  3. Alloc(ItemFilter_CheckESP,1024)
  4. Alloc(ItemList,10240)
  5. Alloc(Mesos,4)
  6. Alloc(Mode,4)
  7. Alloc(ItemFilterSW,4)
  8. RegisterSymbol(ItemFilterSW)
  9. Label(ItemFilter_Hook)
  10. Label(ItemFilter)
  11. Label(End)
  12. Label(FilterMesos)
  13. Label(RejectOrAccept)
  14. Label(AcceptFilter)
  15. Label(RejectFilter)
  16. Label(Ignore)

  17. ItemFilterSW:
  18. DD 1

  19. Mesos:
  20. DD 0 // Minimum meso

  21. Mode:
  22. DD 1 // 0 = Accept 1 = Reject

  23. ItemList:
  24. //Add filter like below
  25. //dd ItemID
  26. DD #2000006//活力神水


  27. DD 00 // End of list


  28. ItemFilter_CheckESP:
  29. cmp [esp+10],0150017E
  30. jne GetLastError
  31. mov [esp+10],ItemFilter_Hook
  32. jmp GetLastError

  33. ItemFilter_Hook:
  34. cmp [ItemFilterSW],1
  35. jne 0150017E
  36. mov ecx,[ebx+48]
  37. mov [ecx+04],al
  38. mov ecx,00009A65
  39. mov edi,[ebx+48]
  40. mov al,[edi+04]
  41. test al,al
  42. mov [edi+08],cx
  43. movzx ebx,al
  44. mov ecx,0000002A
  45. cmove ebx,ecx
  46. mov al,bl
  47. xor al,[ebp-34]
  48. mov [edi],al
  49. add al,cl
  50. add bl,al
  51. mov eax,[ebp-20]
  52. mov esi,[eax+48]
  53. movzx eax,bl
  54. movzx ecx,word ptr [esi+08]
  55. mov dx,cx
  56. shr dx,0D
  57. add dx,ax
  58. lea eax,[ecx*8+00000000]
  59. mov ecx,0000002A
  60. or dx,ax
  61. test bl,bl
  62. mov [esi+08],dx
  63. movzx eax,bl
  64. cmovne ecx,eax
  65. mov al,cl
  66. add cl,2A
  67. xor al,[ebp-33]
  68. mov [edi+01],al
  69. lea ebx,[ecx+eax]
  70. mov eax,[ebp-20]
  71. mov esi,[eax+48]
  72. movzx eax,bl
  73. movzx ecx,word ptr [esi+08]
  74. mov dx,cx
  75. shr dx,0D
  76. add dx,ax
  77. lea eax,[ecx*8+00000000]
  78. mov ecx,0000002A
  79. or dx,ax
  80. test bl,bl
  81. movzx eax,bl
  82. cmovne ecx,eax
  83. mov [esi+08],dx
  84. mov al,cl
  85. add cl,2A
  86. xor al,[ebp-32]
  87. mov [edi+02],al
  88. lea ebx,[ecx+eax]
  89. mov eax,[ebp-20]
  90. mov esi,[eax+48]
  91. movzx eax,bl
  92. movzx ecx,word ptr [esi+08]
  93. mov dx,cx
  94. shr dx,0D
  95. add dx,ax
  96. lea eax,[ecx*8+00000000]
  97. mov ecx,0000002A
  98. or dx,ax
  99. movzx eax,bl
  100. test bl,bl
  101. mov [esi+08],dx
  102. mov ebx,[ebp-20]
  103. cmovne ecx,eax
  104. mov al,cl
  105. add cl,2A
  106. xor al,[ebp-31]
  107. mov [edi+03],al
  108. add al,cl
  109. mov esi,[ebx+48]
  110. movzx eax,al
  111. movzx ecx,word ptr [esi+08]
  112. mov dx,cx
  113. shr dx,0D
  114. add dx,ax
  115. lea eax,[ecx*8+00000000]
  116. or dx,ax
  117. mov [esi+08],dx
  118. mov esi,[ebp+08]
  119. mov ecx,esi
  120. call 0088FAB0
  121. mov ecx,esi
  122. mov [ebx+000000F4],eax
  123. call 0088FAB0
  124. mov ecx,esi
  125. mov [ebx+000000F8],eax
  126. call 0088FAB0
  127. mov ecx,esi
  128. movd xmm0,eax
  129. cvtdq2ps xmm0,xmm0
  130. divss xmm0,[03A0395C]
  131. movss [ebx+00000110],xmm0
  132. call 0088FAB0
  133. mov ecx,[044E9100]
  134. jmp ItemFilter

  135. ItemFilter:
  136. push edx
  137. mov edx,[Mesos]
  138. cmp eax,edx
  139. jle FilterMesos
  140. mov edx,ItemList
  141. jmp RejectOrAccept

  142. FilterMesos:
  143. mov eax,0
  144. jmp End

  145. RejectOrAccept:
  146. cmp byte ptr [Mode],0
  147. je AcceptFilter
  148. cmp byte ptr [Mode],1
  149. je RejectFilter

  150. AcceptFilter:
  151. cmp eax,[edx](Mesos)
  152. je End
  153. cmp dword ptr [edx],0
  154. je Ignore
  155. add edx,4
  156. jmp AcceptFilter

  157. RejectFilter:
  158. cmp eax,[edx]
  159. je Ignore
  160. cmp dword ptr [edx],0
  161. je End
  162. add edx,4
  163. jmp RejectFilter

  164. Ignore:
  165. cmp eax,3E8 // Added this code otherwise mesos is dropped but not shown in accept mode
  166. jle End
  167. mov eax,0

  168. End:
  169. pop edx
  170. mov [ebp-34],eax        // Original Opcode
  171. inc ecx                // Original Opcode
  172. mov eax,939A85C5        // Original Opcode
  173. jmp 015002E0

  174. 039FE1C4:
  175. DD ItemFilter_CheckESP

  176. [DISABLE]
  177. 039FE1C4:
  178. DD GetLastError

  179. DeAlloc(ItemFilter_CheckESP)
  180. DeAlloc(ItemList)
  181. DeAlloc(Mesos)
  182. DeAlloc(Mode)
  183. DeAlloc(ItemFilterSW)
  184. UnRegisterSymbol(ItemFilterSW)
複製代碼

作者: 麗麗    時間: 2020-9-21 15:09
由於過濾清單太長,請自行添加。
附件是我常用的過濾清單。

ItemList.txt

48.61 KB, 下載次數: 16


作者: ke90927    時間: 2020-10-3 22:25
XD,这个物品过滤可以缩减的,缩减后顶多就是和原样CRC数据一样,还是ICS只不过会多出一行代码。
mov
作者: 麗麗    時間: 2020-10-4 10:00
ke90927 發表於 2020-10-3 22:25
XD,这个物品过滤可以缩减的,缩减后顶多就是和原样CRC数据一样,还是ICS只不过会多出一行代码。
mov ...

多謝~

精簡版:
  1. // TwMS v228.1 ICS Item Filter

  2. [ENABLE]
  3. Alloc(ItemFilter_CheckESP,1024)
  4. Alloc(ItemList,10240)
  5. Alloc(Mesos,4)
  6. Alloc(Mode,4)
  7. Alloc(ItemFilterSW,4)
  8. RegisterSymbol(ItemFilterSW)
  9. Label(ItemFilter_Hook)
  10. Label(ItemFilter)
  11. Label(End)
  12. Label(FilterMesos)
  13. Label(RejectOrAccept)
  14. Label(AcceptFilter)
  15. Label(RejectFilter)
  16. Label(Ignore)

  17. ItemFilterSW:
  18. DD 1

  19. Mesos:
  20. DD 0 // Minimum meso

  21. Mode:
  22. DD 1 // 0 = Accept 1 = Reject

  23. ItemList:
  24. //Add filter like below
  25. //dd ItemID
  26. DD #2000006//活力神水


  27. DD 00 // End of list


  28. ItemFilter_CheckESP:
  29. cmp [esp+10],0150017E
  30. jne GetLastError
  31. cmp [ItemFilterSW],1
  32. jne GetLastError
  33. mov [esp+10],ItemFilter_Hook
  34. jmp GetLastError

  35. ItemFilter_Hook:
  36. mov ecx,[044E9100]
  37. jmp ItemFilter

  38. ItemFilter:
  39. push edx
  40. mov edx,[Mesos]
  41. cmp eax,edx
  42. jle FilterMesos
  43. mov edx,ItemList
  44. jmp RejectOrAccept

  45. FilterMesos:
  46. mov eax,0
  47. jmp End

  48. RejectOrAccept:
  49. cmp byte ptr [Mode],0
  50. je AcceptFilter
  51. cmp byte ptr [Mode],1
  52. je RejectFilter

  53. AcceptFilter:
  54. cmp eax,[edx](Mesos)
  55. je End
  56. cmp dword ptr [edx],0
  57. je Ignore
  58. add edx,4
  59. jmp AcceptFilter

  60. RejectFilter:
  61. cmp eax,[edx]
  62. je Ignore
  63. cmp dword ptr [edx],0
  64. je End
  65. add edx,4
  66. jmp RejectFilter

  67. Ignore:
  68. cmp eax,3E8 // Added this code otherwise mesos is dropped but not shown in accept mode
  69. jle End
  70. mov eax,0

  71. End:
  72. pop edx
  73. mov [ebp-34],eax        // Original Opcode
  74. inc ecx                // Original Opcode
  75. mov eax,939A85C5        // Original Opcode
  76. jmp 015002E0

  77. 039FE1C4:
  78. DD ItemFilter_CheckESP

  79. [DISABLE]
  80. 039FE1C4:
  81. DD GetLastError

  82. DeAlloc(ItemFilter_CheckESP)
  83. DeAlloc(ItemList)
  84. DeAlloc(Mesos)
  85. DeAlloc(Mode)
  86. DeAlloc(ItemFilterSW)
  87. UnRegisterSymbol(ItemFilterSW)
複製代碼

作者: rhg59321    時間: 2020-10-13 20:30
麗麗 發表於 2020-10-4 10:00
多謝~

精簡版:

代碼如果這樣精簡
似乎會把所有東西都過濾掉
作者: btb    時間: 2020-10-13 21:54
麗麗 發表於 2020-10-4 10:00
多謝~

精簡版:

movd xmm0,eax
cvtdq2ps xmm0,xmm0
divss xmm0,[03A0395C]
movss [ebx+00000110],xmm0
這邊很重要不能簡略
作者: huanghy_gz    時間: 2020-10-13 23:30
btb 發表於 2020-10-13 21:54
movd xmm0,eax
cvtdq2ps xmm0,xmm0
divss xmm0,[03A0395C]

这段代码执行后eax也不是物品ID, 必须要调用下面的call后,eax才有物品id。要不就是所有东西都屏蔽了。。




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