【软件介绍】:国产软件,  简体中文
【软件下载】:http://www.softreg.com.cn/shareware_view.asp?id=/271C44A8-F879-441E-9A56-B866FC86BDDF/
【保护方式】:注册码 + 功能限制
【破解工具】:Win2000, PEiD, Ollydbg,W32dasm
【破解目的】:研究算法分析,没有其它目的!
【作者申明】:感谢skyege的帮助。
【破解过程】:
           用peid查看,是upx的壳,先将它脱掉
方法一:  暴破法
              用W32查看字符串,有“注册不正确,无法注册”的提示和“感谢你注册全球通高清晰数字网络电视机!”的字样,点击“注册

不正确”字符,来到:
:004B6548 53                      push ebx
:004B6549 8BD8                    mov ebx, eax
:004B654B 8BC3                    mov eax, ebx
:004B654D E87A1AFFFF              call 004A7FCC           关键call
:004B6552 84C0                    test al, al
:004B6554 7409                    je 004B655F            ’关键转跳
:004B6556 8BC3                    mov eax, ebx
:004B6558 E8BB17FFFF              call 004A7D18
:004B655D 5B                      pop ebx
:004B655E C3                      ret



* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:004B6554(C)
|
:004B655F 6A20                    push 00000020

* Possible StringData Ref from Code Obj ->"信息提示"
                                  |
:004B6561 B97C654B00              mov ecx, 004B657C

* Possible StringData Ref from Code Obj ->"注册码不正确,无法注册"   <==这里
                                  |
:004B6566 BA88654B00              mov edx, 004B6588
:004B656B A160014C00              mov eax, dword ptr [004C0160]
向上看到004B6554的转跳,猜这儿是关键转跳了!如果你还不能确认004B6554是不是关键的转跳,你可以跟进004B6558的call看看,会看到“

感谢你注册XXX”的字样,这下放心了,一定是关键转跳了,二话不说,将je改为jne便可以了!

方法二:    注册表跟踪
             用w32看到输入函数里面有RegOpenKeyExA和RegQueryValueExA函数,用OD载入,将两个函数下断,将跟踪到要找开

HKEY_USERS\.DEFAULT\Software\nettv\Demo时,如果自已没有,新建一个,F9一下,这时RegQueryValueExA会去查没有没Name这个值,没有就

建一个吧(其值的类型可以由RegQueryValueExA的参数来确定,这里随便什么类型都可以),再F9,RegQueryValueExA会去查值 为Pass的值存

在不,没有关系,新建一个,类型不限,再F9,发现自己已经注册了,这么简单就搞定了!!再点出上面的钻石版栏目激活,VIP栏目激活,一

看,所以灰色的菜单全都可以用了!
 在方法三中我们可以知道这两上值到底是什么类型(分别为reg_sz和reg_dword,两个都没有具体的值)
