本帖最后由 果心豆腐酱 于 2024-3-11 00:49 编辑
改自[分享源码] 汇编 最快寻找文本+寻找字节集--->>一网打尽!
源码是取第一次出现的文本中间(和精易一样,)。
改写成最后一次文本中间。,已经测试过,目前我遇到的最快的代码了
|
取文本中间文本_汇编 | 文本型 | | |
Str | 文本型 | | | | SStr | 文本型 | | | | LStr | 文本型 | | | | 区分大小写 | 逻辑型 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | i | 整数型 | | | j | 整数型 | | | a | 整数型 | | | b | 整数型 | | | 数组 | 整数型 | | 0 | c | 整数型 | | | 成员数 | 整数型 | | | i2 | | | | j2 | 双精度小数型 | | | 判断循环首 (a = 0 )b = 寻找文本_汇编 (Str, SStr, b, 区分大小写 )判断 (b > 0 )i = b 加入成员 (数组, b )跳出循环 ()b = b + 1判断循环尾 ()如果真 (i > 0 )成员数 = 取数组成员数 (数组 )计次循环首 (成员数, i2 )i = 数组 [成员数 - i2 + 1 ]c = 寻找文本_汇编 (Str, LStr, i, 区分大小写 )判断 (c > 0 )j = c 跳出循环 ()计次循环尾 ()如果真 (j > 0 )i2 = i + 取文本长度_汇编 (SStr )j2 = j - i2 返回 (取文本中间_汇编 (Str, i2, j2 )) 返回 (“”)|
寻找文本_汇编 | 整数型 | | |
InStr | 通用型 | | | | Str | 通用型 | | | | Start | 整数型 | | | | UandL | 逻辑型 | | | | 置入代码 ({ 96, 139, 117, 8, 139, 85, 12, 139, 54, 139, 18, 86, 139, 77, 24, 139, 93, 16, 193, 225, 5, 141, 44, 30, 252, 8, 205, 133, 210, 116, 127, 138, 34, 49, 219, 128, 252, 129, 15, 66, 217, 133, 246, 116, 113, 132, 228, 116, 109, 8, 220, 85, 137, 203, 235, 9, 60, 255, 116, 14, 56, 224, 116, 18, 70, 172, 60, 128, 119, 242, 132, 192, 116, 83, 8, 216, 56, 224, 117, 241, 48, 192, 57, 52, 36, 119, 63, 141, 126, 255, 137, 213, 138, 15, 138, 109, 0, 71, 69, 132, 237, 116, 61, 128, 253, 129, 114, 22, 128, 253, 255, 116, 17, 56, 205, 117, 33, 138, 15, 138, 109, 0, 71, 69, 56, 205, 116, 220, 235, 20, 56, 205, 116, 214, 9, 217, 56, 205, 117, 10, 128, 253, 97, 114, 5, 128, 253, 123, 114, 198, 208, 224, 131, 214, 0, 235, 164, 93, 93, 131, 200, 255, 235, 6, 93, 137, 240, 93, 41, 232, 137, 68, 36, 28, 97, 93, 194, 24, 0 }) 返回 (0 )置入代码 ({ 82, 87, 81, 49, 192, 139, 69, 8, 139, 0, 133, 192, 116, 67, 141, 80, 3, 139, 56, 131, 192, 4, 141, 143, 255, 254, 254, 254, 247, 215, 33, 249, 129, 225, 128, 128, 128, 128, 117, 23, 139, 56, 131, 192, 4, 141, 143, 255, 254, 254, 254, 247, 215, 33, 249, 129, 225, 128, 128, 128, 128, 116, 210, 247, 193, 128, 128, 0, 0, 117, 6, 193, 233, 16, 131, 192, 2, 208, 225, 25, 208, 95, 90, 89, 137, 236, 93, 194, 4, 0 }) 返回 (0 )|
取文本中间_汇编 | 文本型 | | |
str | 通用型 | | | | start | 整数型 | | | | count | 整数型 | | | |
变量名 | 类 型 | 静态 | 数组 | 备 注 | Heap | 整数型 | | | Len | 整数型 | | | 置入代码 ({ 81, 82, 83, 86, 87, 49, 192, 139, 69, 8, 139, 0, 133, 192, 116, 69, 141, 80, 3, 139, 56, 131, 192, 4, 141, 143, 255, 254, 254, 254, 247, 215, 33, 249, 129, 225, 128, 128, 128, 128, 117, 23, 139, 56, 131, 192, 4, 141, 143, 255, 254, 254, 254, 247, 215, 33, 249, 129, 225, 128, 128, 128, 128, 116, 210, 247, 193, 128, 128, 0, 0, 117, 6, 193, 233, 16, 131, 192, 2, 208, 225, 25, 208, 235, 11, 95, 94, 91, 90, 89, 137, 236, 93, 194, 12, 0, 64, 137, 69, 248, 137, 195, 100, 139, 13, 48, 0, 0, 0, 139, 73, 24, 137, 77, 252 }) RtlAllocateHeap (Heap, 0, Len )置入代码 ({ 133, 192, 116, 56, 139, 117, 8, 139, 54, 139, 85, 12, 57, 211, 126, 44, 131, 125, 16, 0, 126, 38, 43, 93, 16, 126, 29, 131, 250, 0, 127, 5, 186, 1, 0, 0, 0, 87, 141, 116, 22, 255, 139, 77, 16, 137, 199, 243, 164, 198, 4, 15, 0, 95, 235, 9, 137, 240, 235, 5, 184, 0, 0, 0, 0, 95, 94, 91, 90, 89, 137, 236, 93, 194, 12, 0 }) 返回 (“”)
补充内容 (2024-3-14 21:12):
原版汇编,不支持取最后一个中间内容,。这是改版。相当于是多执行好几次取中间文本,肯定会比较慢啊。
补充内容 (2024-3-15 14:41):
寻找文本,用原作者里面的就行,这里的寻找文本,是贴错了 |