这些是原代码汇编,修改了一些名字:
.text:10001000 ; int __cdecl Find(int Begin, int Limit, int pdata, int length)
.text:10001000 Find proc near ; CODE XREF: sub_100011E0+5Cp
.text:10001000 ; sub_100011E0+88p ...
.text:10001000
.text:10001000 Begin = dword ptr 4
.text:10001000 Limit = dword ptr 8
.text:10001000 pdata = dword ptr 0Ch
.text:10001000 length = dword ptr 10h
.text:10001000
.text:10001000 push ebx
.text:10001001 mov ebx, [esp+4+Begin]
.text:10001005 push ebp
.text:10001006 push esi
.text:10001007 test ebx, ebx
.text:10001009 push edi
.text:1000100A jz loc_100010A7
.text:10001010 mov esi, [esp+10h+pdata]
.text:10001014 test esi, esi
.text:10001016 jz loc_100010A7
.text:1000101C mov ebp, [esp+10h+length]
.text:10001020 mov ecx, 100h
.text:10001025 mov eax, ebp
.text:10001027 mov edi, offset buffer
.text:1000102C rep stosd
.text:1000102E xor eax, eax
.text:10001030 test ebp, ebp
.text:10001032 jbe short loc_1000104A
.text:10001034
.text:10001034 loc_10001034: ; CODE XREF: Find+48j
.text:10001034 mov ecx, ebp
.text:10001036 xor edx, edx
.text:10001038 mov dl, [eax+esi]
.text:1000103B sub ecx, eax
.text:1000103D dec ecx
.text:1000103E inc eax
.text:1000103F cmp eax, ebp
.text:10001041 mov buffer[edx*4], ecx
.text:10001048 jb short loc_10001034
.text:1000104A
.text:1000104A loc_1000104A: ; CODE XREF: Find+32j
.text:1000104A mov eax, [esp+10h+Limit]
.text:1000104E mov esi, 1
.text:10001053 sub eax, ebp
.text:10001055 cmp eax, esi
.text:10001057 mov [esp+10h+Begin], eax
.text:1000105B jb short loc_100010A7
.text:1000105D
.text:1000105D loc_1000105D: ; CODE XREF: Find+A5j
.text:1000105D lea ecx, [esi-1]
.text:10001060 mov edx, ecx
.text:10001062 sub edx, esi
.text:10001064 lea edi, [edx+1]
.text:10001067 cmp edi, ebp
.text:10001069 jnb short loc_10001088
.text:1000106B
.text:1000106B loc_1000106B: ; CODE XREF: Find+82j
.text:1000106B mov edi, [esp+10h+pdata]
.text:1000106F mov al, [ecx+ebx]
.text:10001072 cmp al, [edx+edi+1]
.text:10001076 jnz short loc_10001084
.text:10001078 inc ecx
.text:10001079 mov edx, ecx
.text:1000107B sub edx, esi
.text:1000107D lea eax, [edx+1]
.text:10001080 cmp eax, ebp
.text:10001082 jb short loc_1000106B
.text:10001084
.text:10001084 loc_10001084: ; CODE XREF: Find+76j
.text:10001084 mov eax, [esp+10h+Begin]
.text:10001088
.text:10001088 loc_10001088: ; CODE XREF: Find+69j
.text:10001088 sub ecx, esi
.text:1000108A inc ecx
.text:1000108B cmp ecx, ebp
.text:1000108D jz short loc_100010B1
.text:1000108F lea ecx, [esi+ebx]
.text:10001092 xor edx, edx
.text:10001094 mov dl, [ecx+ebp-1]
.text:10001098 mov ecx, buffer[edx*4]
.text:1000109F lea esi, [esi+ecx+1]
.text:100010A3 cmp esi, eax
.text:100010A5 jbe short loc_1000105D
.text:100010A7
.text:100010A7 loc_100010A7: ; CODE XREF: Find+Aj
.text:100010A7 ; Find+16j ...
.text:100010A7 pop edi
.text:100010A8 pop esi
.text:100010A9 pop ebp
.text:100010AA mov eax, 0FFFFFFFEh
.text:100010AF pop ebx
.text:100010B0 retn
.text:100010B1 ; ---------------------------------------------------------------------------
.text:100010B1
.text:100010B1 loc_100010B1: ; CODE XREF: Find+8Dj
.text:100010B1 lea eax, [esi-1]
.text:100010B4 pop edi
.text:100010B5 pop esi
.text:100010B6 pop ebp
.text:100010B7 pop ebx
.text:100010B8 retn
.text:100010B8 Find endp
.text:100010B8
.text:100010B8 ; ---------------------------------------------------------------------------
.text:100010B9 align 10h
短小而且精悍。
[ 此帖被sprees在2013-12-02 01:19重新编辑 ]