能力值:
( LV9,RANK:850 )
|
-
-
3 楼
0040539A B8 CB110000 mov eax, 11CB
0040539F 50 push eax
004053A0 0385 22040000 add eax, dword ptr [ebp+422]
004053A6 59 pop ecx
004053A7 0BC9 or ecx, ecx
004053A9 8985 A8030000 mov dword ptr [ebp+3A8], eax
004053AF 61 popad
004053B0 75 08 jnz short 004053BA
004053B2 B8 01000000 mov eax, 1
004053B7 C2 0C00 retn 0C
004053BA 68 CB114000 push 004011CB
004053BF C3 retn
开始对注册名长度进行效验,也就是一些IDIV,Add,Sub之类,得到的结果必须在0x190和0x2300之间的。
然后取注册名进行ASCII码累加,之后还是对注册名的ASCII码进行处理。
的确是加了壳,不过不脱壳调试更方便
不脱壳调试
bpx GetDlgItemTextA
00401528 |. 68 00010000 push 100 ; /Count = 100 (256.)
0040152D |. 8D85 00FFFFFF lea eax, dword ptr [ebp-100] ; |
00401533 |. 50 push eax ; |Buffer
00401534 |. 6A 65 push 65 ; |ControlID = 65 (101.)
00401536 |. FF75 08 push dword ptr [ebp+8] ; |hWnd
00401539 |. E8 FA010000 call 00401738 ; \GetDlgItemTextA
0040153E |. 89C3 mov ebx, eax ; 获取注册名wofan ,长度5
00401540 |. 09DB or ebx, ebx
00401542 |. 75 04 jnz short 00401548 ; 只要输入了注册名,就会跳转成功
00401544 |. 31C0 xor eax, eax
00401546 |. EB 50 jmp short 00401598
00401548 |> BF BC020000 mov edi, 2BC ; 三个常数
0040154D |. BE 30000000 mov esi, 30
00401552 |. B8 48000000 mov eax, 48
00401557 |. 99 cdq
00401558 |. F7FB idiv ebx ; 常数:0x48 idiv 注册名长度
0040155A |. 29C6 sub esi, eax
0040155C |. 8D34B6 lea esi, dword ptr [esi+esi*4]
0040155F |. 29F7 sub edi, esi
00401561 |. 6BFF 6B imul edi, edi, 6B
00401564 |. 81EF 6CCF0000 sub edi, 0CF6C ; 以上都是些很简单的加减运算,其目的不过是确认注册名长度的范围
0040156A |. 81FF 00230000 cmp edi, 2300 ; 0x2300
00401570 |. 7F 08 jg short 0040157A
00401572 |. 81FF 90010000 cmp edi, 190 ; 0x190 与 0x2300两个数确定了注册名的长度范围
00401578 |. 7D 04 jge short 0040157E
0040157A |> 31C0 xor eax, eax
0040157C |. EB 1A jmp short 00401598
================================
0040139E |. 68 00010000 push 100 ; /Count = 100 (256.)
004013A3 |. 8D85 E1FCFFFF lea eax, dword ptr [ebp-31F] ; |
004013A9 |. 50 push eax ; |Buffer
004013AA |. 6A 66 push 66 ; |ControlID = 66 (102.)
004013AC |. FF75 08 push dword ptr [ebp+8] ; |hWnd
004013AF |. E8 84030000 call 00401738 ; \GetDlgItemTextA
004013B4 |. 09C0 or eax, eax ; 取注册码1234546,长度6
004013B6 |. 0F84 48010000 je 00401504
004013BC |. B8 CF110000 mov eax, 11CF ; 还是常数0x11CF
004013C1 |. 0FB68D E1FCFF>movzx ecx, byte ptr [ebp-31F]
004013C8 |. 99 cdq
004013C9 |. F7F9 idiv ecx ; 对注册码第一位的ASCII码取余
004013CB |. 83FA 17 cmp edx, 17 ; 余数应该是0x17,这样就确定了真注册码的第一位应该是什么:T
004013CE |. 74 07 je short 004013D7 ; 修改这个跳转让它继续下去
004013D0 |. 31C0 xor eax, eax
004013D2 |. E9 2D010000 jmp 00401504
004013D7 |> 31DB xor ebx, ebx ; 清零EBX用作计数
004013D9 |. EB 0B jmp short 004013E6
004013DB |> 8B45 10 /mov eax, dword ptr [ebp+10] ; 注册名:wofan
004013DE |. 0FBE0418 |movsx eax, byte ptr [eax+ebx] ; 逐位取注册名的ASCII码
004013E2 |. 0145 FC |add dword ptr [ebp-4], eax ; 然后累加,注册名为wofan时,累加值为:0x21B
004013E5 |. 43 |inc ebx
004013E6 |> 3B5D 0C cmp ebx, dword ptr [ebp+C]
004013E9 |.^ 7C F0 \jl short 004013DB ; 循环
004013EB |. 31DB xor ebx, ebx
004013ED |. E9 83000000 jmp 00401475
004013F2 |> 8B55 10 /mov edx, dword ptr [ebp+10] ; 注册名wofan
004013F5 |. 0FBE3C1A |movsx edi, byte ptr [edx+ebx] ; 注册名ASCII逐位送EDI
004013F9 |. 8B75 FC |mov esi, dword ptr [ebp-4] ; 上一轮循环的累加值0x21B
004013FC |. 89D9 |mov ecx, ebx ; EBX是循环计数
004013FE |. C1E1 02 |shl ecx, 2 ; 以下都是新简单的运算,略过
00401401 |. 89DA |mov edx, ebx
00401403 |. 42 |inc edx
00401404 |. 29D1 |sub ecx, edx
00401406 |. 0FB68C0D E1FE>|movzx ecx, byte ptr [ebp+ecx-11F]
0040140E |. 89FA |mov edx, edi
00401410 |. 31CA |xor edx, ecx
00401412 |. 89F1 |mov ecx, esi
00401414 |. 0FAFCB |imul ecx, ebx
00401417 |. 29F1 |sub ecx, esi
00401419 |. 89CE |mov esi, ecx
0040141B |. 83F6 FF |xor esi, FFFFFFFF
0040141E |. 8DB432 4D0100>|lea esi, dword ptr [edx+esi+14D]
00401425 |. 8B4D 0C |mov ecx, dword ptr [ebp+C]
00401428 |. 89DA |mov edx, ebx
0040142A |. 83C2 03 |add edx, 3
0040142D |. 0FAFCA |imul ecx, edx
00401430 |. 0FAFCF |imul ecx, edi
00401433 |. 89F0 |mov eax, esi
00401435 |. 01C8 |add eax, ecx
00401437 |. B9 0A000000 |mov ecx, 0A
0040143C |. 31D2 |xor edx, edx
0040143E |. F7F1 |div ecx
00401440 |. 83C2 30 |add edx, 30
00401443 |. 88941D FCFEFF>|mov byte ptr [ebp+ebx-104], dl
0040144A |. 0FB6BC1D FCFE>|movzx edi, byte ptr [ebp+ebx-104]
00401452 |. 81F7 ACAD0000 |xor edi, 0ADAC
00401458 |. 89DE |mov esi, ebx
0040145A |. 83C6 02 |add esi, 2
0040145D |. 89F8 |mov eax, edi
0040145F |. 0FAFC6 |imul eax, esi
00401462 |. B9 0A000000 |mov ecx, 0A
00401467 |. 99 |cdq
00401468 |. F7F9 |idiv ecx
0040146A |. 83C2 30 |add edx, 30
0040146D |. 88941D FCFEFF>|mov byte ptr [ebp+ebx-104], dl
00401474 |. 43 |inc ebx
00401475 |> 3B5D 0C cmp ebx, dword ptr [ebp+C]
00401478 |.^ 0F8C 74FFFFFF \jl 004013F2 ; 又一个循环,这个循环的结果得到0x6722,即十进制数 26402
0040147E |. 8D85 FCFEFFFF lea eax, dword ptr [ebp-104]
00401484 |. 50 push eax
00401485 |. 6A 54 push 54
00401487 |. 8D85 DCFBFFFF lea eax, dword ptr [ebp-424]
0040148D |. 50 push eax ; |Format
0040148E |. 8D85 E1FBFFFF lea eax, dword ptr [ebp-41F] ; |
00401494 |. 50 push eax ; |s
00401495 |. E8 CE020000 call 00401768 ; \wsprintfA
0040149A |. 8B7D 0C mov edi, dword ptr [ebp+C]
0040149D |. 89F8 mov eax, edi
0040149F |. 0FAF45 FC imul eax, dword ptr [ebp-4] ; 注册名长度 IMUL 注册名ASCII累加值0x21B ,然后对0x64取余
004014A3 |. B9 64000000 mov ecx, 64
004014A8 |. 99 cdq
004014A9 |. F7F9 idiv ecx
004014AB |. 89D7 mov edi, edx
004014AD |. 83C7 30 add edi, 30 ; 得到0x8F,即十进制数143
004014B0 |. 57 push edi
004014B1 |. 8DBD E1FBFFFF lea edi, dword ptr [ebp-41F]
004014B7 |. 57 push edi
004014B8 |. 8DBD D6FBFFFF lea edi, dword ptr [ebp-42A]
004014BE |. 57 push edi ; |Format
004014BF |. 8DBD E1FDFFFF lea edi, dword ptr [ebp-21F] ; |
004014C5 |. 57 push edi ; |s
004014C6 |. E8 9D020000 call 00401768 ; \wsprintfA
004014CB |. 83C4 20 add esp, 20
004014CE |. 8D8D E1FDFFFF lea ecx, dword ptr [ebp-21F]
004014D4 |. 83C8 FF or eax, FFFFFFFF
004014D7 |> 40 /inc eax
004014D8 |. 803C01 00 |cmp byte ptr [ecx+eax], 0
004014DC |.^ 75 F9 \jnz short 004014D7
004014DE |. 50 push eax ; /Arg3
004014DF |. 8D85 E1FCFFFF lea eax, dword ptr [ebp-31F] ; |
004014E5 |. 50 push eax ; |假注册码123456
004014E6 |. 8D85 E1FDFFFF lea eax, dword ptr [ebp-21F] ; |
004014EC |. 50 push eax ; |T26402-143 <----真注册码
004014ED |. E8 D0FDFFFF call 004012C2 ; \比较
004014F2 |. 83C4 0C add esp, 0C
004014F5 |. 83F8 00 cmp eax, 0 ; 返回结果与0比较
name:wofan
code:T26402-143
|