欢迎来到 嗅灵易学

零基础也能上手的脚本技术课,一对一答疑带你入门

SoftICE4.05 for win9x的安装序列号破解(1) (11千字)

SoftICE4.05 for win9x的安装序列号破解(1) (11千字)

SoftICE4.05 for win9x的安装序列号破解(1)
Passion
破解InstallShield安装序列号应该说有一套稍微“专门”的一点的方案,准备写出来和大家交流交流。一般对于5.5版本以下的InstallShield可以用专门的*.INS文件反编译器来分析其安装流程,这比起分析setup.exe来说似乎大多数情况下都能起到事半功倍的效果。(例外?当然有,这个就是。^_^)
对于Cracker来说,SoftICE4.05的序列号怕不少朋友都记住了。这里拿这个破解工具开刀有好几个原因:第一就是这个要跳过序列号检验很简单,但要寻出可用序列号来便有些难度,第二就是这个INSTALLSHIELD比较典型全面,既有普通的安装过程,又有大量的外部程序调用,能读懂它再读其他的应该也就没什么问题,第三便是由于皮大客的点将了。废话少说,先用ISDCC2反编译setup.ins再说:
isdcc2 setup.ins > sice405.txt
反编译出来的文档还不小,其中含有大量的外部DLL调用,如检测鼠标设置显卡等,要找出序列号判断的地方还真不容易。
打开sice405.txt,第一条路是查出错信息“The serial …… invalid ……”(不好意思,忘了,反正只查一两个单词),结果呢?没有!(事实上出错提示是在嵌入的外部动态链接库nminst32.dll中。)
第二条路,查字符串“MESSAGEBOX”,找倒是能找到一大片,可惜大多数明文的出错信息都不是我们要找的,有两三个类似于MessageBox(string2, -65534);等字样的,也弄不拎清这个string2到底在哪儿被赋值了,想来想去,也不容易成。
第三条路,从头细细看,看哪儿有突破口。这号反编译出来的东西,前边一点点是主程序,后边一大部分是各种各样的function实现部分,因此先看看程序体:(虽然相对来讲不多,可贴出来不少哇!)
    // ------------- MAIN PROGRAM CODE --------------
program
start:
00136E:0002:    Disable(12);
001375:0021:    number60 = 0;
00137F:0021:    number56 = 0;
001389:0021:    number59 = 0;
001393:0021:    number51 = 1;
00139D:0021:    number70 = 0;
0013A7:0021:    number49 = 0;
0013B1:00B5:    function109();
0013B9:00B5:    function107();
0013C1:00B5:    function108();            //估计是检验操作系统。
0013C9:0022:    if (number63 = 0) then
                    goto label2;
                endif;
      ……
     
//省略NT部分的一些处理过程。
//这里下面要装载一些DLL来进行安装,如果装载失败则出错。
label1:
001690:0125:    string22 = SUPPORTDIR ^ "NMINST32.dll";
0016A7:00B2:    UseDLL(string22);
0016AC:0021:    number71 = LAST_RESULT;
0016B4:0128:    number71 = number71 != 0;
0016C6:0022:    if (number71 = 0) then
                    goto label3;
                endif;
0016D4:002A:    MessageBox("Setup is unable to load the support DLLs needed to perform this SoftICE installation.", -65533);
001733:002B:    exit;
label2:
001739:0125:    string23 = SUPPORTDIR ^ "SINSETUP.dll";
001750:00B2:    UseDLL(string23);
    ………………… //省略部分代码
001826:002A:    MessageBox("Setup is unable to load the support DLLs needed to perform this SoftICE installation.", -65533);
001885:002B:    exit;
//以上是一些DLL的装载过程。下面正式开始安装过程。
//由于安装程序运行时,顺序是封面、协议、序列号,因此序列号检验怎么也不会太靠后。
label4:
00188B:0013:    string30 = "";
001893:0013:    string31 = "";
00189B:0021:    number64 = 0;
0018A5:0021:    number65 = 0;
0018AF:0021:    number66 = 0;
0018B9:0021:    number61 = 0;
0018C3:0021:    number68 = 4;
0018CD:0021:    number69 = 0;
0018D7:0021:    number67 = 4;
0018E1:00B5:    function140();                //注意这个Function
0018E9:0021:    number71 = LAST_RESULT;
0018F1:0128:    number71 = number71 = 1;
001903:0022:    if (number71 = 0) then
                    goto label6;
                endif;
001911:00B5:    function141();
label5:
00191D:0022:    if (0 = 0) then
                    goto label8;
                endif;
    
    ………… //省略部分代码
    
label7:
001990:0128:    number71 = number62 = 1;
0019A2:0022:    if (number71 = 0) then
                    goto label9;
                endif;