方法三:  跟踪算法(这个其实也很Easy)由第一得到004B654D的关键call(这是个Borland Delphi 4.0 - 5.0写的,用dede也可以的)
F7跟进到此:
004A800D      |.  BE 01000000     mov esi,1
004A8012      |>  8D45 F0         /lea eax,dword ptr ss:[ebp-10]
004A8015      |.  50              |push eax
004A8016      |.  B9 01000000     |mov ecx,1
004A801B      |.  8BD6            |mov edx,esi
004A801D      |.  8B45 F8          |mov eax,dword ptr ss:[ebp-8]
004A8020      |.  E8 DBC0F5FF      |call unpackun.00404100
004A8025      |.  8B45 F0         |mov eax,dword ptr ss:[ebp-10]
004A8028      |.  E8 8FC0F5FF     call unpackun.004040BC
004A802D      |.  8A00            |mov al,byte ptr ds:[eax]       ‘开始运算机器码
004A802F      |.  25 FF000000     and eax,0FF                      取al
004A8034      |.  0145 F4          |add dword ptr ss:[ebp-C],eax     将al的ascii码相加
004A8037      |.  46                          |inc esi                         
004A8038      |.  4B                          |dec ebx                          计数器减一
004A8039      |.^ 75 D7                       \jnz short unpackun.004A8012
004A803B      |>  8D55 EC                     lea edx,dword ptr ss:[ebp-14]
004A803E      |.  8B45 FC                     mov eax,dword ptr ss:[ebp-4]
004A8041      |.  8B80 D8090000               mov eax,dword ptr ds:[eax+9D8]
004A8047      |.  E8 4C18F8FF                 call unpackun.00429898
004A804C      |.  8B45 EC                     mov eax,dword ptr ss:[ebp-14]
004A804F      |.  E8 F80EF6FF                 call unpackun.00408F4C
   {
00408F4C      /$  53                          push ebx
00408F4D      |.  56                          push esi
00408F4E      |.  83C4 F4                     add esp,-0C
00408F51      |.  8BD8                        mov ebx,eax
00408F53      |.  8BD4                        mov edx,esp
00408F55      |.  8BC3                        mov eax,ebx
00408F57      |.  E8 4C9DFFFF                 call unpackun.00402CA8
                          {
00402CA8      /$  53                          push ebx
00402CA9      |.  56                          push esi
00402CAA      |.  57                          push edi
00402CAB      |.  89C6                        mov esi,eax
00402CAD      |.  50                          push eax
00402CAE      |.  85C0                        test eax,eax
00402CB0      |.  74 73                       je short unpackun.00402D25
00402CB2      |.  31C0                        xor eax,eax
00402CB4      |.  31DB                        xor ebx,ebx
00402CB6      |.  BF CCCCCC0C                 mov edi,0CCCCCCC
00402CBB      |> /8A1E                        /mov bl,byte ptr ds:[esi]
00402CBD      |. |46                          |inc esi
00402CBE      |. |80FB 20                     |cmp bl,20     ;空格
00402CC1      |.^\74 F8                       \je short unpackun.00402CBB
00402CC3      |.  B5 00                       mov ch,0        ch=0
00402CC5      |.  80FB 2D                     cmp bl,2D        ; ASCII"-"表示负数
00402CC8      |.  74 69                       je short unpackun.00402D33
00402CCA      |.  80FB 2B                     cmp bl,2B             " +"  表正数
00402CCD      |.  74 66                       je short unpackun.00402D35
00402CCF      |.  80FB 24                     cmp bl,24         "$" 输入的为十六进制
00402CD2      |.  74 66                       je short unpackun.00402D3A
00402CD4      |.  80FB 78                     cmp bl,78           "x"  输入的为十六进制
00402CD7      |.  74 61                       je short unpackun.00402D3A
00402CD9      |.  80FB 58                     cmp bl,58       "X"  输入的为十六进制
00402CDC      |.  74 5C                       je short unpackun.00402D3A
00402CDE      |.  80FB 30                     cmp bl,30         "0"  首字为0就忽略
00402CE1      |.  75 13                       jnz short unpackun.00402CF6
00402CE3      |.  8A1E                        mov bl,byte ptr ds:[esi]             
00402CE5      |.  46                          inc esi
00402CE6      |.  80FB 78                     cmp bl,78
00402CE9      |.  74 4F                       je short unpackun.00402D3A
00402CEB      |.  80FB 58                     cmp bl,58
00402CEE      |.  74 4A                       je short unpackun.00402D3A
00402CF0      |.  84DB                        test bl,bl
00402CF2      |.  74 20                       je short unpackun.00402D14
00402CF4      |.  EB 04                       jmp short unpackun.00402CFA
00402CF6      |>  84DB                        test bl,bl                                
00402CF8      |.  74 34                       je short unpackun.00402D2E             
00402CFA      |>  80EB 30                     /sub bl,30   输入的字符为 0~9之间即为十进制
00402CFD      |.  80FB 09                     |cmp bl,9
00402D00      |.  77 2C                       |ja short unpackun.00402D2E  这个是将输入的十进制转为十六进制
00402D02      |.  39F8                        |cmp eax,edi
00402D04      |.  77 28                       |ja short unpackun.00402D2E
00402D06      |.  8D0480                      |lea eax,dword ptr ds:[eax+eax*4]
00402D09      |.  01C0                        |add eax,eax
00402D0B      |.  01D8                        |add eax,ebx
00402D0D      |.  8A1E                        |mov bl,byte ptr ds:[esi]
00402D0F      |.  46                          |inc esi
00402D10      |.  84DB                        |test bl,bl
00402D12      |.^ 75 E6                       \jnz short unpackun.00402CFA            
00402D14      |>  FECD                        dec ch         ch=ch-1            
00402D16      |.  74 10                       je short unpackun.00402D28   如果ch本来为1(即前面有一个负号)则跳
00402D18      |.  85C0                        test eax,eax                             
00402D1A      |.  7C 12                       jl short unpackun.00402D2E
00402D1C      |>  59                          pop ecx
00402D1D      |.  31F6                        xor esi,esi
00402D1F      |>  8932                        mov dword ptr ds:[edx],esi
00402D21      |.  5F                          pop edi
00402D22      |.  5E                          pop esi
00402D23      |.  5B                          pop ebx
00402D24      |.  C3                          retn
00402D25      |>  46                          inc esi
00402D26      |.  EB 06                       jmp short unpackun.00402D2E
00402D28      |>  F7D8                        neg eax     取负
00402D2A      |.^ 7E F0                       jle short unpackun.00402D1C
00402D2C      |.^ 78 EE                       js short unpackun.00402D1C
00402D2E      |>  5B                          pop ebx                                   
00402D2F      |.  29DE                        sub esi,ebx
00402D31      |.^ EB EC                       jmp short unpackun.00402D1F   ch为记数器,如果为1表示前面有负号
00402D33         FEC5                          inc ch   ‘前面为负号
00402D35      |>  8A1E                        mov bl,byte ptr ds:[esi]  “+”忽略掉  
00402D37      |.  46                          inc esi   继续下一个操作
00402D38      |.^ EB BC                       jmp short unpackun.00402CF6
00402D3A      |>  BF FFFFFF0F                 mov edi,0FFFFFFF     ;         Cases '$','X', x  即表示十六进制
00402D3F      |.  8A1E                        mov bl,byte ptr ds:[esi]  开始操作
00402D41      |.  46                          inc esi
00402D42      |.  84DB                        test bl,bl
00402D44      |.^ 74 DF                       je short unpackun.00402D25   是否结束
00402D46      |>  80FB 61                     /cmp bl,61                               
00402D49      |.  72 03                       |jb short unpackun.00402D4E   <'a'就跳,即表示大写字母或者数字便跳
00402D4B      |.  80EB 20                     |sub bl,20     小写变大写
00402D4E      |>  80EB 30                     |sub bl,30     减去30h     
00402D51      |.  80FB 09                     |cmp bl,9    看是不是数字
00402D54      |.  76 0B                       |jbe short unpackun.00402D61      如果为数字就跳
00402D56      |.  80EB 11                     |sub bl,11    为字母A->0,B->1,C->2,D->3....
00402D59      |.  80FB 05                     |cmp bl,5                          
00402D5C      |.^ 77 D0                       |ja short unpackun.00402D2E  有没有超过F,超过就无效
00402D5E      |.  80C3 0A                     |add bl,0A   再加上A,这样字母就变成十六进制数字了                           
00402D61      |>  39F8                        |cmp eax,edi   有没有超过                             
00402D63      |.^ 77 C9                       |ja short unpackun.00402D2E
00402D65      |.  C1E0 04                     |shl eax,4         eax=eax*16
00402D68      |.  01D8                        |add eax,ebx       eax=eax+ebx 十六进制转换结果在eax中
00402D6A      |.  8A1E                        |mov bl,byte ptr ds:[esi]   继续取字符来计算
00402D6C      |.  46                          |inc esi
00402D6D      |.  84DB                        |test bl,bl
00402D6F      |.^ 75 D5                       \jnz short unpackun.00402D46  
00402D71      \.^ EB A9                       jmp short unpackun.00402D1C
00402D73       .  C3                          retn


                               }
00408F5C      |.  8BF0                        mov esi,eax
00408F5E      |.  833C24 00                   cmp dword ptr ss:[esp],0
00408F62      |.  74 19                       je short unpackun.00408F7D
00408F64      |.  895C24 04                   mov dword ptr ss:[esp+4],ebx
00408F68      |.  C64424 08 0B                mov byte ptr ss:[esp+8],0B
00408F6D      |.  8D5424 04                   lea edx,dword ptr ss:[esp+4]
00408F71      |.  A1 DCFF4B00                 mov eax,dword ptr ds:[4BFFDC]
00408F76      |.  33C9                        xor ecx,ecx
00408F78      |.  E8 FBFBFFFF                 call unpackun.00408B78
00408F7D      |>  8BC6                        mov eax,esi
00408F7F      |.  83C4 0C                     add esp,0C
00408F82      |.  5E                          pop esi
00408F83      |.  5B                          pop ebx
00408F84      \.  C3                          retn
                                      }
