新手可以看看,大牛飘过吧,呵呵,算是我这个菜鸟第一次分析算法,还希望能得到各位朋友的支持。好了,进入正题:
1。 拿到后先用peid查壳,没壳,直接od载入,用超级字符串查找,发现了与注册失败成功的语句,双击之,来到代码处,向上找发现此段的开始处,F2下断点,F9运行之,输入用户名:abcdef,密码:123456,点击注册,中断下来了。呵呵,然后F8单步走。
004014B0 /. 55 push ebp
004014B1 |. 8BEC mov ebp, esp
004014B3 |. 6A FF push -1
004014B5 |. 68 C21B4000 push 00401BC2 ; 溉%@; SE 处理程序安装
004014BA |. 64:A1 0000000>mov eax, dword ptr fs:[0]
004014C0 |. 50 push eax
004014C1 |. 64:8925 00000>mov dword ptr fs:[0], esp
004014C8 |. 83EC 14 sub esp, 14
004014CB |. 53 push ebx
004014CC |. 56 push esi
004014CD |. 57 push edi
004014CE |. 894D E0 mov dword ptr [ebp-20], ecx
004014D1 |. 8D4D E4 lea ecx, dword ptr [ebp-1C]
004014D4 |. E8 83030000 call <jmp.&MFC42.#540>
004014D9 |. C745 FC 00000>mov dword ptr [ebp-4], 0
004014E0 |. 8D4D F0 lea ecx, dword ptr [ebp-10]
004014E3 |. E8 74030000 call <jmp.&MFC42.#540>
004014E8 |. C645 FC 01 mov byte ptr [ebp-4], 1
004014EC |. 8B4D E0 mov ecx, dword ptr [ebp-20]
004014EF |. 81C1 A0000000 add ecx, 0A0
004014F5 |. E8 AA030000 call <jmp.&MFC42.#3876>
004014FA |. 8945 EC mov dword ptr [ebp-14], eax ; 取用户名位数
004014FD |. 837D EC 05 cmp dword ptr [ebp-14], 5 ; 小于5则跳向失败
00401501 |. 7F 05 jg short 00401508
00401503 |. E9 BB000000 jmp 004015C3
00401508 |> 8B4D E0 mov ecx, dword ptr [ebp-20]
0040150B |. 83C1 60 add ecx, 60
0040150E |. E8 91030000 call <jmp.&MFC42.#3876>
00401513 |. 8945 E8 mov dword ptr [ebp-18], eax
00401516 |. 837D E8 05 cmp dword ptr [ebp-18], 5 ; 取假码位数
0040151A |. 7F 05 jg short 00401521 ; 小于5则跳向失败
0040151C |. E9 A2000000 jmp 004015C3
00401521 |> 8B45 E0 mov eax, dword ptr [ebp-20]
00401524 |. 05 E0000000 add eax, 0E0
00401529 |. 50 push eax
0040152A |. 8B4D E0 mov ecx, dword ptr [ebp-20]
0040152D |. 81C1 A0000000 add ecx, 0A0
00401533 |. E8 66030000 call <jmp.&MFC42.#3874>
00401538 |. 8B4D E0 mov ecx, dword ptr [ebp-20]
0040153B |. 81C1 E4000000 add ecx, 0E4
00401541 |. 51 push ecx
00401542 |. 8B4D E0 mov ecx, dword ptr [ebp-20]
00401545 |. 83C1 60 add ecx, 60
00401548 |. E8 51030000 call <jmp.&MFC42.#3874>
0040154D |. 8B55 E0 mov edx, dword ptr [ebp-20]
00401550 |. 81C2 E0000000 add edx, 0E0
00401556 |. 52 push edx
00401557 |. 8D4D E4 lea ecx, dword ptr [ebp-1C]
0040155A |. E8 39030000 call <jmp.&MFC42.#858>
0040155F |. 8B45 E0 mov eax, dword ptr [ebp-20]
00401562 |. 05 E4000000 add eax, 0E4
00401567 |. 50 push eax
00401568 |. 8D4D F0 lea ecx, dword ptr [ebp-10]
0040156B |. E8 28030000 call <jmp.&MFC42.#858>
00401570 |. 33C0 xor eax, eax ; 主要注册算法开始处
00401572 |. 33DB xor ebx, ebx
00401574 |. 33C9 xor ecx, ecx
00401576 |. B9 01000000 mov ecx, 1
0040157B |. 33D2 xor edx, edx
0040157D |. 8B45 E4 mov eax, dword ptr [ebp-1C]
00401580 |> 8A18 /mov bl, byte ptr [eax] ; 去用户名的第一位
00401582 |. 32D9 |xor bl, cl ; 第一位a与cl=1异或
00401584 |. 8818 |mov byte ptr [eax], bl ; 异或后的值进入eax
00401586 |. 41 |inc ecx
00401587 |. 40 |inc eax
00401588 |. 8038 00 |cmp byte ptr [eax], 0 ; 一次取注册名后面的几位
0040158B |.^ 75 F3 \jnz short 00401580
0040158D |. 33C0 xor eax, eax
0040158F |. 33DB xor ebx, ebx
00401591 |. 33C9 xor ecx, ecx
00401593 |. B9 0A000000 mov ecx, 0A
00401598 |. 33D2 xor edx, edx
0040159A |. 8B45 F0 mov eax, dword ptr [ebp-10] ; 进假码
0040159D |> 8A18 /mov bl, byte ptr [eax] ; 假码第一位进bl
0040159F |. 32D9 |xor bl, cl ; 假码第一位1与0A异或
004015A1 |. 8818 |mov byte ptr [eax], bl ; 结果再回eax
004015A3 |. 41 |inc ecx
004015A4 |. 40 |inc eax
004015A5 |. 8038 00 |cmp byte ptr [eax], 0 ; 逐次取各位
004015A8 |.^ 75 F3 \jnz short 0040159D
004015AA |. 8B45 E4 mov eax, dword ptr [ebp-1C] ; 用户名经过运算后的值“''''''”
004015AD |. 8B55 F0 mov edx, dword ptr [ebp-10] ; 假码经运算后的值;9?9;9
004015B0 |> 33C9 /xor ecx, ecx
004015B2 |. 8A18 |mov bl, byte ptr [eax] ; 开始比较了。。
004015B4 |. 8A0A |mov cl, byte ptr [edx]
004015B6 |. 3AD9 |cmp bl, cl ; 不相等侧跳向失败
004015B8 75 09 jnz short 004015C3
004015BA |. 40 |inc eax
004015BB |. 42 |inc edx
004015BC |. 8038 00 |cmp byte ptr [eax], 0
004015BF |.^ 75 EF \jnz short 004015B0
004015C1 |. EB 16 jmp short 004015D9
004015C3 |> 6A 00 push 0
004015C5 |. 68 6C304000 push 0040306C ; error
004015CA |. 68 40304000 push 00403040 ; one of the details you entered was wrong
004015CF |. 8B4D E0 mov ecx, dword ptr [ebp-20]
004015D2 |. E8 BB020000 call <jmp.&MFC42.#4224>
004015D7 |. EB 14 jmp short 004015ED
004015D9 |> 6A 00 push 0
004015DB |. 68 34304000 push 00403034 ; you did it
004015E0 |. 68 20304000 push 00403020 ; well done,cracker
004015E5 |. 8B4D E0 mov ecx, dword ptr [ebp-20]
004015E8 |. E8 A5020000 call <jmp.&MFC42.#4224>
004015ED |> 6A 64 push 64 ; /Timeout = 100. ms
004015EF |. FF15 00204000 call dword ptr [<&KERNEL32.Sleep>] ; \Sleep
这就是f(用户名)=f(注册码)的注册方式,要想通过用户名求出真正的注册码,即k1=f2的逆函数(序列号),这样用户名abcdef经过f2的逆函数的计算后,得到了真正的注册码jklmno,呵呵,就是这么简单,失误之处请大侠指出,谢谢!附加上crackme,适合新手。。。
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课