0019B0:0023:    StrCompare(string13, "");
0019B8:0128:    number71 = LAST_RESULT = 0;
0019CA:0022:    if (number71 = 0) then
                    goto label9;
                endif;
0019D8:002A:    MessageBox("Unable to verify Serial Number. \n This program will now exit!", -65533);
001A1F:0159:    abort;
//这里大概是要装入DLL文件来检验序列号。
//这下面的大概就没用了,省之。
label8:
001A25:00B5:    function99();
001A2D:0021:    number71 = LAST_RESULT;
001A35:0128:    number71 = number71 < 0;
001A47:0022:    if (number71 = 0) then
                    goto label10;
                endif;
001A55:002C:    goto label21;
    ………… //省略其他大部分安装代码。
    
001D43:00B3:    UnUseDLL(string22);
001D48:00B3:    UnUseDLL(string24);
001D4D:00B3:    UnUseDLL(string23);
001D52:0159:    abort;
label22:
001D58:002B:    exit;
endprogram
需要看看那个function140();的调用,下面是function140()的代码:
它完成的功能是检验注册表里是否有SICE的注册信息,如果有则读出来检验检验是否正确,如果正确则填到序列号输入框中免得再辛苦,这种体贴用户的做法可真不忍心来破哇!——但既然输入界面的检验过程难找,有这个检验过程也不错嘛!
    // ------------- FUNCTION function140 --------------
    function function140()
        number lNumber0;
        number lNumber1;
        number lNumber2;
        number lNumber3;
        number lNumber4;
        number lNumber5;
        number lNumber6;
        number lNumber7;
        string lString0;
        string lString1;
        string lString2;
        string lString3;
        string lString4;
    begin
label158:
005CB5:0110:        RegDBSetDefaultRoot(-2147483646);        //就是H_L_M
005CBC:0088:        RegDBKeyExist("\\Software\\NuMega\\SoftICE");
005CD9:0021:        lNumber6 = LAST_RESULT;
005CE1:0128:        lNumber6 = lNumber6 = 1;
005CF3:0022:        if (lNumber6 = 0) then
                        goto label160;
                    endif;
005D01:0013:        lString2 = "\\Software\\NuMega\\SoftICE";
005D21:002C:        goto label161;
005D2A:0013:        lString2 = "\\Software\\Nu-Mega\\SoftICE";
label160:
005D4F:0152:        RegDBGetKeyValueEx(lString2, "InstallDir", lNumber1, lString0, lNumber0);
005D6A:0021:        number50 = LAST_RESULT;
005D72:0128:        lNumber6 = number50 = 0;
005D84:0022:        if (lNumber6 = 0) then
                        goto label162;
                    endif;
005D92:0013:        string10 = lString0;
label161:
005D9E:0152:        RegDBGetKeyValueEx(lString2, "User", lNumber1, lString0, lNumber0);
005DB3:0021:        number50 = LAST_RESULT;
005DBB:0128:        lNumber6 = number50 = 0;
005DCD:0022:        if (lNumber6 = 0) then
                        goto label163;
                    endif;
005DDB:0013:        string11 = lString0;
label162:
005DE7:0152:        RegDBGetKeyValueEx(lString2, "Company", lNumber1, lString0, lNumber0);
005DFF:0021:        number50 = LAST_RESULT;
005E07:0128:        lNumber6 = number50 = 0;
005E19:0022:        if (lNumber6 = 0) then
                        goto label164;
                    endif;
005E27:0013:        string12 = lString0;
label163:
005E33:0128:        lNumber6 = number62 = 1;
005E45:0022:        if (lNumber6 = 0) then
                        goto label166;
                    endif;
005E53:0021:        lNumber5 = 0;
005E5D:0013:        TARGETDIR = string10;
005E65:0125:        lString4 = TARGETDIR ^ "\\nmtrans.dll";
005E7C:007C:        GetFileInfo(lString4, 4, lNumber3, lString3);
005E8C:0125:        lString4 = TARGETDIR ^ "\\loader32.exe";
005EA4:007C:        GetFileInfo(lString4, 4, lNumber4, lString3);
005EB4:0128:        lNumber6 = lNumber3 = 0x8bc00;
005EC6:0128:        lNumber7 = lNumber4 = 0x1c4fec;
005ED8:0127:        lNumber6 = lNumber6 && lNumber7;
005EE3:0022:        if (lNumber6 = 0) then
                        goto label165;
                    endif;
005EF1:0021:        lNumber5 = 1;
label164:
005EFF:0128:        lNumber6 = lNumber5 = 0;
005F11:0022:        if (lNumber6 = 0) then
                        goto label166;
                    endif;
