具体算法(汇编,太晚了就不用ida分析了):
[Asm] 纯文本查看 复制代码
004011B4 8B5424 04 mov edx,dword ptr ss:[esp+0x4]
004011B8 8B4C24 08 mov ecx,dword ptr ss:[esp+0x8]
004011BC 85D2 test edx,edx
004011BE 75 0D jnz short CM.004011CD
004011C0 33C0 xor eax,eax
004011C2 85C9 test ecx,ecx
004011C4 74 06 je short CM.004011CC
004011C6 8039 00 cmp byte ptr ds:[ecx],0x0
004011C9 74 01 je short CM.004011CC
004011CB 48 dec eax
004011CC C3 retn
004011CD 85C9 test ecx,ecx
004011CF 75 09 jnz short CM.004011DA
004011D1 33C0 xor eax,eax
004011D3 803A 00 cmp byte ptr ds:[edx],0x0
004011D6 74 01 je short CM.004011D9
004011D8 40 inc eax
004011D9 C3 retn
004011DA F7C2 03000000 test edx,0x3
004011E0 75 37 jnz short CM.00401219
004011E2 8B02 mov eax,dword ptr ds:[edx]
004011E4 3A01 cmp al,byte ptr ds:[ecx]
004011E6 75 2B jnz short CM.00401213
004011E8 0AC0 or al,al
004011EA 74 24 je short CM.00401210
004011EC 3A61 01 cmp ah,byte ptr ds:[ecx+0x1]
004011EF 75 22 jnz short CM.00401213
004011F1 0AE4 or ah,ah
004011F3 74 1B je short CM.00401210
004011F5 C1E8 10 shr eax,0x10
004011F8 3A41 02 cmp al,byte ptr ds:[ecx+0x2]
004011FB 75 16 jnz short CM.00401213
004011FD 0AC0 or al,al
004011FF 74 0F je short CM.00401210
00401201 3A61 03 cmp ah,byte ptr ds:[ecx+0x3]
00401204 75 0D jnz short CM.00401213
00401206 83C1 04 add ecx,0x4
00401209 83C2 04 add edx,0x4
0040120C 0AE4 or ah,ah
0040120E 75 D2 jnz short CM.004011E2
00401210 33C0 xor eax,eax
00401212 C3 retn
00401213 1BC0 sbb eax,eax
00401215 D1E0 shl eax,1
00401217 40 inc eax
00401218 C3 retn
00401219 F7C2 01000000 test edx,0x1
0040121F 74 14 je short CM.00401235
00401221 8A02 mov al,byte ptr ds:[edx]
00401223 42 inc edx
00401224 3A01 cmp al,byte ptr ds:[ecx]
00401226 75 EB jnz short CM.00401213
00401228 41 inc ecx
00401229 0AC0 or al,al
0040122B 74 E3 je short CM.00401210
0040122D F7C2 02000000 test edx,0x2
00401233 74 AD je short CM.004011E2
00401235 66:8B02 mov ax,word ptr ds:[edx]
00401238 83C2 02 add edx,0x2
0040123B 3A01 cmp al,byte ptr ds:[ecx]
0040123D 75 D4 jnz short CM.00401213
0040123F 0AC0 or al,al
00401241 74 CD je short CM.00401210
00401243 3A61 01 cmp ah,byte ptr ds:[ecx+0x1]
00401246 75 CB jnz short CM.00401213
00401248 0AE4 or ah,ah
0040124A 74 C4 je short CM.00401210
0040124C 83C1 02 add ecx,0x2
0040124F EB 91 jmp short CM.004011E2
|