Repair Registry Pro V1.0.0.1注册分析
【破解作者】 winndy
【作者邮箱】 CNwinndy@hotmail.com
【使用工具】 PEID v0.93  OllyDbg v1.10 fly修改版
【破解平台】 Winxp SP2
【软件名称】 Repair Registry Pro V1.0.0.1
【官方网址】 HTTP://www.Fixed-PC.com or http://www.repairregistrypro.com/?hop=ddirectad
【编写语言】 Microsoft Visual C++ 7.0
【软件介绍】 在上网的时候突然收到一个message,说我的系统存在漏洞,让我去Fixed-PC.com去下载
             Repair Registry Pro,原来可以用来修复注册表.
【破解声明】 For study ,For Fun,
【破解说明】 无壳,根据MAC值查密码表,失误之处还望指出
【破解过程】附件:VB_KeyGEN_Src_etc.rar

 PEID查壳,无壳,Microsoft Visual C++ 7.0编写.
 运行程序,点右上角的"BUY/REgister"按钮,出现输入注册码窗口.
 输入username:CNwinndy,RegCode:1234567890
 弹出错误信息:"Invalid code."无标题,有一个"确定"按钮,于是可以知道这是一个messagebox,而不是一个 form,为什么呢?因为如果是form,按钮应该是"OK",
而不是中文"确定",具体是什么与系统有关,在老外的机器上还是"OK",因此显然是一个messagebox.

 用OD载入程序,反键,"搜索"---"全部参考文本字符串",反键,"搜索文本","Invalid code"
00410F07  push RRPro.0044AA2C   ASCII "Invalid code."
00410F95  push RRPro.00447900   ASCII "username"
00410FA7  push RRPro.004478E4    ASCII "regcode"
00411036  push RRPro.00447900    ASCII "username"
004110C0  push RRPro.0044A9A8    ASCII "Congratulations! successfully registered please restart RepairRegistryPro."
这些行都下断点.

翻到最上一页,马上又可以看到敏感信息:
00401BBF   push RepairRe.004478C0      ASCII "Congratulation you are Registered"
00401BCF   push RepairRe.00447890      ASCII "Sorry this is not a valid registration code."
两行都下断点.

F9,运行程序,点右上角的"BUY/REgister"按钮,出现输入注册码窗口.
输入username:CNwinndy,RegCode:1234567890
点"OK",程序中断在这里:

00410F07    .  68 2CAA4400        push RRPro.0044AA2C                     ;  ASCII "Invalid code."

向上找到第一个跳转:
00410EC6    .  8B4C24 24          mov ecx,dword ptr ss:[esp+24]
00410ECA    .  83C0 10            add eax,10
00410ECD    .  8901               mov dword ptr ds:[ecx],eax
00410ECF    .  8B4E 74            mov ecx,dword ptr ds:[esi+74]
00410ED2    .  83C4 04            add esp,4
00410ED5    .  C64424 34 01       mov byte ptr ss:[esp+34],1              ; |
00410EDA    .  E8 B1670000        call RRPro.00417690                     ; \RRPro.00417690
00410EDF    .  84C0               test al,al
00410EE1    . /0F85 AA000000      jnz RRPro.00410F91

在这个call前面下断点,往上看看,还有几个call,在每个可疑的call前面都下断点.
在这段子程序开始处00410DB0 下断点,然后再跟踪.
完整的程序段为:

###########################################################################################################################

00410DB0    .  6A FF              push -1                  ;再一次输入username和regcode,然后停在这里
00410DB2    .  64:A1 00000000     mov eax,dword ptr fs:[0]
00410DB8    .  68 80454400        push RRPro.00444580
00410DBD    .  50                 push eax
00410DBE    .  64:8925 00000000   mov dword ptr fs:[0],esp
00410DC5    .  83EC 14            sub esp,14
00410DC8    .  53                 push ebx
00410DC9    .  55                 push ebp
00410DCA    .  56                 push esi
00410DCB    .  57                 push edi
00410DCC    .  6A 01              push 1
00410DCE    .  8BF1               mov esi,ecx
00410DD0    .  E8 B94C0200        call RRPro.00435A8E    ;不妨F8先过去
00410DD5    .  8B86 A4040000      mov eax,dword ptr ds:[esi+4A4]  ;观察寄存器 EAX 00D1D340 ASCII "CNwinndy"
00410DDB    .  8B48 F4            mov ecx,dword ptr ds:[eax-C]    ;ECX 00000008,这是用户名的长度
00410DDE    .  85C9               test ecx,ecx                    ;检验用户名是否为空
00410DE0    .  8DAE A4040000      lea ebp,dword ptr ds:[esi+4A4]  ;

;D [EBP]
;00D2CB70  43 4E 77 69 6E 6E 64 79  CNwinndy
;00D2CB78  00                       .


00410DE6    .  0F84 98030000      je RRPro.00411184              ;用户名为空就跳,CTRL+g,00411184,可看到“ERROR” "Please fill all the details"

00410DEC    .  8B8E A8040000      mov ecx,dword ptr ds:[esi+4A8] ;ECX 00D2CBA8 ASCII "1234567890"
00410DF2    .  8B51 F4            mov edx,dword ptr ds:[ecx-C]   ;EDX 0000000A  --这是注册码的长度
00410DF5    .  85D2               test edx,edx                   ;检验用户名是否为空
00410DF7    .  8DBE A8040000      lea edi,dword ptr ds:[esi+4A8] ;

D [EDI]
;00D2CBA8  31 32 33 34 35 36 37 38  12345678
;00D2CBB0  39 30 00                 90.