005F1F:002A:        MessageBox("Setup could not locate the correct version of \n SoftIce to update and thus will exit!", -65533);
005F7E:0159:        abort;
//上面从注册表里读安装路径、用户名、公司信息、版本号等。
label165:
005F84:0152:        RegDBGetKeyValueEx(lString2, "Serial", lNumber1, lString0, lNumber0);
005F9B:0021:        number50 = LAST_RESULT;
005FA3:00B5:        function143(lString0);    //读出序列号后的这个Function重要!
005FAE:0021:        lNumber6 = LAST_RESULT;
005FB6:0128:        lNumber6 = lNumber6 = 1;
005FC8:0022:        if (lNumber6 = 0) then
                        goto label167;
                    endif;
005FD6:0013:        string13 = lString0;
005FDE:012F:        return(1);
005FE7:002C:        goto label168;
label166:
005FF0:012F:        return(0);
label167:
005FFD:012F:        return(0);
006006:00B8:        return;
一层层跟下去,看function143的代码,很好,不太长:
    // ------------- FUNCTION function143 --------------
    function function143(pString0)
        number lNumber0;
        number lNumber1;
        string lString0;
        string lString1;
        string lString2;
        string lString3;
        string lString4;
        string lString5;
        string lString6;
    begin
//sice的序列号形如xxxx-xxxxxx-xx,保存在注册表里的也是这个格式。
label190:
0067BE:002F:        StrLength(pString0);
0067C3:0021:        lNumber1 = LAST_RESULT;
0067CB:0128:        lNumber1 = lNumber1 != 14;
0067DD:0022:        if (lNumber1 = 0) then
                        goto label192;
                    endif;
0067EB:012F:        return(0);
//这里我怀疑有编译错误,应该是如果序列号长14则序次执行到这里,否则返回0。
0067F8:0030:        StrSub(lString1, pString0, 0, 4);
00680A:0030:        StrSub(lString2, pString0, 5, 6);
00681C:0030:        StrSub(lString3, pString0, 12, 2);
//从注册表里的序列号中取除“-”号外的子串。
00682E:0124:        lString6 = lString1 + lString2;
006839:0124:        lString0 = lString6 + lString3;
//再拼起来,也就是相当于序列号去掉“-”号。
//下面仍旧怀疑有误。
006844:0031:        StrFind(lString0, "-");
00684D:0128:        lNumber1 = LAST_RESULT >= 0;
00685F:0022:        if (lNumber1 = 0) then
                        goto label193;
                    endif;
00686D:012F:        return(0);
label192:
00687A:0125:        lString5 = SUPPORTDIR ^ "UTILITY.dll";
006890:00B2:        UseDLL(lString5);
//装载utility.dll来准备进行进一步的序列号检验。
006895:0021:        lNumber1 = LAST_RESULT;
00689D:0128:        lNumber1 = lNumber1 = 0;
0068AF:0022:        if (lNumber1 = 0) then
                        goto label194;
                    endif;
0068BD:00B4:        UTILITY.DigitCheck(lString0);    //这一步是关键检验过程。
0068C5:0021:        lNumber0 = LAST_RESULT;
0068CD:00B3:        UnUseDLL(lString5);
label193:
0068D6:0128:        lNumber1 = lNumber0 = 1;
0068E8:0022:        if (lNumber1 = 0) then
                        goto label195;
                    endif;
0068F6:012F:        return(1);            //序列号正确则返回1。
0068FF:002C:        goto label196;
label194:
006908:012F:        return(0);
label195:
006915:00B8:        return;
    end;
这段说明,SOFTICE安装时会读取注册表中的序列号信息(如果有的话)并且进行判断,这一段的机制与效果和检验输入的序列号是否正确是一样的。
现在就UTILITY.DigitCheck(lString0);是关键了,参数是去掉了“-”号的序列号。
SOFTICE安装程序运行时会在windows/temp目录下生成一些临时的目录和文件,其中就包括刚才提到的
utility.dll,下面是其DigitCheck的输出代码。
跟踪过程也不算太复杂,先填序列号,我填的是5100-0099BB-BB,下断bpx loadlibrarya do "d esp->8"看载入的DLL文件名,等按“Next”按钮的时候便会装入UTILITY.DLL,因此断在系统领空,返回后看看MOD UTILITY,我机子上的BASE是1BC0000,因此下面的地址都有一步重定位的变换,为了简明起见,我使用1000000做基址,这与W32DASM的反汇编代码相符合。
digitcheck的入口是1110,因此下断bpx 0167:1bc1110,断后便开始了漫长的跟踪过程。(见下篇)

注意:上传附件及图片大小不得大于30M。

⚠️ 版权声明:
本博客所有内容(含教程、源码、工具)仅供个人技术学习与研究交流使用,严禁商用、倒卖、二次分发及非法用途
未经作者书面授权,任何组织或个人不得转载、复制或用于其他平台,违者将追究相关责任。

0 0 0 举报
复制成功