设为首页收藏本站淘宝杂货铺

从F到0 - From F to 0

 找回密码
 注册已关闭
搜索
查看: 1870|回复: 0
收起左侧

易语言MASM置入代码字节集(字节型数组)所有字节位与、位或、位异或运算(返回字节型)

[复制链接]
发表于 2019-10-10 19:00:00 |阅读模式

  1. .版本 2

  2. .程序集 程序集1

  3. .子程序 _启动子程序, 整数型, , 请在本子程序中放置易模块初始化代码


  4. _临时子程序 ()  ' 在初始化代码执行完毕后调用测试代码
  5. 返回 (0)  ' 可以根据您的需要返回任意数值

  6. .子程序 _临时子程序

  7. ' 本名称子程序用作测试程序用,仅在开发及调试环境中有效,编译发布程序前将被系统自动清空,请将所有用作测试的临时代码放在本子程序中。 ***注意不要修改本子程序的名称、参数及返回值类型。
  8. 输出调试文本 (字节集_位与 ({ 255, 127, 123, 170 }))
  9. 输出调试文本 (字节集_位或 ({ 1, 2, 4, 8 }))
  10. 输出调试文本 (字节集_位异或 ({ 1, 2, 4, 8, 13 }))

  11. 输出调试文本 (字节型数组_位与 ({ 255, 127, 123, 170 }))
  12. 输出调试文本 (字节型数组_位或 ({ 1, 2, 4, 8 }))
  13. 输出调试文本 (字节型数组_位异或 ({ 1, 2, 4, 8, 13 }))




  14. .子程序 字节集_位与, 字节型, 公开
  15. .参数 字节集, 字节集

  16. 置入代码 ({ 83, 81, 82, 139, 69, 8, 11, 192, 117, 2, 235, 45, 139, 0, 11, 192, 117, 2, 235, 37, 139, 88, 4, 11, 219, 117, 4, 51, 192, 235, 26, 131, 192, 8, 51, 201, 178, 255, 235, 10, 34, 20, 1, 10, 210, 117, 2, 235, 5, 65, 59, 203, 114, 242, 15, 182, 194, 90, 89, 91, 201, 194, 4, 0 })
  17. ' push ebx
  18. ' push ecx
  19. ' push edx
  20. ' mov eax,[ebp+8]
  21. ' .if eax == 0
  22. ' jmp ASM_END
  23. ' .endif
  24. ' mov eax,[eax]
  25. ' .if eax == 0
  26. ' jmp ASM_END
  27. ' .endif
  28. ' mov ebx,[eax+4]
  29. ' .if ebx == 0
  30. ' xor eax,eax
  31. ' jmp ASM_END
  32. ' .endif
  33. ' add eax,8
  34. ' xor ecx,ecx
  35. ' mov dl,255
  36. ' .while ecx < ebx
  37. ' and dl,[eax+ecx]
  38. ' .if dl == 0
  39. ' .break
  40. ' .endif
  41. ' inc ecx
  42. ' .endw
  43. ' movzx eax,dl
  44. ' ASM_END:
  45. ' pop edx
  46. ' pop ecx
  47. ' pop ebx
  48. ' leave
  49. ' retn 4

  50. 返回 (0)

  51. .子程序 字节集_位或, 字节型, 公开
  52. .参数 字节集, 字节集

  53. 置入代码 ({ 83, 81, 82, 139, 69, 8, 11, 192, 117, 2, 235, 46, 139, 0, 11, 192, 117, 2, 235, 38, 139, 88, 4, 11, 219, 117, 4, 51, 192, 235, 27, 131, 192, 8, 51, 201, 50, 210, 235, 11, 10, 20, 1, 128, 250, 255, 117, 2, 235, 5, 65, 59, 203, 114, 241, 15, 182, 194, 90, 89, 91, 201, 194, 4, 0 })
  54. ' push ebx
  55. ' push ecx
  56. ' push edx
  57. ' mov eax,[ebp+8]
  58. ' .if eax == 0
  59. ' jmp ASM_END
  60. ' .endif
  61. ' mov eax,[eax]
  62. ' .if eax == 0
  63. ' jmp ASM_END
  64. ' .endif
  65. ' mov ebx,[eax+4]
  66. ' .if ebx == 0
  67. ' xor eax,eax
  68. ' jmp ASM_END
  69. ' .endif
  70. ' add eax,8
  71. ' xor ecx,ecx
  72. ' xor dl,dl
  73. ' .while ecx < ebx
  74. ' or dl,[eax+ecx]
  75. ' .if dl == 255
  76. ' .break
  77. ' .endif
  78. ' inc ecx
  79. ' .endw
  80. ' movzx eax,dl
  81. ' ASM_END:
  82. ' pop edx
  83. ' pop ecx
  84. ' pop ebx
  85. ' leave
  86. ' retn 4


  87. 返回 (0)

  88. .子程序 字节集_位异或, 字节型, 公开
  89. .参数 字节集, 字节集

  90. 置入代码 ({ 83, 81, 82, 139, 69, 8, 11, 192, 117, 2, 235, 39, 139, 0, 11, 192, 117, 2, 235, 31, 139, 88, 4, 11, 219, 117, 4, 51, 192, 235, 20, 131, 192, 8, 51, 201, 50, 210, 235, 4, 50, 20, 1, 65, 59, 203, 114, 248, 15, 182, 194, 90, 89, 91, 201, 194, 4, 0 })
  91. ' push ebx
  92. ' push ecx
  93. ' push edx
  94. ' mov eax,[ebp+8]
  95. ' .if eax == 0
  96. ' jmp ASM_END
  97. ' .endif
  98. ' mov eax,[eax]
  99. ' .if eax == 0
  100. ' jmp ASM_END
  101. ' .endif
  102. ' mov ebx,[eax+4]
  103. ' .if ebx == 0
  104. ' xor eax,eax
  105. ' jmp ASM_END
  106. ' .endif
  107. ' add eax,8
  108. ' xor ecx,ecx
  109. ' xor dl,dl
  110. ' .while ecx < ebx
  111. ' xor dl,[eax+ecx]
  112. ' inc ecx
  113. ' .endw
  114. ' movzx eax,dl
  115. ' ASM_END:
  116. ' pop edx
  117. ' pop ecx
  118. ' pop ebx
  119. ' leave
  120. ' retn 4

  121. 返回 (0)

  122. .子程序 字节型数组_位与, 字节型, 公开
  123. .参数 字节型数组, 字节型, 数组

  124. 置入代码 ({ 83, 81, 82, 139, 69, 8, 11, 192, 117, 2, 235, 45, 139, 0, 11, 192, 117, 2, 235, 37, 139, 88, 4, 11, 219, 117, 4, 51, 192, 235, 26, 131, 192, 8, 51, 201, 178, 255, 235, 10, 34, 20, 1, 10, 210, 117, 2, 235, 5, 65, 59, 203, 114, 242, 15, 182, 194, 90, 89, 91, 201, 194, 4, 0 })
  125. ' push ebx
  126. ' push ecx
  127. ' push edx
  128. ' mov eax,[ebp+8]
  129. ' .if eax == 0
  130. ' jmp ASM_END
  131. ' .endif
  132. ' mov eax,[eax]
  133. ' .if eax == 0
  134. ' jmp ASM_END
  135. ' .endif
  136. ' mov ebx,[eax+4]
  137. ' .if ebx == 0
  138. ' xor eax,eax
  139. ' jmp ASM_END
  140. ' .endif
  141. ' add eax,8
  142. ' xor ecx,ecx
  143. ' mov dl,255
  144. ' .while ecx < ebx
  145. ' and dl,[eax+ecx]
  146. ' .if dl == 0
  147. ' .break
  148. ' .endif
  149. ' inc ecx
  150. ' .endw
  151. ' movzx eax,dl
  152. ' ASM_END:
  153. ' pop edx
  154. ' pop ecx
  155. ' pop ebx
  156. ' leave
  157. ' retn 4

  158. 返回 (0)

  159. .子程序 字节型数组_位或, 字节型, 公开
  160. .参数 字节型数组, 字节型, 数组

  161. 置入代码 ({ 83, 81, 82, 139, 69, 8, 11, 192, 117, 2, 235, 46, 139, 0, 11, 192, 117, 2, 235, 38, 139, 88, 4, 11, 219, 117, 4, 51, 192, 235, 27, 131, 192, 8, 51, 201, 50, 210, 235, 11, 10, 20, 1, 128, 250, 255, 117, 2, 235, 5, 65, 59, 203, 114, 241, 15, 182, 194, 90, 89, 91, 201, 194, 4, 0 })
  162. ' push ebx
  163. ' push ecx
  164. ' push edx
  165. ' mov eax,[ebp+8]
  166. ' .if eax == 0
  167. ' jmp ASM_END
  168. ' .endif
  169. ' mov eax,[eax]
  170. ' .if eax == 0
  171. ' jmp ASM_END
  172. ' .endif
  173. ' mov ebx,[eax+4]
  174. ' .if ebx == 0
  175. ' xor eax,eax
  176. ' jmp ASM_END
  177. ' .endif
  178. ' add eax,8
  179. ' xor ecx,ecx
  180. ' xor dl,dl
  181. ' .while ecx < ebx
  182. ' or dl,[eax+ecx]
  183. ' .if dl == 255
  184. ' .break
  185. ' .endif
  186. ' inc ecx
  187. ' .endw
  188. ' movzx eax,dl
  189. ' ASM_END:
  190. ' pop edx
  191. ' pop ecx
  192. ' pop ebx
  193. ' leave
  194. ' retn 4


  195. 返回 (0)

  196. .子程序 字节型数组_位异或, 字节型, 公开
  197. .参数 字节型数组, 字节型, 数组

  198. 置入代码 ({ 83, 81, 82, 139, 69, 8, 11, 192, 117, 2, 235, 39, 139, 0, 11, 192, 117, 2, 235, 31, 139, 88, 4, 11, 219, 117, 4, 51, 192, 235, 20, 131, 192, 8, 51, 201, 50, 210, 235, 4, 50, 20, 1, 65, 59, 203, 114, 248, 15, 182, 194, 90, 89, 91, 201, 194, 4, 0 })
  199. ' push ebx
  200. ' push ecx
  201. ' push edx
  202. ' mov eax,[ebp+8]
  203. ' .if eax == 0
  204. ' jmp ASM_END
  205. ' .endif
  206. ' mov eax,[eax]
  207. ' .if eax == 0
  208. ' jmp ASM_END
  209. ' .endif
  210. ' mov ebx,[eax+4]
  211. ' .if ebx == 0
  212. ' xor eax,eax
  213. ' jmp ASM_END
  214. ' .endif
  215. ' add eax,8
  216. ' xor ecx,ecx
  217. ' xor dl,dl
  218. ' .while ecx < ebx
  219. ' xor dl,[eax+ecx]
  220. ' inc ecx
  221. ' .endw
  222. ' movzx eax,dl
  223. ' ASM_END:
  224. ' pop edx
  225. ' pop ecx
  226. ' pop ebx
  227. ' leave
  228. ' retn 4

  229. 返回 (0)
复制代码

相关帖子

您需要登录后才可以回帖 登录 | 注册已关闭

本版积分规则

QQ|手机版|Archiver|从F到0 ( 蒙ICP备17002595号-1 )
蒙公网安备15010402000325号

腾讯云安全认证

GMT+8, 2024-3-29 01:49 , Processed in 0.457026 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表