004A8054      |.  8B55 F4                     mov edx,dword ptr ss:[ebp-C]
004A8057      |.  81C2 ADE51F08               add edx,81FE5AD       ;   
004A805D      |.  81C2 26B84D08               add edx,84DB826       ;edx=edx+106D9DD3    edx为所有机器码的ASCII之和
004A8063      |.  3BC2                        cmp eax,edx                  关键的比较地方
004A8065      |.  75 19                       jnz short unpackun.004A8080 
004A8067      |.  B3 01                       mov bl,1                     如果相等则bl=1
004A8069      |.  B8 C0194C00                 mov eax,unpackun.004C19C0
004A806E      |.  8B55 F8                     mov edx,dword ptr ss:[ebp-8]
004A8071      |.  E8 56BCF5FF                 call unpackun.00403CCC
004A8076      |.  8B45 F4                     mov eax,dword ptr ss:[ebp-C]
004A8079      |.  A3 C4194C00                 mov dword ptr ds:[4C19C4],eax
004A807E      |.  EB 02                       jmp short unpackun.004A8082
004A8080      |>  33DB                        xor ebx,ebx                  跳到此处bl=0
004A8082      |>  33C0                        xor eax,eax
004A8084      |.  5A                          pop edx
004A8085      |.  59                          pop ecx
004A8086      |.  59                          pop ecx
004A8087      |.  64:8910                     mov dword ptr fs:[eax],edx
004A808A      |.  68 AF804A00                 push unpackun.004A80AF
004A808F      |>  8D45 EC                     lea eax,dword ptr ss:[ebp-14]
004A8092      |.  E8 E1BBF5FF                 call unpackun.00403C78
004A8097      |.  8D45 F0                     lea eax,dword ptr ss:[ebp-10]
004A809A      |.  E8 D9BBF5FF                 call unpackun.00403C78
004A809F      |.  8D45 F8                     lea eax,dword ptr ss:[ebp-8]
004A80A2      |.  E8 D1BBF5FF                 call unpackun.00403C78
004A80A7      \.  C3                          retn


后记:软件先将你的机器码的所有ASCII码相加(包括“-”),再同81FE5AD相加,再与84DB826相加后的结果与我们输入的注册码相比(如果前面加了$,X,x表示十六进制)相等al=1,不相等al=0