00410DFD    .  0F84 81030000      je RRPro.00411184            ;注册码为空为空就跳,CTRL+g,00411184,可看到“ERROR” "Please fill all the details"
00410E03    .  83C0 F0            add eax,-10
00410E06    .  50                 push eax                     ;
00410E07    .  E8 040AFFFF        call RRPro.00401810          ;F8不妨先跳过,有问题再进去
00410E0C    .  83C0 10            add eax,10                   ;EAX 00D2CB70 ASCII "CNwinndy"
00410E0F    .  894424 20          mov dword ptr ss:[esp+20],eax  ;esp+20=0012A700
00410E13    .  8B07               mov eax,dword ptr ds:[edi]   ;EAX 00D2CBA8 ASCII "1234567890"
00410E15    .  83E8 10            sub eax,10                   ; 即add eax,-10
00410E18    .  50                 push eax
00410E19    .  C74424 34 00000000 mov dword ptr ss:[esp+34],0  ;
00410E21    .  E8 EA09FFFF        call RRPro.00401810          ;F8不妨先跳过
00410E26    .  83C0 10            add eax,10                   ;EAX 00D2CBA8 ASCII "1234567890"
00410E29    .  83C4 08            add esp,8
00410E2C    .  894424 14          mov dword ptr ss:[esp+14],eax  ;esp+14=0012A6F8
00410E30    .  8D4C24 14          lea ecx,dword ptr ss:[esp+14]  ;ECX=0012A6F8
00410E34    .  C64424 2C 01       mov byte ptr ss:[esp+2C],1     ;esp+2C=0012A710
00410E39    .  E8 8219FFFF        call RRPro.004027C0            ;F8不妨先跳过
00410E3E    .  8B07               mov eax,dword ptr ds:[edi]     ;EAX 00D2CBA8 ASCII "1234567890"
00410E40    .  51                 push ecx                       ;ECX 00D2CD50 ASCII "1234567890"
00410E41    .  83E8 10            sub eax,10
00410E44    .  896424 24          mov dword ptr ss:[esp+24],esp
00410E48    .  8BDC               mov ebx,esp
00410E4A    .  50                 push eax
00410E4B    .  E8 C009FFFF        call RRPro.00401810            ;F8不妨先跳过
00410E50    .  83C0 10            add eax,10
00410E53    .  8903               mov dword ptr ds:[ebx],eax     ;EAX 00D2CBA8 ASCII "1234567890" EBX 0012A6E0 
00410E55    .  8B45 00            mov eax,dword ptr ss:[ebp]     ;执行后EAX 00D2CB70 ASCII "CNwinndy"
00410E58    .  83E8 10            sub eax,10
00410E5B    .  896424 20          mov dword ptr ss:[esp+20],esp
00410E5F    .  8BDC               mov ebx,esp
00410E61    .  50                 push eax
00410E62    .  C64424 38 02       mov byte ptr ss:[esp+38],2     ;esp+38=0012A710,注意前面00410E34那一句,地址一样
00410E67    .  E8 A409FFFF        call RRPro.00401810            ;F8不妨先跳过
00410E6C    .  83C0 10            add eax,10
00410E6F    .  8903               mov dword ptr ds:[ebx],eax     ;EAX 00D2CB70 ASCII "CNwinndy"  EBX 0012A6DC
00410E71    .  8B4E 74            mov ecx,dword ptr ds:[esi+74]  ;ECX 0012BBB0
00410E74    .  83C4 04            add esp,4
00410E77    .  C64424 34 01       mov byte ptr ss:[esp+34],1              ; |  esp+34=0012A710,注意前面两句,地址一样,可能对应一个变量,        
00410E7C    .  E8 0F680000        call RRPro.00417690                     ; \RRPro.00417690  这一句后面有个检验加跳转语句,需跟进去,见call[分析一]
00410E81    .  84C0               test al,al                     ;返回到这里,al=01
00410E83    .  0F85 08010000      jnz RRPro.00410F91
00410E89    .  8B5C24 14          mov ebx,dword ptr ss:[esp+14]
00410E8D    .  51                 push ecx
00410E8E    .  83C3 F0            add ebx,-10
00410E91    .  896424 14          mov dword ptr ss:[esp+14],esp
00410E95    .  896424 1C          mov dword ptr ss:[esp+1C],esp
00410E99    .  53                 push ebx
00410E9A    .  E8 7109FFFF        call RRPro.00401810
00410E9F    .  8B5424 20          mov edx,dword ptr ss:[esp+20]
00410EA3    .  83C0 10            add eax,10
00410EA6    .  8902               mov dword ptr ds:[edx],eax
00410EA8    .  8B4424 24          mov eax,dword ptr ss:[esp+24]
00410EAC    .  83C0 F0            add eax,-10
00410EAF    .  896424 28          mov dword ptr ss:[esp+28],esp
00410EB3    .  896424 20          mov dword ptr ss:[esp+20],esp
00410EB7    .  50                 push eax
00410EB8    .  C64424 38 03       mov byte ptr ss:[esp+38],3
00410EBD    .  894424 2C          mov dword ptr ss:[esp+2C],eax
00410EC1    .  E8 4A09FFFF        call RRPro.00401810
00410EC6    .  8B4C24 24          mov ecx,dword ptr ss:[esp+24]
00410ECA    .  83C0 10            add eax,10
00410ECD    .  8901               mov dword ptr ds:[ecx],eax
00410ECF    .  8B4E 74            mov ecx,dword ptr ds:[esi+74]
00410ED2    .  83C4 04            add esp,4
00410ED5    .  C64424 34 01       mov byte ptr ss:[esp+34],1              ; |
00410EDA    .  E8 B1670000        call RRPro.00417690                     ; \RRPro.00417690  这一句后面有个检验加跳转语句,需跟进去,见call[分析一]
00410EDF    .  84C0               test al,al                              ;al是标志,al=0,则报错"Invalid code."
00410EE1    .  0F85 AA000000      jnz RRPro.00410F91
00410EE7    .  6A 00              push 0
00410EE9    .  68 3CAA4400        push RRPro.0044AA3C                     ;  ASCII "Version"
00410EEE    .  8D5424 18          lea edx,dword ptr ss:[esp+18]
00410EF2    .  68 EC784400        push RRPro.004478EC                     ;  ASCII "Repair Registry Pro"
00410EF7    .  52                 push edx
00410EF8    .  E8 734F0000        call RRPro.00415E70
00410EFD    .  83C4 10            add esp,10
00410F00    .  8B4424 10          mov eax,dword ptr ss:[esp+10]
00410F04    .  6A 10              push 10
00410F06    .  50                 push eax
00410F07    .  68 2CAA4400        push RRPro.0044AA2C                     ;  ASCII "Invalid code."
00410F0C    .  8BCE               mov ecx,esi
00410F0E    .  C64424 38 07       mov byte ptr ss:[esp+38],7
00410F13    .  E8 184B0200        call RRPro.00435A30
00410F18    .  68 8E784400        push RRPro.0044788E
00410F1D    .  8BCD               mov ecx,ebp
00410F1F    .  E8 7C0EFFFF        call RRPro.00401DA0
00410F24    .  68 8E784400        push RRPro.0044788E
00410F29    .  8BCF               mov ecx,edi
00410F2B    .  E8 700EFFFF        call RRPro.00401DA0
00410F30    .  68 8E784400        push RRPro.0044788E
00410F35    .  8D8E AC040000      lea ecx,dword ptr ds:[esi+4AC]
00410F3B    .  E8 600EFFFF        call RRPro.00401DA0
00410F40    .  6A 00              push 0
00410F42    .  8BCE               mov ecx,esi
00410F44    .  E8 454B0200        call RRPro.00435A8E
00410F49    .  8B4424 10          mov eax,dword ptr ss:[esp+10]
00410F4D    .  83C0 F0            add eax,-10
00410F50    .  C64424 2C 01       mov byte ptr ss:[esp+2C],1
00410F55    .  8D48 0C            lea ecx,dword ptr ds:[eax+C]
00410F58    .  83CA FF            or edx,FFFFFFFF
00410F5B    .  F0:0FC111          lock xadd dword ptr ds:[ecx],edx
00410F5F    .  4A                 dec edx
00410F60    .  85D2               test edx,edx
00410F62    .  7F 08              jg short RRPro.00410F6C
00410F64    .  8B08               mov ecx,dword ptr ds:[eax]
00410F66    .  8B11               mov edx,dword ptr ds:[ecx]
00410F68    .  50                 push eax
00410F69    .  FF52 04            call dword ptr ds:[edx+4]
00410F6C    >  C64424 2C 00       mov byte ptr ss:[esp+2C],0
00410F71    .  8D43 0C            lea eax,dword ptr ds:[ebx+C]
00410F74    .  83C9 FF            or ecx,FFFFFFFF
00410F77    .  F0:0FC108          lock xadd dword ptr ds:[eax],ecx
00410F7B    .  49                 dec ecx
00410F7C    .  85C9               test ecx,ecx
00410F7E    .  7F 08              jg short RRPro.00410F88
00410F80    .  8B0B               mov ecx,dword ptr ds:[ebx]
00410F82    .  8B11               mov edx,dword ptr ds:[ecx]
00410F84    .  53                 push ebx
00410F85    .  FF52 04            call dword ptr ds:[edx+4]
00410F88    >  8B4424 20          mov eax,dword ptr ss:[esp+20]
00410F8C    .  E9 C1010000        jmp RRPro.00411152

注册码正确跳到这里:
00410F91    >  8B6D 00            mov ebp,dword ptr ss:[ebp]
00410F94    .  55                 push ebp
00410F95    .  68 00794400        push RRPro.00447900                     ;  ASCII "username"
00410F9A    .  68 EC784400        push RRPro.004478EC                     ;  ASCII "Repair Registry Pro"
00410F9F    .  E8 DC4D0000        call RRPro.00415D80                      ;F7跟进,发现功能是把注册信息写入到注册表中
00410FA4    .  8B3F               mov edi,dword ptr ds:[edi]
00410FA6    .  57                 push edi
00410FA7    .  68 E4784400        push RRPro.004478E4                     ;  ASCII "regcode"
00410FAC    .  68 EC784400        push RRPro.004478EC                     ;  ASCII "Repair Registry Pro"
00410FB1    .  E8 CA4D0000        call RRPro.00415D80                     ;把注册信息写入到注册表中

下面这些F9运行下去,就会弹出"Congratulations! successfully registered please restart RepairRegistryPro."
同时发现"BUY/REGISTER"按钮消失,点"ABOUT",发现"This version of Repair Registry is Licenced to CNwinndy " 
HoHOHOooooo....
打开注册表,HKEY_LOCAL_MACHINE\SOFTWARE\Repair Registry Pro,这个下面有username=CNwinndy,regcode=4072869764。
这还没完,那个神秘的"026540DEE26"到底是什么呢?如果您是一个超级Cracker,您可能会背得出您的硬盘序列号,MAC地址等,^_^
没错,通过下面的分析可以发现,那个神秘的字符串就是MAC地址。
最简单的办法是,运行"CMD","IPconfig /all",您便可以发现Physical Address 正是我们所找的东西。
可惜,我不记得我的MAC地址,跟踪后才发现的。起初以为它与用户名有关,变换用户名以后,它还是不变,于是肯定它是与机器有关的一个字符串了。
见后面的分析[追踪神秘字符串]

