吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 3634|回复: 3
收起左侧

[原创] 某软件注册算法分析

[复制链接]
lionshine 发表于 2015-4-25 23:44
本帖最后由 lionshine 于 2015-4-25 23:46 编辑

起因是看到论坛是有位朋友发了一个爆破该软件的教程,所以下载原始文件回来看了一下。
这个软件是十多年前的软件,相对比较老,保护措施也相对较弱,注册算法很简单。

软件加了壳,也只是压缩壳。很简单就能脱壳

下面主要讨论它的注册算法。
[Asm] 纯文本查看 复制代码
004AC9C8  /.  55            push ebp
004AC9C9  |.  8BEC          mov ebp,esp
004AC9CB  |.  B9 05000000   mov ecx,0x5
004AC9D0  |>  6A 00         /push 0x0
004AC9D2  |.  6A 00         |push 0x0
004AC9D4  |.  49            |dec ecx
004AC9D5  |.^ 75 F9         \jnz short FormGhos.004A>
004AC9D7  |.  51            push ecx
004AC9D8  |.  53            push ebx
004AC9D9  |.  56            push esi
004AC9DA  |.  8BD8          mov ebx,eax
004AC9DC  |.  33C0          xor eax,eax
004AC9DE  |.  55            push ebp
004AC9DF  |.  68 B1CC4A00   push FormGhos.004ACCB1
004AC9E4  |.  64:FF30       push dword ptr fs:[eax]
004AC9E7  |.  64:8920       mov dword ptr fs:[eax],e>
004AC9EA  |.  8D55 FC       lea edx,[local.1]
004AC9ED  |.  8B83 F4020000 mov eax,dword ptr ds:[eb>
004AC9F3  |.  E8 3041F9FF   call FormGhos.00440B28
004AC9F8  |.  837D FC 00    cmp [local.1],0x0        ;  判断注册名长度是否大于0
004AC9FC  |.  75 29         jnz short FormGhos.004AC>
004AC9FE  |.  68 30100000   push 0x1030              ; /Style = MB_OK|MB_ICONEXCLAMATION|MB_SYSTEMMODAL
004ACA03  |.  68 C0CC4A00   push FormGhos.004ACCC0   ; |Title = "警告"
004ACA08  |.  68 C8CC4A00   push FormGhos.004ACCC8   ; |Text = "请输入注册名称"
004ACA0D  |.  6A 00         push 0x0                 ; |hOwner = NULL
004ACA0F  |.  E8 24ACF5FF   call <jmp.&user32.Messag>; \MessageBoxA
004ACA14  |.  8B83 F4020000 mov eax,dword ptr ds:[eb>
004ACA1A  |.  8B10          mov edx,dword ptr ds:[ea>
004ACA1C  |.  FF92 C0000000 call dword ptr ds:[edx+0>
004ACA22  |.  E9 3A020000   jmp FormGhos.004ACC61
004ACA27  |>  8D55 F8       lea edx,[local.2]
004ACA2A  |.  8B83 F8020000 mov eax,dword ptr ds:[eb>
004ACA30  |.  E8 F340F9FF   call FormGhos.00440B28
004ACA35  |.  837D F8 00    cmp [local.2],0x0        ;  判断注册码长度是否大于0
004ACA39  |.  75 29         jnz short FormGhos.004AC>
004ACA3B  |.  68 30100000   push 0x1030              ; /Style = MB_OK|MB_ICONEXCLAMATION|MB_SYSTEMMODAL
004ACA40  |.  68 C0CC4A00   push FormGhos.004ACCC0   ; |Title = "警告"
004ACA45  |.  68 D8CC4A00   push FormGhos.004ACCD8   ; |Text = "请输入注册码"
004ACA4A  |.  6A 00         push 0x0                 ; |hOwner = NULL
004ACA4C  |.  E8 E7ABF5FF   call <jmp.&user32.Messag>; \MessageBoxA
004ACA51  |.  8B83 F8020000 mov eax,dword ptr ds:[eb>
004ACA57  |.  8B10          mov edx,dword ptr ds:[ea>
004ACA59  |.  FF92 C0000000 call dword ptr ds:[edx+0>
004ACA5F  |.  E9 FD010000   jmp FormGhos.004ACC61
004ACA64  |>  8D45 F0       lea eax,[local.4]
004ACA67  |.  50            push eax
004ACA68  |.  8D55 EC       lea edx,[local.5]
004ACA6B  |.  8B83 FC020000 mov eax,dword ptr ds:[eb>
004ACA71  |.  E8 B240F9FF   call FormGhos.00440B28
004ACA76  |.  8B45 EC       mov eax,[local.5]
004ACA79  |.  B9 08000000   mov ecx,0x8
004ACA7E  |.  BA 01000000   mov edx,0x1
004ACA83  |.  E8 9081F5FF   call FormGhos.00404C18   ;  取机器码前8位
004ACA88  |.  8B45 F0       mov eax,[local.4]
004ACA8B  |.  E8 B8C4F5FF   call FormGhos.00408F48
004ACA90  |.  8BF0          mov esi,eax
004ACA92  |.  8D55 E8       lea edx,[local.6]
004ACA95  |.  8B83 F4020000 mov eax,dword ptr ds:[eb>
004ACA9B  |.  E8 8840F9FF   call FormGhos.00440B28
004ACAA0  |.  8B45 E8       mov eax,[local.6]
004ACAA3  |.  E8 187FF5FF   call FormGhos.004049C0   ;  取注册名位数
004ACAA8  |.  0FAFF0        imul esi,eax             ;  机器码前8位乘注册名位数
004ACAAB  |.  8BC6          mov eax,esi
004ACAAD  |.  05 41C20B00   add eax,0xBC241          ;  再加上  0xBC241  也就是十进制数 770625 (作者生日?)
004ACAB2  |.  8D4D F4       lea ecx,[local.3]
004ACAB5  |.  33D2          xor edx,edx
004ACAB7  |.  E8 50C4F5FF   call FormGhos.00408F0C
004ACABC  |.  8B45 F4       mov eax,[local.3]
004ACABF  |.  50            push eax
004ACAC0  |.  8D55 E4       lea edx,[local.7]
004ACAC3  |.  8B83 F8020000 mov eax,dword ptr ds:[eb>
004ACAC9  |.  E8 5A40F9FF   call FormGhos.00440B28   ;  计算出的真码格式化
004ACACE  |.  8B55 E4       mov edx,[local.7]
004ACAD1  |.  58            pop eax                  ;  0012F35C
004ACAD2  |.  E8 2D80F5FF   call FormGhos.00404B04   ;  真假码比较
004ACAD7  |.  0F85 60010000 jnz FormGhos.004ACC3D    ;  不对就跳到出错
004ACADD  |.  A1 FCFC4A00   mov eax,dword ptr ds:[0x>
004ACAE2  |.  8B00          mov eax,dword ptr ds:[ea>
004ACAE4  |.  8B80 80030000 mov eax,dword ptr ds:[ea>
004ACAEA  |.  33D2          xor edx,edx
004ACAEC  |.  E8 EB5AFAFF   call FormGhos.004525DC
004ACAF1  |.  A1 FCFC4A00   mov eax,dword ptr ds:[0x>
004ACAF6  |.  8B00          mov eax,dword ptr ds:[ea>
004ACAF8  |.  8B80 18030000 mov eax,dword ptr ds:[ea>
004ACAFE  |.  33D2          xor edx,edx
004ACB00  |.  E8 7341F9FF   call FormGhos.00440C78
004ACB05  |.  A1 FCFC4A00   mov eax,dword ptr ds:[0x>
004ACB0A  |.  8B00          mov eax,dword ptr ds:[ea>
004ACB0C  |.  8B80 1C030000 mov eax,dword ptr ds:[ea>
004ACB12  |.  33D2          xor edx,edx
004ACB14  |.  E8 5F41F9FF   call FormGhos.00440C78
004ACB19  |.  A1 FCFC4A00   mov eax,dword ptr ds:[0x>
004ACB1E  |.  8B00          mov eax,dword ptr ds:[ea>
004ACB20  |.  8B80 20030000 mov eax,dword ptr ds:[ea>
004ACB26  |.  33D2          xor edx,edx
004ACB28  |.  E8 4B41F9FF   call FormGhos.00440C78
004ACB2D  |.  8B15 20FB4A00 mov edx,dword ptr ds:[0x>;  FormGhos.004B1DE4
004ACB33  |.  8B12          mov edx,dword ptr ds:[ed>
004ACB35  |.  8D45 E0       lea eax,[local.8]
004ACB38  |.  B9 F0CC4A00   mov ecx,FormGhos.004ACCF>;  ASCII "user.dat"
004ACB3D  |.  E8 CA7EF5FF   call FormGhos.00404A0C
004ACB42  |.  8B45 E0       mov eax,[local.8]
004ACB45  |.  E8 6E80F5FF   call FormGhos.00404BB8
004ACB4A  |.  50            push eax
004ACB4B  |.  8D55 DC       lea edx,[local.9]
004ACB4E  |.  8B83 F4020000 mov eax,dword ptr ds:[eb>
004ACB54  |.  E8 CF3FF9FF   call FormGhos.00440B28
004ACB59  |.  8B45 DC       mov eax,[local.9]
004ACB5C  |.  E8 5780F5FF   call FormGhos.00404BB8
004ACB61  |.  50            push eax                 ; |String = NULL
004ACB62  |.  68 FCCC4A00   push FormGhos.004ACCFC   ; |Key = "NAME"
004ACB67  |.  68 04CD4A00   push FormGhos.004ACD04   ; |Section = "Message"
004ACB6C  |.  E8 D7A4F5FF   call <jmp.&kernel32.Writ>; \WritePrivateProfileStringA
004ACB71  |.  8B15 20FB4A00 mov edx,dword ptr ds:[0x>;  FormGhos.004B1DE4
004ACB77  |.  8B12          mov edx,dword ptr ds:[ed>
004ACB79  |.  8D45 D8       lea eax,[local.10]
004ACB7C  |.  50            push eax
004ACB7D  |.  B9 F0CC4A00   mov ecx,FormGhos.004ACCF>;  ASCII "user.dat"
004ACB82  |.  58            pop eax                  ;  0012F35C
004ACB83  |.  E8 847EF5FF   call FormGhos.00404A0C
004ACB88  |.  8B45 D8       mov eax,[local.10]
004ACB8B  |.  E8 2880F5FF   call FormGhos.00404BB8
004ACB90  |.  50            push eax
004ACB91  |.  8D55 D4       lea edx,[local.11]
004ACB94  |.  8B83 F8020000 mov eax,dword ptr ds:[eb>
004ACB9A  |.  E8 893FF9FF   call FormGhos.00440B28
004ACB9F  |.  8B45 D4       mov eax,[local.11]
004ACBA2  |.  E8 1180F5FF   call FormGhos.00404BB8
004ACBA7  |.  50            push eax                 ; |String = NULL
004ACBA8  |.  68 0CCD4A00   push FormGhos.004ACD0C   ; |Key = "SERIAL"
004ACBAD  |.  68 04CD4A00   push FormGhos.004ACD04   ; |Section = "Message"
004ACBB2  |.  E8 91A4F5FF   call <jmp.&kernel32.Writ>; \WritePrivateProfileStringA
004ACBB7  |.  A1 FCFC4A00   mov eax,dword ptr ds:[0x>
004ACBBC  |.  8B00          mov eax,dword ptr ds:[ea>
004ACBBE  |.  BA 1CCD4A00   mov edx,FormGhos.004ACD1>
004ACBC3  |.  E8 903FF9FF   call FormGhos.00440B58
004ACBC8  |.  A1 A0FE4A00   mov eax,dword ptr ds:[0x>
004ACBCD  |.  8B00          mov eax,dword ptr ds:[ea>
004ACBCF  |.  BA 1CCD4A00   mov edx,FormGhos.004ACD1>
004ACBD4  |.  E8 A73AFBFF   call FormGhos.00460680
004ACBD9  |.  A1 FCFC4A00   mov eax,dword ptr ds:[0x>
004ACBDE  |.  8B00          mov eax,dword ptr ds:[ea>
004ACBE0  |.  8B80 18030000 mov eax,dword ptr ds:[ea>
004ACBE6  |.  05 80000000   add eax,0x80
004ACBEB  |.  E8 187BF5FF   call FormGhos.00404708
004ACBF0  |.  A1 FCFC4A00   mov eax,dword ptr ds:[0x>
004ACBF5  |.  8B00          mov eax,dword ptr ds:[ea>
004ACBF7  |.  8B80 1C030000 mov eax,dword ptr ds:[ea>
004ACBFD  |.  05 80000000   add eax,0x80
004ACC02  |.  E8 017BF5FF   call FormGhos.00404708
004ACC07  |.  A1 FCFC4A00   mov eax,dword ptr ds:[0x>
004ACC0C  |.  8B00          mov eax,dword ptr ds:[ea>
004ACC0E  |.  8B80 20030000 mov eax,dword ptr ds:[ea>
004ACC14  |.  05 80000000   add eax,0x80
004ACC19  |.  E8 EA7AF5FF   call FormGhos.00404708
004ACC1E  |.  68 30100000   push 0x1030              ; /Style = MB_OK|MB_ICONEXCLAMATION|MB_SYSTEMMODAL
004ACC23  |.  68 38CD4A00   push FormGhos.004ACD38   ; |Title = "成功"
004ACC28  |.  68 40CD4A00   push FormGhos.004ACD40   ; |Text = "注册完成"
004ACC2D  |.  6A 00         push 0x0                 ; |hOwner = NULL
004ACC2F  |.  E8 04AAF5FF   call <jmp.&user32.Messag>; \MessageBoxA
004ACC34  |.  8BC3          mov eax,ebx
004ACC36  |.  E8 9D08FBFF   call FormGhos.0045D4D8
004ACC3B  |.  EB 24         jmp short FormGhos.004AC>
004ACC3D  |>  68 30100000   push 0x1030              ; /Style = MB_OK|MB_ICONEXCLAMATION|MB_SYSTEMMODAL
004ACC42  |.  68 C0CC4A00   push FormGhos.004ACCC0   ; |Title = "警告"
004ACC47  |.  68 4CCD4A00   push FormGhos.004ACD4C   ; |Text = "注册码错误"
004ACC4C  |.  6A 00         push 0x0                 ; |hOwner = NULL
004ACC4E  |.  E8 E5A9F5FF   call <jmp.&user32.Messag>; \MessageBoxA
004ACC53  |.  8B83 F8020000 mov eax,dword ptr ds:[eb>
004ACC59  |.  8B10          mov edx,dword ptr ds:[ea>
004ACC5B  |.  FF92 C0000000 call dword ptr ds:[edx+0>
004ACC61  |>  33C0          xor eax,eax
004ACC63  |.  5A            pop edx                  ;  0012F35C
004ACC64  |.  59            pop ecx                  ;  0012F35C
004ACC65  |.  59            pop ecx                  ;  0012F35C
004ACC66  |.  64:8910       mov dword ptr fs:[eax],e>
004ACC69  |.  68 B8CC4A00   push FormGhos.004ACCB8
004ACC6E  |>  8D45 D4       lea eax,[local.11]
004ACC71  |.  E8 927AF5FF   call FormGhos.00404708
004ACC76  |.  8D45 D8       lea eax,[local.10]
004ACC79  |.  E8 8A7AF5FF   call FormGhos.00404708
004ACC7E  |.  8D45 DC       lea eax,[local.9]
004ACC81  |.  E8 827AF5FF   call FormGhos.00404708
004ACC86  |.  8D45 E0       lea eax,[local.8]
004ACC89  |.  E8 7A7AF5FF   call FormGhos.00404708
004ACC8E  |.  8D45 E4       lea eax,[local.7]
004ACC91  |.  BA 04000000   mov edx,0x4
004ACC96  |.  E8 917AF5FF   call FormGhos.0040472C
004ACC9B  |.  8D45 F4       lea eax,[local.3]
004ACC9E  |.  E8 657AF5FF   call FormGhos.00404708
004ACCA3  |.  8D45 F8       lea eax,[local.2]
004ACCA6  |>  BA 02000000   mov edx,0x2
004ACCAB  |.  E8 7C7AF5FF   call FormGhos.0040472C
004ACCB0  \.  C3            retn




总结一下,算法非常简单。
注册码与注册名是什么没有直接联系,只与注册名的位数有关。

机器码前八位 乘 注册名位数 加 0xBC241(也就是十进制数 770625)     最后结果转换成十六进制文本。如果前面是0,去掉0。

免费评分

参与人数 1威望 +1 收起 理由
Hmily + 1 感谢发布原创作品,吾爱破解论坛因你更精彩.

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

 楼主| lionshine 发表于 2015-4-26 00:15

之前那位朋友的帖子。

http://www.52pojie.cn/thread-354081-1-1.html
怒小磊丶 发表于 2015-4-26 00:18
一般的软件取电脑机器码都会用什么做机器码?   MAC?  cpu?  硬盘?
A00 发表于 2015-4-26 14:17
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-17 20:43

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表