吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 5167|回复: 21
收起左侧

[原创] Personal Antispy 1.32 注册算法分析(附成品算法注册机)

  [复制链接]
pj2020 发表于 2017-7-24 22:37
本帖最后由 pj2020 于 2017-7-24 22:43 编辑

【文章标题】:Personal Antispy 1.32 注册算法分析
【文章作者】:pj2020
【软件名称】:Personal Antispy 1.32
【软件大小】:511KB
【保护方式】:注册码
【下载地址】:自己搜索
【加壳方式】:无壳
【编写工具】:Microsoft Visual C++ 8.0
破解工具】:PEID、OD
【操作平台】:盗版XP3
【作者声明】:只是感兴趣,没有其他目的
【软件简介】:检查你的系统里面有没有被人植下可以记录键盘操作的特洛伊木马程序

1.png
查找字串法:“Registration code or user name is invalid. Please check all fields and try again!”段首下断
[Asm] 纯文本查看 复制代码
004042EA  /$  55            push ebp                                 ;  //F2段首下断
004042EB  |.  8D6C24 8C     lea ebp,dword ptr ss:[esp-0x74]
004042EF  |.  81EC D0000000 sub esp,0xD0
004042F5  |.  A1 9C814B00   mov eax,dword ptr ds:[0x4B819C]
004042FA  |.  33C5          xor eax,ebp
004042FC  |.  8945 70       mov [arg.27],eax
004042FF  |.  56            push esi                                 ;  kernel32.lstrcatA
00404300  |.  8B35 A4274900 mov esi,dword ptr ds:[<&USER32.GetDlgIte>;  user32.GetDlgItemTextA
00404306  |.  57            push edi
00404307  |.  8B7D 7C       mov edi,[arg.30]
0040430A  |.  6A 32         push 0x32                                ; /Count = 32 (50.)
0040430C  |.  8D45 D8       lea eax,[local.10]                       ; |
0040430F  |.  50            push eax                                 ; |Buffer = 00000001
00404310  |.  6A 6A         push 0x6A                                ; |ControlID = 6A (106.)
00404312  |.  57            push edi                                 ; |hWnd = 000213BE ('Registration',class='#32770',parent=00081382)
00404313  |.  FFD6          call esi                                 ; \GetDlgItemTextA
00404315  |.  807D D8 00    cmp byte ptr ss:[ebp-0x28],0x0           ;  用户名第一个字符不能为0
00404319  |.  75 18         jnz short antispy.00404333
0040431B  |.  6A 40         push 0x40                                ; /Style = MB_OK|MB_ICONASTERISK|MB_APPLMODAL
0040431D  |.  68 E43A4900   push antispy.00493AE4                    ; |Attention!
00404322  |.  68 CC3A4900   push antispy.00493ACC                    ; |Please enter your name!
00404327  |.  57            push edi                                 ; |hOwner = 000213BE ('Registration',class='#32770',parent=00081382)
00404328  |.  FF15 A0274900 call dword ptr ds:[<&USER32.MessageBoxA>>; \MessageBoxA
0040432E  |.  E9 C8000000   jmp antispy.004043FB
00404333  |>  6A 0A         push 0xA
00404335  |.  8D45 58       lea eax,[arg.21]
00404338  |.  50            push eax
00404339  |.  6A 6B         push 0x6B
0040433B  |.  57            push edi
0040433C  |.  FFD6          call esi                                 ;  kernel32.lstrcatA
0040433E  |.  6A 0A         push 0xA
00404340  |.  8D45 40       lea eax,[arg.15]
00404343  |.  50            push eax
00404344  |.  6A 6C         push 0x6C
00404346  |.  57            push edi
00404347  |.  FFD6          call esi                                 ;  kernel32.lstrcatA
00404349  |.  6A 0A         push 0xA
0040434B  |.  8D45 4C       lea eax,[arg.18]
0040434E  |.  50            push eax
0040434F  |.  6A 6D         push 0x6D
00404351  |.  57            push edi
00404352  |.  FFD6          call esi                                 ;  kernel32.lstrcatA
00404354  |.  6A 0A         push 0xA
00404356  |.  8D45 64       lea eax,[arg.24]
00404359  |.  50            push eax
0040435A  |.  6A 6E         push 0x6E
0040435C  |.  57            push edi
0040435D  |.  FFD6          call esi                                 ;  //取第一个框的假码
0040435F  |.  8D45 58       lea eax,[arg.21]
00404362  |.  50            push eax                                 ; /String2 = 00000001 ???
00404363  |.  8D45 0C       lea eax,[arg.2]                          ; |
00404366  |.  50            push eax                                 ; |String1 = 00000001
00404367  |.  FF15 9C234900 call dword ptr ds:[<&KERNEL32.lstrcpyA>] ; \lstrcpyA
0040436D  |.  8B35 94234900 mov esi,dword ptr ds:[<&KERNEL32.lstrcat>;  kernel32.lstrcatA
00404373  |.  8D45 40       lea eax,[arg.15]                         ;  //取第二个框的假码
00404376  |.  50            push eax                                 ; /StringToAdd = 00000001 ???
00404377  |.  8D45 0C       lea eax,[arg.2]                          ; |
0040437A  |.  50            push eax                                 ; |ConcatString = 00000001 ???
0040437B  |.  FFD6          call esi                                 ; \//取第三个框的假码
0040437D  |.  8D45 4C       lea eax,[arg.18]
00404380  |.  50            push eax                                 ; /StringToAdd = 00000001 ???
00404381  |.  8D45 0C       lea eax,[arg.2]                          ; |第1-2框假码连接
00404384  |.  50            push eax                                 ; |ConcatString = 00000001 ???
00404385  |.  FFD6          call esi                                 ; \//取第四个框的假码
00404387  |.  8D45 64       lea eax,[arg.24]
0040438A  |.  50            push eax                                 ; /StringToAdd = 00000001 ???
0040438B  |.  8D45 0C       lea eax,[arg.2]                          ; |第1-3框假码连接
0040438E  |.  50            push eax                                 ; |ConcatString = 00000001 ???
0040438F  |.  FFD6          call esi                                 ; \lstrcatA
00404391  |.  8D45 A4       lea eax,[local.23]                       ;  第1-4框假码连接
00404394  |.  50            push eax
00404395  |.  8D45 D8       lea eax,[local.10]                       ;  取用户名入栈
00404398  |.  68 80384900   push antispy.00493880
0040439D  |.  50            push eax
0040439E  |.  E8 58FDFFFF   call antispy.004040FB                    ;  //F7进入算法CALL
004043A3  |.  83C4 0C       add esp,0xC
004043A6  |.  8D45 0C       lea eax,[arg.2]                          ;  //假码入栈
004043A9  |.  50            push eax                                 ; /String2 = 00000001 ???
004043AA  |.  8D45 A4       lea eax,[local.23]                       ; |//真码入栈
004043AD  |.  50            push eax                                 ; |String1 = 00000001 ???
004043AE  |.  FF15 E4234900 call dword ptr ds:[<&KERNEL32.lstrcmpiA>>; \//比较真假码
004043B4  |.  6A 40         push 0x40                                ; /Style = MB_OK|MB_ICONASTERISK|MB_APPLMODAL
004043B6  |.  85C0          test eax,eax                             ; |
004043B8  |.  75 25         jnz short antispy.004043DF               ; |//eax为0则注册成功,否则跳向失败

F7进入算法0040439E  CALL
[Asm] 纯文本查看 复制代码
004040FB  /$  55            push ebp
004040FC  |.  8BEC          mov ebp,esp
004040FE  |.  83EC 0C       sub esp,0xC
00404101  |.  53            push ebx
00404102  |.  56            push esi
00404103  |.  FF75 0C       push [arg.2]                         ; /字串:"_t <(6=kl/17g?>"
00404106  |.  8B35 F0234900 mov esi,dword ptr ds:[<&KERNEL32.lst>; |kernel32.lstrlenA
0040410C  |.  FFD6          call esi                             ; \lstrlenA
0040410E  |.  FF75 08       push [arg.1]                         ; /String = "abcde"
00404111  |.  8BD8          mov ebx,eax                          ; |
00404113  |.  895D F8       mov [local.2],ebx                    ; |
00404116  |.  FFD6          call esi                             ; \lstrlenA
00404118  |.  8BF0          mov esi,eax
0040411A  |.  8975 F4       mov [local.3],esi
0040411D  |.  85F6          test esi,esi                         ;  判断注册码是否为空
0040411F  |.  75 08         jnz short antispy.00404129
00404121  |.  8B45 10       mov eax,[arg.3]
00404124  |.  C600 00       mov byte ptr ds:[eax],0x0
00404127  |.  EB 4E         jmp short antispy.00404177
00404129  |>  57            push edi
0040412A  |.  FF75 0C       push [arg.2]                         ; /String2 = "_t <(6=kl/17g?>"
0040412D  |.  8B7D 10       mov edi,[arg.3]                      ; |
00404130  |.  57            push edi                             ; |String1 = 0012EBA0
00404131  |.  FF15 9C234900 call dword ptr ds:[<&KERNEL32.lstrcp>; \lstrcpyA
00404137  |.  3BF3          cmp esi,ebx                          ;  比较用户名与注册码长度
00404139  |.  8975 FC       mov [local.1],esi
0040413C  |.  7F 03         jg short antispy.00404141
0040413E  |.  895D FC       mov [local.1],ebx
00404141  |>  33F6          xor esi,esi
00404143  |.  3975 FC       cmp [local.1],esi
00404146  |.  7E 2C         jle short antispy.00404174
00404148  |>  8BC6          /mov eax,esi
0040414A  |.  99            |cdq
0040414B  |.  F77D F8       |idiv [local.2]                      ;  除以注册码长度16
0040414E  |.  8BC6          |mov eax,esi
00404150  |.  6A 19         |push 0x19
00404152  |.  5B            |pop ebx
00404153  |.  8D0C3A        |lea ecx,dword ptr ds:[edx+edi]
00404156  |.  99            |cdq
00404157  |.  F77D F4       |idiv [local.3]                      ;  除以用户名长度
0040415A  |.  8B45 08       |mov eax,[arg.1]
0040415D  |.  0FB60402      |movzx eax,byte ptr ds:[edx+eax]     ;  依次取用户名ASC码(用户名不够16位将重复按顺序取)
00404161  |.  0FB611        |movzx edx,byte ptr ds:[ecx]         ;  依次取固定字串ASC码:5F ('_')/74 ('t')
00404164  |.  33C2          |xor eax,edx                         ;  eax=61 xor 5F=3E/62 xor 74=16
00404166  |.  99            |cdq
00404167  |.  F7FB          |idiv ebx                            ;  eax/ebx=3E/19,eax=2,edx=C
00404169  |.  80C2 41       |add dl,0x41                         ;  dl+0x41=C+41=4D/57 ('W')
0040416C  |.  46            |inc esi
0040416D  |.  3B75 FC       |cmp esi,[local.1]
00404170  |.  8811          |mov byte ptr ds:[ecx],dl            ;  dl=4D ('M')
00404172  |.^ 7C D4         \jl short antispy.00404148
00404174  |>  8BC7          mov eax,edi                          ;  edi=0012EBA0, (ASCII "MWRNCMUIIYFKENXU")
00404176  |.  5F            pop edi
00404177  |>  5E            pop esi
00404178  |.  5B            pop ebx
00404179  |.  C9            leave
0040417A  \.  C3            retn

注:固定字串"_t <(6=kl/17g?>"的ASC码:5F ('_')74 ('t')20 (' ')3C ('<')28 ('(')36 ('6')3D ('=')6B ('k')6C ('l')2F ('/')31 ('1')37 ('7')67 ('g')D82C (',')3E ('>')固定字串中的“?”并非问号?,其中有两个字符,不知道为何没显示出来,两个字符的ASC码是:D8和2C (',')通过观察寄存器和堆栈窗口,发现固定字串为"_t <(6=kl/17g丿,>"

因是明码比较,故可做内存注册机:
内存注册机:
中断地址:4043AE
中断次数:1
第一字节:FF
指令长度:6
内存方式:EAX

算法总结:
用户名和注册码不能为空
依次取用户名ASC码(用户名不够16位将重复按顺序取),记为:A
依次取16位固定字串("_t <(6=kl/17g丿,>")的ASC码,记为:B---5F ('_')74 ('t')20 (' ')3C ('<')28 ('(')36 ('6')3D ('=')6B ('k')6C ('l')2F ('/')31 ('1')37 ('7')67 ('g')D82C (',')3E ('>')
C=A xor B
C/0x19(25)的余数+0x41(65),记为:D
D的结果相连即为SN


如果用户名为17-32位时:(以17位用户名abcdefghijklmnopq为例)
前16位用户名abcdefghijklmnop算出的注册码为MWRNCFPDFTPQKHRD,那么从第17位用户名开始不再和固定字串进行异或,而是和前16位用户名算出的注册码进行依次异或,比如第17位用户名为p,它算出的注册为K,它就取代前16位用户名算出的注册码中的第1位M,这样的话17位用户名abcdefghijklmnopq算出的注册码应为:KWRNCFPDFTPQKHRD。那么第18位就取代第2位注册。。。


如果用户名为33-48位时:(以33位用户名abcdefghijklmnopqrstuvwxyz1234567为例)
前32位用户名abcdefghijklmnopqrstuvwxyz123456算出的注册码为KMIIEXOKNVWYUYDO,那么从第33位用户名开始不再和固定字串进行异或,而是和第17-32位用户名算出的注册码进行依次异或,比如第33位用户名为7,它算出的注册为Y,它就取代第17-32位用户名算出的注册码中的第1位K,这样的话33位用户名abcdefghijklmnopqrstuvwxyz1234567算出的注册码应为:YMIIEXOKNVWYUYDO。那么第34位就取代第2位注册码。。。


如果用户名为49-64位时:以此类推。。。


注册信息保存在注册表:
HKEY_CURRENT_USER\Software\Blazing Tools\Personal Antispy\RegCode 注册码

HKEY_CURRENT_USER\Software\Blazing Tools\Personal Antispy\RegName 用户名


3.png

附注册机:
Personal Antispy 1.32 算法注册机.rar (6.92 KB, 下载次数: 43)

免费评分

参与人数 10威望 +1 吾爱币 +19 热心值 +10 收起 理由
Hmily + 1 + 10 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
MXWXZ + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
流年回忆 + 1 + 1 用心讨论,共获提升!
shadowzpl + 1 + 1 用心讨论,共获提升!
雫Hao洋洋 + 1 热心回复!
等待记忆中 + 1 + 1 谢谢@Thanks!
Python大法好 + 1 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
smile1110 + 3 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
平淡最真 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
语然 + 1 + 1 用心讨论,共获提升!

查看全部评分

本帖被以下淘专辑推荐:

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

www1366886 发表于 2017-7-24 23:03 来自手机
虽然看不懂  还是要  谢谢楼主
huangqt1986 发表于 2017-7-24 23:11
13737936420 发表于 2017-7-24 23:32 来自手机
巅峰 发表于 2017-7-25 00:02
前面几个都是新人
tangdragon 发表于 2017-7-25 08:28
分析得很好!
dkr0801 发表于 2017-7-25 08:42
学习了,谢谢分享
xgh1128205 发表于 2017-7-25 08:47
好东西,要收藏一下!!!!!!!!!!!!!!!
奇卡无比 发表于 2017-7-25 08:59
刚在虚拟机里下下来 相应的软件  准备晚上试一试
peterq521 发表于 2017-7-25 09:01
是用来查壳的吧
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

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

GMT+8, 2024-4-19 22:57

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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