00410FB6    .  6A 00              push 0
00410FB8    .  68 3CAA4400        push RRPro.0044AA3C                     ;  ASCII "Version"
00410FBD    .  8D4424 38          lea eax,dword ptr ss:[esp+38]
00410FC1    .  68 EC784400        push RRPro.004478EC                     ;  ASCII "Repair Registry Pro"
00410FC6    .  50                 push eax
00410FC7    .  E8 A44E0000        call RRPro.00415E70
00410FCC    .  83C4 28            add esp,28
00410FCF    .  C64424 2C 04       mov byte ptr ss:[esp+2C],4
00410FD4    .  E8 778E0200        call RRPro.00439E50
00410FD9    .  85C0               test eax,eax
00410FDB    .  74 09              je short RRPro.00410FE6
00410FDD    .  8B10               mov edx,dword ptr ds:[eax]
00410FDF    .  8BC8               mov ecx,eax
00410FE1    .  FF52 74            call dword ptr ds:[edx+74]
00410FE4    .  EB 02              jmp short RRPro.00410FE8
00410FE6    >  33C0               xor eax,eax
00410FE8    >  68 FB030000        push 3FB
00410FED    .  8BC8               mov ecx,eax
00410FEF    .  E8 82710200        call RRPro.00438176
00410FF4    .  6A 00              push 0
00410FF6    .  8BC8               mov ecx,eax
00410FF8    .  E8 F6720200        call RRPro.004382F3
00410FFD    .  E8 4E8E0200        call RRPro.00439E50
00411002    .  85C0               test eax,eax
00411004    .  74 09              je short RRPro.0041100F
00411006    .  8B10               mov edx,dword ptr ds:[eax]
00411008    .  8BC8               mov ecx,eax
0041100A    .  FF52 74            call dword ptr ds:[edx+74]
0041100D    .  EB 02              jmp short RRPro.00411011
0041100F    >  33C0               xor eax,eax
00411011    >  8B40 1C            mov eax,dword ptr ds:[eax+1C]
00411014    .  8B3D B4744400      mov edi,dword ptr ds:[<&USER32.Invalida>;  USER32.InvalidateRect
0041101A    .  6A 01              push 1                                  ; /Erase = TRUE
0041101C    .  6A 00              push 0                                  ; |pRect = NULL
0041101E    .  50                 push eax                                ; |hWnd
0041101F    .  FFD7               call edi                                ; \InvalidateRect
00411021    .  E8 BD7E0200        call RRPro.00438EE3
00411026    .  8B10               mov edx,dword ptr ds:[eax]
00411028    .  8BC8               mov ecx,eax
0041102A    .  FF52 0C            call dword ptr ds:[edx+C]
0041102D    .  83C0 10            add eax,10
00411030    .  894424 10          mov dword ptr ss:[esp+10],eax
00411034    .  6A 00              push 0
00411036    .  68 00794400        push RRPro.00447900                     ;  ASCII "username"
0041103B    .  8D4424 28          lea eax,dword ptr ss:[esp+28]
0041103F    .  68 EC784400        push RRPro.004478EC                     ;  ASCII "Repair Registry Pro"
00411044    .  B3 05              mov bl,5
00411046    .  50                 push eax
00411047    .  885C24 3C          mov byte ptr ss:[esp+3C],bl
0041104B    .  E8 204E0000        call RRPro.00415E70
00411050    .  8B08               mov ecx,dword ptr ds:[eax]
00411052    .  51                 push ecx
00411053    .  68 FCA94400        push RRPro.0044A9FC                     ;  ASCII "This version of Repair Registry is Licenced to "
00411058    .  8D5424 28          lea edx,dword ptr ss:[esp+28]
0041105C    .  68 F4A94400        push RRPro.0044A9F4                     ;  ASCII "%s %s"
00411061    .  52                 push edx
00411062    .  C64424 4C 06       mov byte ptr ss:[esp+4C],6
00411067    .  E8 140DFFFF        call RRPro.00401D80
0041106C    .  8B4424 40          mov eax,dword ptr ss:[esp+40]
00411070    .  83C0 F0            add eax,-10
00411073    .  83C4 20            add esp,20
00411076    .  885C24 2C          mov byte ptr ss:[esp+2C],bl
0041107A    .  8D48 0C            lea ecx,dword ptr ds:[eax+C]
0041107D    .  83CA FF            or edx,FFFFFFFF
00411080    .  F0:0FC111          lock xadd dword ptr ds:[ecx],edx
00411084    .  4A                 dec edx
00411085    .  85D2               test edx,edx
00411087    .  7F 08              jg short RRPro.00411091
00411089    .  8B08               mov ecx,dword ptr ds:[eax]
0041108B    .  8B11               mov edx,dword ptr ds:[ecx]
0041108D    .  50                 push eax
0041108E    .  FF52 04            call dword ptr ds:[edx+4]
00411091    >  8B46 74            mov eax,dword ptr ds:[esi+74]
00411094    .  8D88 700C0000      lea ecx,dword ptr ds:[eax+C70]
0041109A    .  8B01               mov eax,dword ptr ds:[ecx]
0041109C    .  8D5424 10          lea edx,dword ptr ss:[esp+10]
004110A0    .  52                 push edx
004110A1    .  FF90 40010000      call dword ptr ds:[eax+140]
004110A7    .  8B46 74            mov eax,dword ptr ds:[esi+74]
004110AA    .  6A 01              push 1
004110AC    .  05 040A0000        add eax,0A04
004110B1    .  8B40 1C            mov eax,dword ptr ds:[eax+1C]
004110B4    .  6A 00              push 0
004110B6    .  50                 push eax
004110B7    .  FFD7               call edi
004110B9    .  8B4C24 18          mov ecx,dword ptr ss:[esp+18]
004110BD    .  6A 00              push 0
004110BF    .  51                 push ecx
004110C0    .  68 A8A94400        push RRPro.0044A9A8                     ;  ASCII "Congratulations! successfully registered please restart RepairRegistryPro."
004110C5    .  8BCE               mov ecx,esi
004110C7    .  E8 64490200        call RRPro.00435A30
004110CC    .  E8 95E50200        call RRPro.0043F666
004110D1    .  8B40 04            mov eax,dword ptr ds:[eax+4]
004110D4    .  C680 A0000000 00   mov byte ptr ds:[eax+A0],0
004110DB    .  8B4424 10          mov eax,dword ptr ss:[esp+10]
004110DF    .  83C0 F0            add eax,-10
004110E2    .  C64424 2C 04       mov byte ptr ss:[esp+2C],4
004110E7    .  8D50 0C            lea edx,dword ptr ds:[eax+C]
004110EA    .  83C9 FF            or ecx,FFFFFFFF
004110ED    .  F0:0FC10A          lock xadd dword ptr ds:[edx],ecx
004110F1    .  49                 dec ecx
004110F2    .  85C9               test ecx,ecx
004110F4    .  7F 08              jg short RRPro.004110FE
004110F6    .  8B08               mov ecx,dword ptr ds:[eax]
004110F8    .  8B11               mov edx,dword ptr ds:[ecx]
004110FA    .  50                 push eax
004110FB    .  FF52 04            call dword ptr ds:[edx+4]
004110FE    >  8B4424 18          mov eax,dword ptr ss:[esp+18]
00411102    .  83C0 F0            add eax,-10
00411105    .  C64424 2C 01       mov byte ptr ss:[esp+2C],1
0041110A    .  8D48 0C            lea ecx,dword ptr ds:[eax+C]
0041110D    .  83CA FF            or edx,FFFFFFFF
00411110    .  F0:0FC111          lock xadd dword ptr ds:[ecx],edx
00411114    .  4A                 dec edx
00411115    .  85D2               test edx,edx
00411117    .  7F 08              jg short RRPro.00411121
00411119    .  8B08               mov ecx,dword ptr ds:[eax]
0041111B    .  8B11               mov edx,dword ptr ds:[ecx]
0041111D    .  50                 push eax
0041111E    .  FF52 04            call dword ptr ds:[edx+4]
00411121    >  8BCE               mov ecx,esi
00411123    .  E8 5D330200        call RRPro.00434485
00411128    .  8B4424 14          mov eax,dword ptr ss:[esp+14]
0041112C    .  83C0 F0            add eax,-10
0041112F    .  C64424 2C 00       mov byte ptr ss:[esp+2C],0
00411134    .  8D48 0C            lea ecx,dword ptr ds:[eax+C]
00411137    .  83CA FF            or edx,FFFFFFFF
0041113A    .  F0:0FC111          lock xadd dword ptr ds:[ecx],edx
0041113E    .  4A                 dec edx
0041113F    .  85D2               test edx,edx
00411141    .  7F 08              jg short RRPro.0041114B
00411143    .  8B08               mov ecx,dword ptr ds:[eax]
00411145    .  8B11               mov edx,dword ptr ds:[ecx]
00411147    .  50                 push eax
00411148    .  FF52 04            call dword ptr ds:[edx+4]
0041114B    >  8B4424 1C          mov eax,dword ptr ss:[esp+1C]
0041114F    .  83C0 F0            add eax,-10
00411152    >  C74424 2C FFFFFFFF mov dword ptr ss:[esp+2C],-1
0041115A    .  8D48 0C            lea ecx,dword ptr ds:[eax+C]
0041115D    .  83CA FF            or edx,FFFFFFFF
00411160    .  F0:0FC111          lock xadd dword ptr ds:[ecx],edx
00411164    .  4A                 dec edx
00411165    .  85D2               test edx,edx
00411167    .  7F 2E              jg short RRPro.00411197
00411169    .  8B08               mov ecx,dword ptr ds:[eax]
0041116B    .  8B11               mov edx,dword ptr ds:[ecx]
0041116D    .  50                 push eax
0041116E    .  FF52 04            call dword ptr ds:[edx+4]
00411171    .  8B4C24 24          mov ecx,dword ptr ss:[esp+24]
00411175    .  64:890D 00000000   mov dword ptr fs:[0],ecx
0041117C    .  5F                 pop edi
0041117D    .  5E                 pop esi
0041117E    .  5D                 pop ebp
0041117F    .  5B                 pop ebx
00411180    .  83C4 20            add esp,20
00411183    .  C3                 retn
00411184    >  6A 10              push 10
00411186    .  68 1C8A4400        push RRPro.00448A1C                     ;  ASCII "Error"
0041118B    .  68 88A94400        push RRPro.0044A988                     ;  ASCII "Please fill all the details"
00411190    .  8BCE               mov ecx,esi
00411192    .  E8 99480200        call RRPro.00435A30
00411197    >  8B4C24 24          mov ecx,dword ptr ss:[esp+24]
0041119B    .  5F                 pop edi
0041119C    .  5E                 pop esi
0041119D    .  5D                 pop ebp
0041119E    .  64:890D 00000000   mov dword ptr fs:[0],ecx
004111A5    .  5B                 pop ebx
004111A6    .  83C4 20            add esp,20
004111A9    .  C3                 retn

###########################################################################################################################
子程序[分析一]

00417690   /$  6A FF              push -1
00417692   |.  68 70524400        push RRPro.00445270                     ;  SE handler installation
00417697   |.  64:A1 00000000     mov eax,dword ptr fs:[0]
0041769D   |.  50                 push eax
0041769E   |.  64:8925 00000000   mov dword ptr fs:[0],esp
004176A5   |.  83EC 14            sub esp,14
004176A8   |.  8D4424 0C          lea eax,dword ptr ss:[esp+C]
004176AC   |.  50                 push eax                                ; /Arg1
004176AD   |.  C74424 20 01000000 mov dword ptr ss:[esp+20],1             ; |  esp+20=0012A6D4
004176B5   |.  E8 A6FDFFFF        call RRPro.00417460                     ; \RRPro.00417460  ;不妨先跳过
004176BA   |.  68 FCB54400        push RRPro.0044B5FC                     ;  ASCII "1ou6#uk&akietoe" 注意这个常数串
004176BF   |.  8D4C24 04          lea ecx,dword ptr ss:[esp+4]
004176C3   |.  C64424 20 02       mov byte ptr ss:[esp+20],2              ;esp+20=0012A6D4 ;注意和004176AD处的语句比较
004176C8   |.  E8 13A7FEFF        call RRPro.00401DE0                     ;F8不妨跳过再说
004176CD   |.  8D0C24             lea ecx,dword ptr ss:[esp]              ;ecx 0012A6B8

;D [ECX]
;00D2CDF8  31 6F 75 36 23 75 6B 26  1ou6#uk&
;00D2CE00  61 6B 69 65 74 6F 65 00  akietoe.


004176D0   |.  51                 push ecx
004176D1   |.  8D5424 10          lea edx,dword ptr ss:[esp+10]           ;EDX 0012A6C4

;D [EDX]
;00D2CDB8  30 30 32 36 35 34 30 44  0026540D  ==>这个字符串是什么?暂时不管,等会继续穷根追底
;00D2CDC0  45 45 32 36 00           EE26.     ==>见分析[追踪神秘字符串]

004176D5   |.  52                 push edx
004176D6   |.  8D4424 18          lea eax,dword ptr ss:[esp+18]          ;EAX 0012A6C8

;D [EAX]



004176DA   |.  50                 push eax
004176DB   |.  C64424 28 03       mov byte ptr ss:[esp+28],3             ;esp+28=0012A6D4 ;注意和前面两处比较,地址一样,代表一个变量
004176E0   |.  E8 9BFBFEFF        call RRPro.00407280                    ;F8不妨跳过再说
004176E5   |.  83C4 0C            add esp,0C
004176E8   |.  50                 push eax
004176E9   |.  8D4C24 04          lea ecx,dword ptr ss:[esp+4]           ;ecx 0012A6B8  注意004176CD处D [ECX]看到的内存中的常数串
004176ED   |.  C64424 20 04       mov byte ptr ss:[esp+20],4             ;esp+20=0012A6D4 注意和前面三处比较,还是那个变量
004176F2   |.  E8 89B3FEFF        call RRPro.00402A80                    ;F8不妨跳过再说
004176F7   |.  8B4424 10          mov eax,dword ptr ss:[esp+10]         
 ;注意观察寄存器 EAX 00D2CE30 ASCII "0026540DEE261ou6#uk&akietoe"
 ;推测前面的call的作用是连接两个字符串
004176FB   |.  83C0 F0            add eax,-10
004176FE   |.  C64424 1C 03       mov byte ptr ss:[esp+1C],3            ;esp+1C=0012A6D4 注意和前面四处比较,还是那个变量
00417703   |.  8D48 0C            lea ecx,dword ptr ds:[eax+C]
00417706   |.  83CA FF            or edx,FFFFFFFF
00417709   |.  F0:0FC111          lock xadd dword ptr ds:[ecx],edx      ;执行后edx=00000002
0041770D   |.  4A                 dec edx 
0041770E   |.  85D2               test edx,edx                         
00417710   |.  7F 08              jg short RRPro.0041771A              ;跳了
00417712   |.  8B08               mov ecx,dword ptr ds:[eax]
00417714   |.  8B11               mov edx,dword ptr ds:[ecx]
00417716   |.  50                 push eax
00417717   |.  FF52 04            call dword ptr ds:[edx+4]
跳到这里
0041771A   |>  53                 push ebx

;d [ebx]
;00D2CB70  43 4E 77 69 6E 6E 64 79  CNwinndy
;00D2CB78  00                       .

0041771B   |.  56                 push esi   ;d [ESI]   0012AF1C  30 A8 44 00         

0041771C   |.  57                 push edi

;D [EDI]
;00D2CBA8  31 32 33 34 35 36 37 38  12345678
;00D2CBB0  39 30 00                 90.



0041771D   |.  E8 C1170200        call RRPro.00438EE3     ;前面压入的参数都很敏感,这个call跟进去,只有两句

{
00438EE3   /$  B8 98F94500        mov eax,RRPro.0045F998                  ;  ASCII "戎D"
00438EE8   \.  C3                 retn
}

00417722   |.  8B10               mov edx,dword ptr ds:[eax]    ;EDX=0044D6C8
00417724   |.  8BC8               mov ecx,eax                   ;ECX=0045F998
00417726   |.  FF52 0C            call dword ptr ds:[edx+C];跟进去

{
00438F89    .  33D2               xor edx,edx
00438F8B    .  8D41 10            lea eax,dword ptr ds:[ecx+10]
00438F8E    .  42                 inc edx
00438F8F    .  F0:0FC110          lock xadd dword ptr ds:[eax],edx
00438F93    .  8D41 04            lea eax,dword ptr ds:[ecx+4]
00438F96    .  C3                 retn
}

00417729   |.  83C0 10            add eax,10                      ;EAX=0045F9AC
0041772C   |.  894424 14          mov dword ptr ss:[esp+14],eax   ;esp+14=0012A6C0
00417730   |.  8B4C24 0C          mov ecx,dword ptr ss:[esp+C]    ;ECX 00D2CE30 ASCII "0026540DEE261ou6#uk&akietoe"
00417734   |.  8D4424 10          lea eax,dword ptr ss:[esp+10]

D [EAX]
;00424EE6  8B 78 60 3B 3D 88 13 46  媥`;=?F  ===>
;00424EEE  00 74 07 E8 7D 3C 00 00  .t鑮<..

00417738   |.  50                 push eax
00417739   |.  51                 push ecx
0041773A   |.  C64424 30 05       mov byte ptr ss:[esp+30],5      ;esp+30=0012A6D4,注意004176FE处,还是那个变量
0041773F   |.  C74424 18 00000000 mov dword ptr ss:[esp+18],0     ;esp+18=0012A6BC
00417747   |.  E8 C4CAFEFF        call RRPro.00404210   ********************关键call,见[分析二]
0041774C   |.  8B5424 18          mov edx,dword ptr ss:[esp+18]   ; esp+18=0012A6BC  d: F2C30F84 
00417750   |.  52                 push edx
00417751   |.  8D4424 20          lea eax,dword ptr ss:[esp+20]   ;esp+20=0012A6C0
00417755   |.  68 787A4400        push RRPro.00447A78                     ;  ASCII "%lu"  ;这是无符号长整型
0041775A   |.  50                 push eax
0041775B   |.  E8 20A6FEFF        call RRPro.00401D80            ;不妨先跳过,

;注意观察寄存器
;EAX 00D2CDF8 ASCII "4072869764"   ===>这是上面的call处理的结果,猜不出结果就得跟进去看看
;ECX 00D2CDF8 ASCII "4072869764"   ===>还好,我看出来了,
;打开微软的计算器可以看到0xF2C30F84 =4072869764(Decimal),转换为字符串后这就是注册码了!!Surperize!


00417760   |.  8B7C24 48          mov edi,dword ptr ss:[esp+48]  ;EDI 00D2CBA8 ASCII "1234567890"
00417764   |.  8B7424 28          mov esi,dword ptr ss:[esp+28]  ;ESI 00D2CDF8 ASCII "4072869764"
00417768   |.  57                 push edi
00417769   |.  56                 push esi
0041776A   |.  E8 76D80000        call RRPro.00424FE5            ;这个call进行注册码校验,不妨在内存中将假码"1234567890"改为"4072869764"看看程序怎么跳

;这个call执行完后,eax=00000000,

0041776F   |.  8BD8               mov ebx,eax
00417771   |.  83C4 1C            add esp,1C
00417774   |.  F7DB               neg ebx
00417776   |.  1ADB               sbb bl,bl
00417778   |.  8D46 F0            lea eax,dword ptr ds:[esi-10]
0041777B   |.  FEC3               inc bl
0041777D   |.  C64424 28 03       mov byte ptr ss:[esp+28],3     ;esp+28=0012A6D4,还是那个变量
00417782   |.  8D48 0C            lea ecx,dword ptr ds:[eax+C]   ;ECX=00D2CDF4
00417785   |.  83CA FF            or edx,FFFFFFFF                ;置EDX=FFFFFFFF
00417788   |.  F0:0FC111          lock xadd dword ptr ds:[ecx],edx ;这一句执行后EDX=0001
0041778C   |.  4A                 dec edx
0041778D   |.  85D2               test edx,edx
0041778F   |.  7F 08              jg short RRPro.00417799
00417791   |.  8B08               mov ecx,dword ptr ds:[eax]    ;ECX=0045F998
00417793   |.  8B11               mov edx,dword ptr ds:[ecx]    ;EDX=0044D6C8
00417795   |.  50                 push eax                      ;EAX=00D2CDE8
00417796   |.  FF52 04            call dword ptr ds:[edx+4]     ;不妨先跳过
00417799   |>  8B4424 0C          mov eax,dword ptr ss:[esp+C]  ;EAX 00D2CE30 ASCII "0026540DEE261ou6#uk&akietoe"
0041779D   |.  83C0 F0            add eax,-10
004177A0   |.  C64424 28 02       mov byte ptr ss:[esp+28],2    ;esp+28=0012A6D4,还是那个变量
004177A5   |.  8D48 0C            lea ecx,dword ptr ds:[eax+C]  ;ECX=00D2CE2C
004177A8   |.  83CA FF            or edx,FFFFFFFF               ;置EDX=FFFFFFFF
004177AB   |.  F0:0FC111          lock xadd dword ptr ds:[ecx],edx;这一句执行后EDX=0001
004177AF   |.  4A                 dec edx
004177B0   |.  85D2               test edx,edx
004177B2   |.  7F 08              jg short RRPro.004177BC
004177B4   |.  8B08               mov ecx,dword ptr ds:[eax]    ;ECX=0045F998
004177B6   |.  8B11               mov edx,dword ptr ds:[ecx]    ;EDX=0044D6C8
004177B8   |.  50                 push eax                      ;EAX=00D2CE20
004177B9   |.  FF52 04            call dword ptr ds:[edx+4]     ;不妨先跳过
004177BC   |>  8B4424 18          mov eax,dword ptr ss:[esp+18] ;EAX 00D2CDB8 ASCII "0026540DEE26"
004177C0   |.  83C0 F0            add eax,-10
004177C3   |.  C64424 28 01       mov byte ptr ss:[esp+28],1    ;esp+28=0012A6D4,还是那个变量
004177C8   |.  8D48 0C            lea ecx,dword ptr ds:[eax+C]  ;ECX=00D2CDB4
004177CB   |.  83CA FF            or edx,FFFFFFFF
004177CE   |.  F0:0FC111          lock xadd dword ptr ds:[ecx],edx ;这一句执行后EDX=0001
004177D2   |.  4A                 dec edx
004177D3   |.  85D2               test edx,edx
004177D5   |.  7F 08              jg short RRPro.004177DF
004177D7   |.  8B08               mov ecx,dword ptr ds:[eax]    ;ECX=0045F998
004177D9   |.  8B11               mov edx,dword ptr ds:[ecx]    ;EDX=0044D6C8
004177DB   |.  50                 push eax                      ;EAX=00D2CDA8
004177DC   |.  FF52 04            call dword ptr ds:[edx+4]     ;不妨先跳过
004177DF   |>  8B4424 30          mov eax,dword ptr ss:[esp+30] ;EAX 00D2CB70 ASCII "CNwinndy"
004177E3   |.  83C0 F0            add eax,-10
004177E6   |.  C64424 28 00       mov byte ptr ss:[esp+28],0    ;esp+28=0012A6D4,还是那个变量
004177EB   |.  8D48 0C            lea ecx,dword ptr ds:[eax+C]  ;ECX=00D2CB6C
004177EE   |.  83CA FF            or edx,FFFFFFFF
004177F1   |.  F0:0FC111          lock xadd dword ptr ds:[ecx],edx ;这一句执行后EDX=0003
004177F5   |.  4A                 dec edx
004177F6   |.  85D2               test edx,edx
004177F8   |.  7F 08              jg short RRPro.00417802       ;这里跳了
004177FA   |.  8B08               mov ecx,dword ptr ds:[eax]
004177FC   |.  8B11               mov edx,dword ptr ds:[ecx]
004177FE   |.  50                 push eax
004177FF   |.  FF52 04            call dword ptr ds:[edx+4]
00417802   |>  8D47 F0            lea eax,dword ptr ds:[edi-10] ;EAX=00D2CB98
00417805   |.  C74424 28 FFFFFFFF mov dword ptr ss:[esp+28],-1  ;esp+28=0012A6D4,还是那个变量
0041780D   |.  8D48 0C            lea ecx,dword ptr ds:[eax+C]  ;ECX=00D2CBA4
00417810   |.  83CA FF            or edx,FFFFFFFF
00417813   |.  F0:0FC111          lock xadd dword ptr ds:[ecx],edx ;这一句执行后EDX=0002
00417817   |.  4A                 dec edx
00417818   |.  85D2               test edx,edx
0041781A   |.  7F 08              jg short RRPro.00417824       ;这里跳了
0041781C   |.  8B08               mov ecx,dword ptr ds:[eax]
0041781E   |.  8B11               mov edx,dword ptr ds:[ecx]
00417820   |.  50                 push eax
00417821   |.  FF52 04            call dword ptr ds:[edx+4]
00417824   |>  8B4C24 20          mov ecx,dword ptr ss:[esp+20]
00417828   |.  5F                 pop edi
00417829   |.  5E                 pop esi
0041782A   |.  8AC3               mov al,bl                     ;bl=01,设置标志
0041782C   |.  5B                 pop ebx
0041782D   |.  64:890D 00000000   mov dword ptr fs:[0],ecx
00417834   |.  83C4 20            add esp,20
00417837   \.  C2 0800            retn 8   ;返回到00410E81 ,见上面代码

###########################################################################################################################
[分析二]查找表格

00404210   /$  8B5424 08          mov edx,dword ptr ss:[esp+8]    ;edx=0012A6BC   D edx 00000000
00404214   |.  56                 push esi                        ;保存ESI
00404215   |.  8B7424 08          mov esi,dword ptr ss:[esp+8]    ;ESI 00D2CE30 ASCII "0026540DEE261ou6#uk&akietoe"
00404219   |.  C702 FFFFFFFF      mov dword ptr ds:[edx],-1       ;[edx]=FFFFFFFF,初值
0040421F   |.  8A0E               mov cl,byte ptr ds:[esi]
00404221   |.  84C9               test cl,cl
00404223   |.  74 26              je short RRPro.0040424B
00404225   |.  57                 push edi
00404226   |>  8B02               /mov eax,dword ptr ds:[edx]    ;[edx]=FFFFFFFF
00404228   |.  8BF8               |mov edi,eax                   ;edi=eax=FFFFFFFF
0040422A   |.  0FB6C9             |movzx ecx,cl                  ;
0040422D   |.  81E7 FF000000      |and edi,0FF
00404233   |.  33F9               |xor edi,ecx
00404235   |.  8B0CBD B8A04500    |mov ecx,dword ptr ds:[edi*4+45A0B8] ;E45A0B8是数组的起始地址,DI作index,由于每次取双字,故*4
0040423C   |.  C1E8 08            |shr eax,8
0040423F   |.  33C1               |xor eax,ecx
00404241   |.  46                 |inc esi                      ;取"0026540DEE261ou6#uk&akietoe"的下一个字符
00404242   |.  8902               |mov dword ptr ds:[edx],eax   ;将运算后的eax保存在地址edx中
00404244   |.  8A0E               |mov cl,byte ptr ds:[esi]
00404246   |.  84C9               |test cl,cl                   ;检验"0026540DEE261ou6#uk&akietoe"是否处理完
00404248   |.^ 75 DC              \jnz short RRPro.00404226
0040424A   |.  5F                 pop edi
0040424B   |>  8B02               mov eax,dword ptr ds:[edx]    ;取出经过27次运算后的值
0040424D   |.  F7D0               not eax
0040424F   |.  8902               mov dword ptr ds:[edx],eax    ;求反后再放到edx中去 ,我的机器最后eax=F2C30F84
00404251   |.  33C0               xor eax,eax
00404253   |.  5E                 pop esi
00404254   \.  C3                 retn    回到0041774C,见上面

##################################################################################################################################

分析[追踪神秘字符串]
          
那个神秘字符串到底是从哪里最先出来的呢?一步一步往上回溯。

我们在004176D1   |.  8D5424 10          lea edx,dword ptr ss:[esp+10]           ;EDX 0012A6C4

;D [EDX]
;00D2CDB8  30 30 32 36 35 34 30 44  0026540D  
;00D2CDC0  45 45 32 36 00           EE26.     
最先看到。

删除注册信息后,重新运行程序吧,用户名:CNwinndy,注册码:4072869764 
停留在开始处00410DB0    .  6A FF              push -1  

现在 D 00D2CDB8,
00D2CDB8  EE FE EE FE EE FE EE FE  铪铪铪铪
00D2CDC0  EE FE EE FE EE FE EE FE  铪铪铪铪

现在用F8往下走,看什么时候这里出现0026540DEE26。
00410E7C    .  E8 0F680000        call RRPro.00417690 ,这个时候F7进去

在004176B5   |.  E8 A6FDFFFF        call RRPro.00417460                     ; \RRPro.00417460
之后,发现内存变化了,
00D2CDB0  30 30 32 36 35 34 30 44  0026540D   ;这次的地址有变化
00D2CDB8  45 45 32 36 00 F0 AD BA  EE26.瓠
00D2CDC0  AB AB AB AB AB AB AB AB  
00D2CDC8  AB 00 00 00 00 00 00 00  ?......

再重新运行,在进入主程序后(启动时也会中断,这个时候不管,进去后再说),跟进00417460 看看去。

#########################################################################################################################################
00417460   /$  6A FF              push -1
00417462   |.  68 30524400        push RRPro.00445230                     ;  SE handler installation
00417467   |.  64:A1 00000000     mov eax,dword ptr fs:[0]
0041746D   |.  50                 push eax
0041746E   |.  64:8925 00000000   mov dword ptr fs:[0],esp
00417475   |.  83EC 14            sub esp,14
00417478   |.  53                 push ebx
00417479   |.  55                 push ebp
0041747A   |.  56                 push esi
0041747B   |.  33DB               xor ebx,ebx
0041747D   |.  57                 push edi
0041747E   |.  895C24 20          mov dword ptr ss:[esp+20],ebx
00417482   |.  E8 5C1A0200        call RRPro.00438EE3
00417487   |.  8B10               mov edx,dword ptr ds:[eax]
00417489   |.  8BC8               mov ecx,eax
0041748B   |.  FF52 0C            call dword ptr ds:[edx+C]
0041748E   |.  8D68 10            lea ebp,dword ptr ds:[eax+10]
00417491   |.  896C24 1C          mov dword ptr ss:[esp+1C],ebp
00417495   |.  53                 push ebx
00417496   |.  8D4424 18          lea eax,dword ptr ss:[esp+18]
0041749A   |.  50                 push eax
0041749B   |.  53                 push ebx
0041749C   |.  895C24 38          mov dword ptr ss:[esp+38],ebx
004174A0   |.  895C24 20          mov dword ptr ss:[esp+20],ebx
004174A4   |.  E8 C1320000        call <jmp.&iphlpapi.GetIfTable>   //***************这个call是干嘛的?

//查资料:iphlpapi.dll的文件,它包含了所有的IP相关操作,原来是得到有关IP信息的函数
//很自然,就猜想是否是IP地址或网卡物理地址


004174A9   |.  8B4C24 14          mov ecx,dword ptr ss:[esp+14]
004174AD   |.  51                 push ecx
004174AE   |.  E8 D0190200        call RRPro.00438E83
004174B3   |.  8B4C24 18          mov ecx,dword ptr ss:[esp+18]
004174B7   |.  8BD1               mov edx,ecx
004174B9   |.  8BF0               mov esi,eax
004174BB   |.  C1E9 02            shr ecx,2
004174BE   |.  33C0               xor eax,eax
004174C0   |.  8BFE               mov edi,esi
004174C2   |.  F3:AB              rep stos dword ptr es:[edi]
004174C4   |.  8BCA               mov ecx,edx
004174C6   |.  83C4 04            add esp,4
004174C9   |.  83E1 03            and ecx,3
004174CC   |.  F3:AA              rep stos byte ptr es:[edi]
004174CE   |.  8B4424 14          mov eax,dword ptr ss:[esp+14]
004174D2   |.  53                 push ebx
004174D3   |.  8D4C24 24          lea ecx,dword ptr ss:[esp+24]
004174D7   |.  51                 push ecx
004174D8   |.  56                 push esi
004174D9   |.  894424 2C          mov dword ptr ss:[esp+2C],eax
004174DD   |.  E8 88320000        call <jmp.&iphlpapi.GetIfTable> //***************
004174E2   |.  F7D8               neg eax
004174E4   |.  1AC0               sbb al,al
004174E6   |.  FEC0               inc al
004174E8   |.  884424 13          mov byte ptr ss:[esp+13],al
004174EC   |.  75 33              jnz short RRPro.00417521
004174EE   |.  56                 push esi
004174EF   |.  E8 94190200        call RRPro.00438E88
004174F4   |.  8B7424 38          mov esi,dword ptr ss:[esp+38]
004174F8   |.  83C4 04            add esp,4
004174FB   |.  68 ECB54400        push RRPro.0044B5EC                     ;  ASCII "000000000000"
00417500   |.  8BCE               mov ecx,esi
00417502   |.  E8 D9A8FEFF        call RRPro.00401DE0
00417507   |.  8D45 F0            lea eax,dword ptr ss:[ebp-10]
0041750A   |.  C74424 2C FFFFFFFF mov dword ptr ss:[esp+2C],-1
00417512   |.  8D50 0C            lea edx,dword ptr ds:[eax+C]
00417515   |.  83C9 FF            or ecx,FFFFFFFF
00417518   |.  F0:0FC10A          lock xadd dword ptr ds:[edx],ecx
0041751C   |.  49                 dec ecx
0041751D   |.  85C9               test ecx,ecx
0041751F   |.  EB 4F              jmp short RRPro.00417570
00417521   |>  8B0E               mov ecx,dword ptr ds:[esi]
00417523   |.  33C0               xor eax,eax
00417525   |.  3BCB               cmp ecx,ebx
00417527   |.  76 1F              jbe short RRPro.00417548
00417529   |.  81C6 08020000      add esi,208
0041752F   |.  BA 06000000        mov edx,6
00417534   |>  3956 0C            /cmp dword ptr ds:[esi+C],edx
00417537   |.  75 04              |jnz short RRPro.0041753D
00417539   |.  3916               |cmp dword ptr ds:[esi],edx
0041753B   |.  74 54              |je short RRPro.00417591
0041753D   |>  40                 |inc eax
0041753E   |.  81C6 5C030000      |add esi,35C
00417544   |.  3BC1               |cmp eax,ecx
00417546   |.^ 72 EC              \jb short RRPro.00417534
00417548   |>  8B7424 34          mov esi,dword ptr ss:[esp+34]
0041754C   |.  68 ECB54400        push RRPro.0044B5EC                     ;  ASCII "000000000000"
00417551   |.  8BCE               mov ecx,esi
00417553   |.  E8 88A8FEFF        call RRPro.00401DE0
00417558   |.  8D45 F0            lea eax,dword ptr ss:[ebp-10]
0041755B   |.  C74424 2C FFFFFFFF mov dword ptr ss:[esp+2C],-1
00417563   |.  8D48 0C            lea ecx,dword ptr ds:[eax+C]
00417566   |.  83CA FF            or edx,FFFFFFFF
00417569   |.  F0:0FC111          lock xadd dword ptr ds:[ecx],edx
0041756D   |.  4A                 dec edx
0041756E   |.  85D2               test edx,edx
00417570   |>  7F 08              jg short RRPro.0041757A
00417572   |.  8B08               mov ecx,dword ptr ds:[eax]
00417574   |.  50                 push eax
00417575   |>  8B11               mov edx,dword ptr ds:[ecx]
00417577   |.  FF52 04            call dword ptr ds:[edx+4]
0041757A   |>  8B4C24 24          mov ecx,dword ptr ss:[esp+24]
0041757E   |.  5F                 pop edi
0041757F   |.  8BC6               mov eax,esi
00417581   |.  5E                 pop esi
00417582   |.  5D                 pop ebp
00417583   |.  5B                 pop ebx
00417584   |.  64:890D 00000000   mov dword ptr fs:[0],ecx
0041758B   |.  83C4 20            add esp,20
0041758E   |.  C2 0400            retn 4
00417591   |>  E8 4D190200        call RRPro.00438EE3
00417596   |.  8B10               mov edx,dword ptr ds:[eax]
00417598   |.  8BC8               mov ecx,eax
0041759A   |.  FF52 0C            call dword ptr ds:[edx+C]
0041759D   |.  8D58 10            lea ebx,dword ptr ds:[eax+10]
004175A0   |.  895C24 18          mov dword ptr ss:[esp+18],ebx
004175A4   |.  8B46 0C            mov eax,dword ptr ds:[esi+C]
004175A7   |.  33FF               xor edi,edi
004175A9   |.  85C0               test eax,eax
004175AB   |.  C64424 2C 01       mov byte ptr ss:[esp+2C],1
004175B0   |.  76 36              jbe short RRPro.004175E8


004175B2   |>  0FB6443E 10        /movzx eax,byte ptr ds:[esi+edi+10]
004175B7   |.  50                 |push eax
004175B8   |.  8D4C24 1C          |lea ecx,dword ptr ss:[esp+1C]
004175BC   |.  68 E4B54400        |push RRPro.0044B5E4                    ;  ASCII "%02X"
004175C1   |.  51                 |push ecx
004175C2   |.  E8 B9A7FEFF        |call RRPro.00401D80
004175C7   |.  8B5C24 24          |mov ebx,dword ptr ss:[esp+24]
004175CB   |.  8B43 F4            |mov eax,dword ptr ds:[ebx-C]
004175CE   |.  83C4 0C            |add esp,0C
004175D1   |.  50                 |push eax
004175D2   |.  53                 |push ebx
004175D3   |.  8D4C24 24          |lea ecx,dword ptr ss:[esp+24]
004175D7   |.  E8 14B4FEFF        |call RRPro.004029F0
004175DC   |.  8B46 0C            |mov eax,dword ptr ds:[esi+C]
004175DF   |.  47                 |inc edi
004175E0   |.  3BF8               |cmp edi,eax
004175E2   |.^ 72 CE              \jb short RRPro.004175B2
004175E4   |.  8B6C24 1C          mov ebp,dword ptr ss:[esp+1C]
-------------------------------------------------------------------
;F8一直下来,d 00D2CDB0 一直没变化,但是突然发现内存窗口上面的面板有这样的提示:
Stack ss:[0012A69C]=00D2CD10, (ASCII "0026540DEE26")
ebp=0045F9AC (RRPro.0045F9AC)

堆栈里已经有了神秘字符串,看来00D2CDB0中的字符串也不是最先生成的,继续回溯。重新跟踪。 
F8下去,注意到上面的那个循环004175B2---004175E2 ,上一次是光标落在004175E4 ,F4,所以没有
看到细节,这一次F8下来,发现EAX 中每次出现两个字符串,先是"00",再是"26",HOOooooooo......
再看看ASCII "%02X",格式化字符,每次取两个十六进制字符,吻合!
继续看下一轮循环,call RRPro.00401D80后,
EAX 00D2CDA0 ASCII "54"
ECX 00D2CDA0 ASCII "54"
看来需要跟进去00401D80。

执行完call RRPro.004029F0后,EAX 00D2CDD0 ASCII "002654",看来这call是把两个一组的字符串连接起来。

00401D80   /$  8B4C24 08          mov ecx,dword ptr ss:[esp+8]            ;  RRPro.0044B5E4
00401D84   |.  8D4424 0C          lea eax,dword ptr ss:[esp+C]
00401D88   |.  50                 push eax
00401D89   |.  51                 push ecx
00401D8A   |.  8B4C24 0C          mov ecx,dword ptr ss:[esp+C]
00401D8E   |.  E8 BDFEFFFF        call RRPro.00401C50
00401D93   \.  C3                 retn

####################################################################################################
[输入注册码之后的重启过程]

F9 运行

中断在
00401FBF    .  68 E4784400        push RepairRe.004478E4                                    ;  ASCII "regcode"
00401FC4    .  8D4424 20          lea eax,dword ptr ss:[esp+20]
00401FC8    .  68 EC784400        push RepairRe.004478EC                                    ;  ASCII "Repair Registry Pro"
00401FCD    .  50                 push eax
00401FCE    .  E8 9D3E0100        call RepairRe.00415E70                                    ;不妨F8先跳过
00401FD3    .  68 8E784400        push RepairRe.0044788E
00401FD8    .  68 00794400        push RepairRe.00447900                                    ;  ASCII "username"
00401FDD    .  8D4C24 28          lea ecx,dword ptr ss:[esp+28]
00401FE1    .  68 EC784400        push RepairRe.004478EC                                    ;  ASCII "Repair Registry Pro"
00401FE6    .  51                 push ecx
00401FE7    .  C64424 4C 02       mov byte ptr ss:[esp+4C],2
00401FEC    .  E8 7F3E0100        call RepairRe.00415E70                                    ;不妨F8先跳过
00401FF1    .  83C4 20            add esp,20
00401FF4    .  8B4424 18          mov eax,dword ptr ss:[esp+18]                             ;EAX 00D24908 ASCII "4072869764"
00401FF8    .  8378 F4 15         cmp dword ptr ds:[eax-C],15                              
 ;[eax-c]=0000000A,这是"4072869764"的长度,长度不等于21就跳,但是注册码明明是10
 ;
00401FFC    .  B3 03              mov bl,3                                                  ;
00401FFE    .  885C24 2C          mov byte ptr ss:[esp+2C],bl
00402002    .  0F85 EC000000      jnz RepairRe.004020F4                                     ;跳了
00402008    .  8B5424 10          mov edx,dword ptr ss:[esp+10]
0040200C    .  8B4A F4            mov ecx,dword ptr ds:[edx-C]
0040200F    .  85C9               test ecx,ecx
00402011    .  0F8E DD000000      jle RepairRe.004020F4

跳到这:
004020F4    > \68 50794400        push RepairRe.00447950                                    
;  ASCII "RepairRegistry Pro is running under Trial version.To get the complete functionality of this application,
          buy or register
it by clicking on the Buy/Register Button"
004020F9    .  8D4C24 18          lea ecx,dword ptr ss:[esp+18]
004020FD    .  E8 DEFCFFFF        call RepairRe.00401DE0
00402102    .  C64424 2C 07       mov byte ptr ss:[esp+2C],7
00402107    >  8B06               mov eax,dword ptr ds:[esi]
00402109    .  8D4C24 14          lea ecx,dword ptr ss:[esp+14]

进去程序后可以发现,About画面显示有"RepairRegistry Pro is running under Trial version.To get the complete functionality of this application,
          buy or register
it by clicking on the Buy/Register Button"
但是"Buy/Register Button"却不存在了,程序的功能也可以全部使用。

cmp dword ptr ds:[eax-C],15  改为cmp dword ptr ds:[eax-C],0A
通过00401FF8 的比较以后,

00402027    .  83C0 10            add eax,10
0040202A    .  8907               mov dword ptr ds:[edi],eax
0040202C    .  8B4424 18          mov eax,dword ptr ss:[esp+18]
00402030    .  83C0 F0            add eax,-10
00402033    .  896424 28          mov dword ptr ss:[esp+28],esp
00402037    .  8BFC               mov edi,esp
00402039    .  50                 push eax
0040203A    .  C64424 38 04       mov byte ptr ss:[esp+38],4
0040203F    .  E8 CCF7FFFF        call RepairRe.00401810
00402044    .  83C0 10            add eax,10
00402047    .  83C4 04            add esp,4
0040204A    .  8907               mov dword ptr ds:[edi],eax                             ;EAX 00D24940 ASCII "CNwinndy"
0040204C    .  885C24 34          mov byte ptr ss:[esp+34],bl                            ;ESP+34=0012ADF0  bl=03
00402050    .  E8 BB380100        call RepairRe.00415910                                 ;跟进去,见后面[重启分析一]





00402055    .  83C4 08            add esp,8
00402058    .  84C0               test al,al                                              ;这里跳了,去清除注册信息
0040205A    .  74 58              je short RepairRe.004020B4                              ;这里不跳,则正确注册
0040205C    .  E8 826E0300        call RepairRe.00438EE3
00402061    .  8B10               mov edx,dword ptr ds:[eax]
00402063    .  8BC8               mov ecx,eax
00402065    .  FF52 0C            call dword ptr ds:[edx+C]
00402068    .  83C0 10            add eax,10
0040206B    .  894424 14          mov dword ptr ss:[esp+14],eax
0040206F    .  8B4424 10          mov eax,dword ptr ss:[esp+10]
00402073    .  50                 push eax
00402074    .  8D4C24 18          lea ecx,dword ptr ss:[esp+18]
00402078    .  68 287A4400        push RepairRe.00447A28                                    ;  ASCII "This version of Repair Registry is Licenced to %s."
0040207D    .  51                 push ecx
0040207E    .  C64424 38 05       mov byte ptr ss:[esp+38],5
00402083    .  E8 F8FCFFFF        call RepairRe.00401D80
00402088    .  8B16               mov edx,dword ptr ds:[esi]
0040208A    .  83C4 0C            add esp,0C
0040208D    .  8D4424 14          lea eax,dword ptr ss:[esp+14]
00402091    .  50                 push eax
00402092    .  8BCE               mov ecx,esi
00402094    .  FF92 40010000      call dword ptr ds:[edx+140]
0040209A    .  8B4424 14          mov eax,dword ptr ss:[esp+14]
0040209E    .  83C0 F0            add eax,-10
004020A1    .  885C24 2C          mov byte ptr ss:[esp+2C],bl
004020A5    .  8D48 0C            lea ecx,dword ptr ds:[eax+C]
004020A8    .  83CA FF            or edx,FFFFFFFF
004020AB    .  F0:0FC111          lock xadd dword ptr ds:[ecx],edx
004020AF    .  4A                 dec edx
004020B0    .  85D2               test edx,edx
004020B2    .  EB 7A              jmp short RepairRe.0040212E

004020B4    > \68 8E784400        push RepairRe.0044788E
004020B9    .  68 E4784400        push RepairRe.004478E4                                    ;  ASCII "regcode"
004020BE    .  68 EC784400        push RepairRe.004478EC                                    ;  ASCII "Repair Registry Pro"
004020C3    .  E8 B83C0100        call RepairRe.00415D80                                    ;这一句执行后,发现注册表的regcode被清除
004020C8    .  68 8E784400        push RepairRe.0044788E
004020CD    .  68 00794400        push RepairRe.00447900                                    ;  ASCII "username"
004020D2    .  68 EC784400        push RepairRe.004478EC                                    ;  ASCII "Repair Registry Pro"
004020D7    .  E8 A43C0100        call RepairRe.00415D80                                    ; ;这一句执行后,发现注册表的username被清除
004020DC    .  83C4 18            add esp,18
004020DF    .  68 F4794400        push RepairRe.004479F4                                    ;  ASCII "RepairRegistry Pro is running under Trial version."
004020E4    .  8D4C24 18          lea ecx,dword ptr ss:[esp+18]
004020E8    .  E8 F3FCFFFF        call RepairRe.00401DE0
004020ED    .  C64424 2C 06       mov byte ptr ss:[esp+2C],6
004020F2    .  EB 13              jmp short RepairRe.00402107

注册信息被清除后,进入后,就变成未注册的了
重启校验小结:输入注册码后,注册码长度为10,但是在重启校验的时候却要长度为21,
我们清楚地看到注册码只与MAC地址有关,但是重启校验的时候还要计算用户名和注册码的ascii码和,
然后还进行一段运算,得出三个值,最后再与用户名的第一个,第二个和最后一个字符比较,相符则校验成功。
疑是程序BUG,失误之处还往指出。
关于重启的分析,见附件的txt,加到这里,文件太大,篇幅太长了。加上疑是BUG,有兴趣的读者可以看附件。


#############################################################################################################################


【算法总结】注册码与用户名(但用户名不能为空)无关,由网卡物理地址字符串(长12),再连接常数串"1ou6#uk&akietoe"(长15),组成27位的字符串,
            然后设一个regcode初值FFFFFFFF,更觉字符串来查密码表,取相应的双字来和FFFFFFFF运算,得到最终的regcode后,再转化为无符号
            长整型,即为注册码。
            用VB6写了注册机,04.15写了框架,今天调试完毕。
【Greetings】  看雪论坛,FCG论坛,DFCG论坛等
               注册机源码中的MAC地址以及Flat Button控件是从网上下载而来,稍加修改,感谢原作者!

【完稿时间等】2005.04.28,凌晨1:31,天气:小雨,广州
              2005.04.28,11:58,重启校验分析