先把反汇编的贴上,在OD里跟,我头都是晕的
[COLOR="Red"]主干[/COLOR]
0040118E |. 8D9424 940000>lea edx, dword ptr [esp+94]
00401195 |. 8D4424 6C lea eax, dword ptr [esp+6C]
00401199 |. 52 push edx
0040119A |. 50 push eax
[COLOR="DarkOrange"]0040119B |. E8 60FEFFFF call 00401000 ; 处理后的字符保存在0012FF34中 返回用户名长度[/COLOR]
004011A0 |. 8D8C24 C40000>lea ecx, dword ptr [esp+C4] ; 0012FF5C
004011A7 |. 8D9424 9C0000>lea edx, dword ptr [esp+9C] ; 处理的字符
004011AE |. 51 push ecx
004011AF |. 8D4424 78 lea eax, dword ptr [esp+78] ; 取用户名
004011B3 |. 52 push edx
004011B4 |. 50 push eax
[COLOR="DarkOrange"]004011B5 |. E8 96FEFFFF call 00401050 ; 第二次处理字符保存在0012FF5C[/COLOR]
004011BA |. 8D4C24 58 lea ecx, dword ptr [esp+58] ; 0012FEE4 真用户名
004011BE |. 8D9424 D00000>lea edx, dword ptr [esp+D0] ; 0012FF5C
004011C5 |. 51 push ecx
004011C6 |. 8D8424 AC0000>lea eax, dword ptr [esp+AC] ; 0012FF34
004011CD |. 52 push edx
004011CE |. 8D8C24 880000>lea ecx, dword ptr [esp+88] ; 用户名
004011D5 |. 50 push eax
004011D6 |. 51 push ecx
[COLOR="DarkOrange"]004011D7 |. E8 A4FEFFFF call 00401080[/COLOR]
004011DC |. 8D7C24 40 lea edi, dword ptr [esp+40]
004011E0 |. 83C9 FF or ecx, FFFFFFFF
004011E3 |. 33C0 xor eax, eax
004011E5 |. 83C4 3C add esp, 3C
004011E8 |. F2:AE repne scas byte ptr es:[edi]
004011EA |. F7D1 not ecx
004011EC |. 49 dec ecx
004011ED |. 5F pop edi
[CODE]对注册码的操作
004011EE |. 85C9 test ecx, ecx ; 判断注册码是否空
004011F0 |. 7E 0F jle short 00401201
004011F2 |> 8A5404 00 /mov dl, byte ptr [esp+eax] ; 取注册码字符
004011F6 |. FEC2 |inc dl ; 字符依次加1
004011F8 |. 885404 00 |mov byte ptr [esp+eax], dl
004011FC |. 40 |inc eax
004011FD |. 3BC1 |cmp eax, ecx
004011FF |.^ 7C F1 \jl short 004011F2
00401201 |> 8D5424 00 lea edx, dword ptr [esp]
00401205 |. 8D4424 28 lea eax, dword ptr [esp+28]
00401209 |. 52 push edx
0040120A |. 50 push eax ; 0012FEE4 真用户名
0040120B |. E8 F0FEFFFF call 00401100 ; 对处理后的用户名和注册码判断 相等则eax返回1 成功
00401210 |. 83C4 08 add esp, 8
00401213 |. 83F8 01 cmp eax, 1
00401216 |. 75 19 jnz short 00401231
跳与不跳你懂得
00401218 |. 68 40804000 push 00408040 ; 你输入的是真码:
[/CODE]
橙色标注,清单如下
00401000 /$ 53 push ebx
00401001 |. 57 push edi
00401002 |. 8B7C24 0C mov edi, dword ptr [esp+C] ; 取用户名
00401006 |. 33DB xor ebx, ebx
00401008 |. 8A07 mov al, byte ptr [edi]
0040100A |. 84C0 test al, al
0040100C |. 74 3D je short 0040104B
0040100E |. 56 push esi
0040100F |. 8B7424 14 mov esi, dword ptr [esp+14] ; 取第二个参数 0012FF34
00401013 |> 0FBEC0 /movsx eax, al
00401016 |. 8BC8 |mov ecx, eax
00401018 |. 81E1 0F000080 |and ecx, 8000000F
0040101E |. 79 05 |jns short 00401025
00401020 |. 49 |dec ecx
00401021 |. 83C9 F0 |or ecx, FFFFFFF0
00401024 |. 41 |inc ecx
00401025 |> 99 |cdq
00401026 |. 83E2 0F |and edx, 0F
00401029 |. 03C2 |add eax, edx
0040102B |. C0E1 04 |shl cl, 4
0040102E |. C1F8 04 |sar eax, 4
00401031 |. 02C8 |add cl, al
00401033 |. 880E |mov byte ptr [esi], cl
00401035 |. 79 04 |jns short 0040103B
00401037 |. F6D9 |neg cl
00401039 |. 880E |mov byte ptr [esi], cl
0040103B |> 8A47 01 |mov al, byte ptr [edi+1]
0040103E |. 47 |inc edi
0040103F |. 46 |inc esi
00401040 |. 43 |inc ebx
00401041 |. 84C0 |test al, al
00401043 |.^ 75 CE \jnz short 00401013
00401045 |. 5E pop esi
00401046 |. 8BC3 mov eax, ebx
00401048 |. 5F pop edi
00401049 |. 5B pop ebx
0040104A |. C3 retn
0040104B |> 8BC3 mov eax, ebx
0040104D |. 5F pop edi
0040104E |. 5B pop ebx
0040104F \. C3 retn
00401050 /$ 57 push edi
00401051 |. 8B7C24 08 mov edi, dword ptr [esp+8] ; 取用户名
00401055 |. 8A0F mov cl, byte ptr [edi]
00401057 |. 84C9 test cl, cl
00401059 |. 74 20 je short 0040107B
0040105B |. 8B5424 10 mov edx, dword ptr [esp+10] ; 0012FF5C
0040105F |. 56 push esi
00401060 |. 8B7424 10 mov esi, dword ptr [esp+10] ; 0012FF34
00401064 |> 8A06 /mov al, byte ptr [esi]
00401066 |. 32C1 |xor al, cl ; 处理用户名和原用户名依次异或
00401068 |. 8802 |mov byte ptr [edx], al ; 存入地址0012FF5C 成为新用户名
0040106A |. 7F 04 |jg short 00401070
0040106C |. 04 60 |add al, 60
0040106E |. 8802 |mov byte ptr [edx], al
00401070 |> 8A4F 01 |mov cl, byte ptr [edi+1]
00401073 |. 47 |inc edi
00401074 |. 46 |inc esi
00401075 |. 42 |inc edx
00401076 |. 84C9 |test cl, cl
00401078 |.^ 75 EA \jnz short 00401064
0040107A |. 5E pop esi
0040107B |> 5F pop edi
0040107C \. C3 retn
00401080 /$ 55 push ebp
00401081 |. 8B6C24 08 mov ebp, dword ptr [esp+8] ; ebp指原用户名
00401085 |. 8A4D 00 mov cl, byte ptr [ebp]
00401088 |. 84C9 test cl, cl
0040108A |. 74 6C je short 004010F8
0040108C |. 8B5424 14 mov edx, dword ptr [esp+14] ; 0012FEE4
00401090 |. 53 push ebx
00401091 |. 56 push esi
00401092 |. 8B7424 18 mov esi, dword ptr [esp+18] ; 0012FF5C
00401096 |. 57 push edi
00401097 |. 8B7C24 18 mov edi, dword ptr [esp+18] ; 0012FF34
0040109B |. 74 0E je short 004010AB
0040109D |> 8A07 mov al, byte ptr [edi]
0040109F |. C74424 14 010>mov dword ptr [esp+14], 1
004010A7 |. 84C0 test al, al
004010A9 |. 75 08 jnz short 004010B3
004010AB |> C74424 14 000>mov dword ptr [esp+14], 0
004010B3 |> 803F 00 cmp byte ptr [edi], 0
004010B6 |. 75 09 jnz short 004010C1
004010B8 |. 803E 00 cmp byte ptr [esi], 0
004010BB |. 75 04 jnz short 004010C1
004010BD |. 33DB xor ebx, ebx
004010BF |. EB 05 jmp short 004010C6
004010C1 |> BB 01000000 mov ebx, 1
004010C6 |> 8A06 mov al, byte ptr [esi]
004010C8 |. 32C1 xor al, cl
004010CA |. 32C3 xor al, bl
004010CC |. 8A5C24 14 mov bl, byte ptr [esp+14]
004010D0 |. 32C3 xor al, bl
004010D2 |. 3C 30 cmp al, 30
004010D4 |. 8802 mov byte ptr [edx], al
004010D6 |. 7D 04 jge short 004010DC
004010D8 |. 34 45 xor al, 45
004010DA |. 8802 mov byte ptr [edx], al
004010DC |> 8A02 mov al, byte ptr [edx]
004010DE |. 3C 5B cmp al, 5B
004010E0 |. 7C 08 jl short 004010EA
004010E2 |. 3C 5F cmp al, 5F
004010E4 |. 7F 04 jg short 004010EA
004010E6 |. 04 08 add al, 8
004010E8 |. 8802 mov byte ptr [edx], al
004010EA |> 8A4D 01 mov cl, byte ptr [ebp+1]
004010ED |. 45 inc ebp
004010EE |. 47 inc edi
004010EF |. 46 inc esi
004010F0 |. 42 inc edx
004010F1 |. 84C9 test cl, cl
004010F3 |.^ 75 A8 jnz short 0040109D
004010F5 |. 5F pop edi
004010F6 |. 5E pop esi
004010F7 |. 5B pop ebx
004010F8 |> 5D pop ebp
004010F9 \. C3 retn
00401100 /$ 56 push esi
00401101 |. 8B7424 08 mov esi, dword ptr [esp+8] ; 取真用户名
00401105 |. 57 push edi
00401106 |. 8A0E mov cl, byte ptr [esi]
00401108 |. 84C9 test cl, cl
0040110A |. 74 21 je short 0040112D
0040110C |. 8B7C24 10 mov edi, dword ptr [esp+10] ; 取处理后的注册码
00401110 |. 8B4424 0C mov eax, dword ptr [esp+C]
00401114 |> 8A17 /mov dl, byte ptr [edi]
00401116 |. 84D2 |test dl, dl
00401118 |. 74 17 |je short 00401131
0040111A |. 33C0 |xor eax, eax
0040111C |. 3ACA |cmp cl, dl
0040111E |. 8A4E 01 |mov cl, byte ptr [esi+1]
00401121 |. 0F94C0 |sete al
00401124 |. 46 |inc esi
00401125 |. 47 |inc edi
00401126 |. 84C9 |test cl, cl
00401128 |.^ 75 EA \jnz short 00401114
0040112A |. 5F pop edi
0040112B |. 5E pop esi
0040112C |. C3 retn
0040112D |> 8B4424 0C mov eax, dword ptr [esp+C]
00401131 |> 5F pop edi
00401132 |. 5E pop esi
00401133 \. C3 retn