📄 chap7-4.htm.primary
字号:
<font face="宋体" color="#000000">设断<br>
</font></span><span class="p9"><font face="Times New Roman" color="#000000">1) bpx rtcinputbox, </font>
<font face="宋体" color="#000000">有用</font> <font face="Times New Roman" color="#000000">!</font>
</span> <br>
<span class="p9"><font face="Times New Roman" color="#000000">:0040208E CALL [MSVBVM60!rtcInputBox] ;</font>
<font face="宋体" color="#000000">显示对话框</font> <br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:00402094 LEA EDX,[EBP-00A8]</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:0040209A LEA ECX,[EBP-24]</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:0040209D MOV [EBP-00A0], EAX ;d EAX:</font>
<font face="宋体" color="#000000">我的序列号</font> <font face="Times New Roman" color="#000000">(wide chars)</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:004020A3 MOV DWORD PTR [EBP-00A8],00000008 ;</font>
<font face="宋体" color="#000000">设置变量</font> <font face="Times New Roman" color="#000000"> ?</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">2) </font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:004020E0 LEA ECX,[EBP-24] </font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:004020E3 LEA EDX,[EBP-00B8] </font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:004020E9 mov dword ptr [ebp+FFFFFF50], 00401C50 (*);</font>
<font face="宋体" color="#000000">放正确序列号地址于</font><font face="Times New Roman" color="#000000">;[EDX+8]</font>
<font face="宋体" color="#000000">处</font> <br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:004020F3 push ecx</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:004020F4 push edx</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:004020F5 mov dword ptr [ebp+FFFFFF48], 00008008</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:004020FF Call dword ptr [MSVBVM60.__vbaVarTstEq] ;</font>
<font face="宋体" color="#000000">变量比较</font> <font face="Times New Roman" color="#000000"> (</font>
<font face="宋体" color="#000000">非常重要的BPX</font><font face="Times New Roman" color="#000000">)</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:00402105 test ax, ax ;jmp = </font>
<font face="宋体" color="#000000">错误的序列号</font> <br>
</span><span class="p9"><font face="Times New Roman" color="#000000">:00402108 je 004021B4</font>
</span> <br>
<span class="p9"><font face="宋体" color="#000000">一旦你跟踪到时这段代码</font>
<font face="Times New Roman" color="#000000">:004020E9</font> <font face="宋体" color="#000000">处,看看</font>
<font face="Times New Roman" color="#000000">401C50</font> <font face="宋体" color="#000000">、</font>
<font face="Times New Roman" color="#000000">ecx</font> <font face="宋体" color="#000000">和</font>
<font face="Times New Roman" color="#000000">edx</font> </span> <br>
<span class="p9"><font face="宋体" color="#0000FF">注意:此时你如检测</font> <font face="Times New Roman" color="#0000FF">ecx/edx</font>
<font face="宋体" color="#0000FF">你什么将看不到,这是因为</font> <font face="Times New Roman" color="#0000FF">VB</font>
<font face="宋体" color="#0000FF">用了一些特殊的地址方式,牢记此时用</font> <font face="Times New Roman" color="#0000FF">ecx+8 </font>
<font face="宋体" color="#0000FF">和</font> <font face="Times New Roman" color="#0000FF"> edx+8</font>
<font face="宋体" color="#0000FF">查看内存。你将发现你输入的序列号和正确的序列号的偏移地址。</font>
<br>
</span><span class="p9"><font face="宋体" color="#000000">会发现</font> <font face="Times New Roman" color="#000000">ecx+8,</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">bc 02 41 00.. .. .. D 4102bc </font>
<font face="宋体" color="#000000">你输入的序列号</font> <br>
</span><span class="p9"><font face="Times New Roman" color="#000000">edx+8</font>
<font face="宋体" color="#000000">为:</font> <br>
</span><span class="p9"><font face="Times New Roman" color="#000000">50 1C 40 00.. .. .. d 401c50 </font>
<font face="宋体" color="#000000">正确序列号</font> <br>
</span><span class="p9"><font face="宋体" color="#000000">我们真实序列号为</font>
<font face="Times New Roman" color="#000000">: 3484</font></span>
</p>
<p> </p>
</td>
</tr>
</table>
</div>
<div id="KB5Parent" class="parent">
<p><b><span class="p9">习题五</span></b><span class="p9"><a href="Exercise/chap7-05.zip">chap7-05</a>
Code保护;难度:易</span> </p>
<p><a href="#" onClick="expandIt('KB5'); return false" class="p9"><b>习题五</b>
我要看答案</a> </p>
</div>
<div id="KB5Child" class="child">
<table width="100%" align="center" cellspacing="0">
<tr bgcolor="#EFEFEF">
<td height="194">
<p> <font face="宋体" color="#000000"><span class="p9"><span class="p9">这是</span></span></font>
<span class="p9"><span class="p9"><font face="Times New Roman" color="#000000">VB6</font>
<font face="宋体" color="#000000">程序</font> <br>
<font face="宋体" color="#000000">一、用</font> <font face="Times New Roman" color="#000000" class="p9">SOFTICE</font>
</span></span><span class="p9"><br>
</span><span class="p9"><font face="宋体" color="#000000">如此设断:</font>
<font face="Times New Roman" color="#000000">bpx MSVBVM60!__vbastrcomp ( </font>
<font face="宋体" color="#000000">记住在</font> <font face="Times New Roman" color="#000000">VB6</font>
<font face="宋体" color="#000000">前要加</font> <font face="Times New Roman" color="#000000">MSVBVM60! )</font>
<br>
</span><span class="p9"><font face="宋体" color="#000000">在第一个</font>
<font face="Times New Roman" color="#000000">Call [6610EE58]</font>
<br>
</span><span class="p9"><font face="宋体" color="#000000">直到跟踪</font>
<font face="Times New Roman" color="#000000"> Test ecx,ecx</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000"> Then do D ecx --> 3.Q.r.5.3.p.X...</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000"> ....R.E.G.I.S.T.</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000"> R.E.D....N.3.f..</font>
<br>
</span><span class="p9"><font face="宋体" color="#000000">注册码</font> <font face="Times New Roman" color="#000000">: 3Qr53pX</font>
</span><br>
<span class="p9"><font face="宋体" color="#000000">二、用</font> <font face="Times New Roman" color="#000000">SmartCheck</font>
<br>
</span><span class="p9"><font face="宋体" color="#000000">展开</font> <font face="Times New Roman" color="#000000">cmdReg_Click </font>
<br>
</span><span class="p9"><font face="宋体" color="#000000">下</font> <font face="Times New Roman" color="#000000">"Show All Events" </font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">__vbaStrCmp(String"3Qr53pX", String"1133557799.."......) </font>
</span><span class="p9"> </span> </p>
</td>
</tr>
</table>
<p> </p>
</div>
<div id="KB6Parent" class="parent">
<p><b><span class="p9">习题六</span></b><span class="p9"><a href="Exercise/chap7-06.zip">chap7-06</a>
Code保护;难度:中</span></p>
<p><a href="#" onClick="expandIt('KB6'); return false" class="p9"> <b>习题六</b>
我要看答案</a> </p>
</div>
<div id="KB6Child" class="child">
<table width="100%" align="center" cellspacing="0">
<tr bgcolor="#EFEFEF">
<td height="28">
<p> <font face="宋体" color="#000000"><span class="p9">程序</span></font>
<span class="p9"><font face="Times New Roman" color="#000000">: Visual Basic 6</font>
<br>
</span><span class="p9"><font face="宋体" color="#000000">工具</font> <font face="Times New Roman" color="#000000">:NuMega SmartCheck</font>
<br>
</span><span class="p9"><font face="宋体" color="#000000">方法</font> <font face="Times New Roman" color="#000000">:</font>
<font face="宋体" color="#000000">在</font> <font face="Times New Roman" color="#000000">SmartCheck</font>
<font face="宋体" color="#000000">里理解并分析数据</font></span> <br>
<span class="p9"><font face="Times New Roman" color="#000000">1</font>
<font face="宋体" color="#000000">、这个软件在检查序列号前,先查长度,如不是</font> <font face="Times New Roman" color="#000000">9</font>
<font face="宋体" color="#000000">位则不进比较。然后依次一个一个比较序列号,正确就往下进行,错误就停止比较。那是如何知道的?呵,试呗。</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">2</font>
<font face="宋体" color="#000000">、按要求配制好</font> <font face="Times New Roman" color="#000000">SmartCheck</font>
<font face="宋体" color="#000000">,然后在</font> <font face="Times New Roman" color="#000000">SmartCheck</font>
<font face="宋体" color="#000000">下运行该程序,你先输入</font> <font face="Times New Roman" color="#000000">123456,</font>
<font face="宋体" color="#000000">点击</font> <font face="Times New Roman" color="#000000">"Check It"</font>
<font face="宋体" color="#000000">,最后我们再来到</font> <font face="Times New Roman" color="#000000">SmartCheck</font>
<font face="宋体" color="#000000">主窗口分析一下。再次强调一下,在</font> <font face="Times New Roman" color="#000000">SmartCheck</font>
<font face="宋体" color="#000000">下有左右两个窗口,下面一个窗口,如你的是一个窗口,请用鼠标把右边和下面的拖出,它们有可能最小化了(我的刚才就是这情况)。</font>
<br>
</span><span class="p9"> <font face="宋体" color="#000000">展开</font> <font face="Times New Roman" color="#000000">Command1_Click.</font>
<font face="宋体" color="#000000">只有</font> <font face="Times New Roman" color="#000000">3</font>
<font face="宋体" color="#000000">个信息,其中:</font> <font face="Times New Roman" color="#000000">Len(String:"123456") returns LONG:6</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">**</font>
<font face="宋体" color="#000000">这意味着是检查你输入的字符串的长度,你就多试几次,最后应是</font>
<font face="Times New Roman" color="#000000">9</font> <font face="宋体" color="#000000">位才对</font>
<font face="Times New Roman" color="#000000">.....</font> <br>
</span><span class="p9"><font face="Times New Roman" color="#000000">3</font>
<font face="宋体" color="#000000">、好,当我们输入</font> <font face="Times New Roman" color="#000000">9</font>
<font face="宋体" color="#000000">个字符</font> <font face="Times New Roman" color="#000000">"999999999"</font>
<font face="宋体" color="#000000">时:</font> <br>
</span><span class="p9"><font face="宋体" color="#000000">最后展开</font>
<font face="Times New Roman" color="#000000">Command1_Click. </font>
<font face="宋体" color="#000000">这次你将看到许多函数,如</font> <font face="Times New Roman" color="#000000">Asc and Mid...</font>
<font face="宋体" color="#000000">,所以长度是</font> <font face="Times New Roman" color="#000000">9</font>
<font face="宋体" color="#000000">位。</font> <br>
</span><span class="p9"><font face="宋体" color="#000000">光标在</font> <font face="Times New Roman" color="#000000">Command1_Click</font>
<font face="宋体" color="#000000">一行,选择</font> <font face="Times New Roman" color="#000000">"Show All Events"</font>
</span> <br>
<span class="p9"><font face="宋体" color="#000000">下面几行较有趣</font> <font face="Times New Roman" color="#000000">:</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">1) Mid$(String:"999999999", long:1, VARIANT:Integer:1)</font>
<br>
</span><span class="p9"><font face="Times New Roman" color="#000000">**</font>
<font face="宋体" color="#000000">这意味着,取出你序列号的第一个字符。</font></span> <br>
<span class="p9"><font face="Times New Roman" color="#000000">2) __vbaVarTstNe(VARIANT:Const Double:9, VARIANT:String:"3")...</font>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -