📄 chap6-1-3.htm.primary
字号:
<html>
<head>
<title>Crack Tutorial</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style/css.css" type="text/css">
<link rel="stylesheet" href="../STYLE/Css.css" type="text/css">
</head>
<body bgcolor="white" text="#000000" link="#004080" vlink="#004080" background="../image/Back.gif">
<p><a href="../catalog.htm">目录</a>>>第6章</p>
<p align="center" class="shadow1Copy"><b class="p3">第6章 软件保护技术</b></p>
<table width="80%" border="0" cellspacing="0" cellpadding="3" align="center" bgcolor="#bcbcbc" bordercolor="#111111" class="shadow1">
<tr>
<td class="shadow1" width="25%">
<div align="center"><a href="Chap6-1.htm"><font color="#FFFFFF">第一节 常见保护技巧</font></a></div>
</td>
<td class="shadow1" width="25%">
<div align="center"><a href="Chap6-2.htm"><font color="#FFFFFF">第二节 反跟踪技术</font></a></div>
</td>
<td class="shadow1" width="25%">
<div align="center"><a href="Chap6-3.htm"><font color="#FFFFFF">第三节 加密算法</font></a></div>
</td>
<td class="shadow1" width="25%">
<div align="center"><a href="Chap6-4.htm"><font color="#FFFFFF">第四节 软件保护建议</font></a></div>
</td>
</tr>
</table>
<p align="center"><span class="p9"><b>第一节 常见保护技巧</b></span></p>
<table border="1" width="80%" cellpadding="5" bordercolor="#111111" bgcolor="#efefef" align="center" cellspacing="0">
<tr>
<td width="33%" valign="middle" align="center" class="p9" height="23">
<div align="center" class="p"><span class="p9"><span class="p9">1、<a href="Chap6-1-1.htm">序列号方式</a> </span></span></div>
</td>
<td width="33%" valign="middle" align="center" class="p9" height="23">
<div align="center">2、<a href="Chap6-1-2.htm">警告(NAG)窗口</a></div>
</td>
<td width="34%" valign="top" class="p9" height="23">
<div align="center"><span class="p9">3、<a href="Chap6-1-3.htm">时间限制</a></span></div>
</td>
</tr>
<tr>
<td width="33%" valign="middle" align="center" class="p9" height="23">
<div align="center">4、<a href="Chap6-1-4.htm">Key File保护</a></div>
</td>
<td width="33%" valign="middle" align="center" class="p9" height="23">
<div align="center">5、<a href="Chap6-1-5.htm">功能限制的程序</a> </div>
</td>
<td width="34%" valign="top" class="p9" height="23">
<div align="center">6、<a href="Chap6-1-6.htm">CD-check</a></div>
</td>
</tr>
</table>
<p align="center"><span class="p9"><span class="p9"><b>3、时间限制</b> <b><a href="Chap6-1-31.htm">【习题】</a></b></span></span></p>
<p align="left">(1) 定时器</p>
<p align="left"><span class="p9"> 有些程序的试用版每次运行都有时间限制,例如运行10分钟或20分钟就停止工作,必须重新运行该程序才能正常工作。这些程序里面自然有个定时器来统计程序运行的时间。</span></p>
<p align="left" class="p9"><span class="p9"><b>1)使用Settimer()</b><br>
<br>
常用的计数器是函数Settimer(),调用这个函数创建的定时器可以发出消息VM_TIMER,或者在定时期满时调用一个回调函数。 使用这个函数会使时间延时,精度不高。</span></p>
<p align="left" class="p9"><b>2)使用timeSetEvent()</b><br>
<br>
<span class="p9"> </span>给Windows驱动程序最精确的周期性通知是由Windows的多媒体服务timeSetEvent()提供的。它的时间可以精确到1毫秒。<br>
<br>
<b>3)使用VXD</b></p>
<p align="left" class="p9"> <span class="p9"> </span>可以使用VMM的Set_Global_time_Out()服务来迫使回调函数的几个毫秒再执行,这就创造了一个“只有一次”的定时器。VXD可以在回调中再次调用Set_Global_time_Out()来开始下一个定时器,这样提供了一个连续运行的定时器了。</p>
<p align="left" class="p9"><b>4)其它</b></p>
<p align="left" class="p9"><span class="p9"> </span>GetTickCount():精度不高;<br>
<span class="p9"> </span>timeGetTime(): 可以以毫秒级返回windows开始后的时间。</p>
<p align="left" class="p9">(2)时间限制</p>
<p align="left" class="p9"> <span class="p9"> </span>一般这类保护的软件都有时间上的限制,如试用30天等,当过了共享软件的试用期后,就不予运行,只有向软件作者付费注册之后才能得到一个无时间限制的注册版本。</p>
<p align="left" class="p9"><span class="p9"> 这种类型程序很多,让你有10天、20天、30天等,它们在安装时,在你的系统某处做上时间标记,每次运行时用当前系统时间和安装时的时间比较,判断你还否能使用。<br>
如最典型的30天限制的一种情况:<br>
mov ecx,1E ; 把1E (30天 十进制) 放入 ecx<br>
mov eax,[esp+10] ; 把用过天数放到eax<br>
cmp eax,ecx ; 在此比较<br>
jl ... <br>
如碰到这种情况,只需把"mov eax,[esp+10]"改成"mov eax,1" 。<br>
<br>
要记住当前年份、月份的十六进制的一些表示方法,如:2000年的十六进制是07D0,然后用W32DASM反汇编你的程序,用查找字符串的方法找D007(在机器码中位置颠倒了一下)或其它类似时间的数字,有可能会找到有价值的线索。你别小看这种方法,对那些没怎么防范的程序,此招很有效。<br>
如:一程序限定在2000年使用,可能有如下一代码:<br>
:00037805 817C2404D0070000 cmp dword ptr [esp+04], 000007D0 比较是否在2000年。</span></p>
<p><span class="p9"><font color="#3333FF"><font color="#000000">(3)与时间相关函数</font></font>
</span></p>
<p><span class="p9">1、GetSystemTime 得当前系统时间</span></p>
<table width="100%" cellspacing="0" align="center">
<tr bgcolor="#F2FFFF">
<td><span class="p9">说明:<br>
在一个SYSTEMTIME中载入当前系统时间,这个时间采用的是“协同世界时间”(即UTC,也叫做GMT)格式。</span> <br>
<span class="p9">VOID GetSystemTime(</span>
<p><span class="p9"> LPSYSTEMTIME lpSystemTime // <font color="#FF3333">SYSTEMTIME</font>,随同当前时间载入的结构
<br>
); </span></p>
</td>
</tr>
</table>
<br>
<span class="p9">2、GetLocalTime 得当前本地时间</span> <br>
<br>
<table width="100%" cellspacing="0" align="center">
<tr bgcolor="#F2FFFF">
<td>
<p><span class="p9">VOID GetLocalTime(</span></p>
<p><span class="p9"> LPSYSTEMTIME lpSystemTime // <font color="#FF0033">SYSTEMTIME</font>,用于装载本地时间的结构<br>
);</span></p>
</td>
</tr>
</table>
<p><span class="p9">3、SystemTimeToFileTime 根据一个<font color="#FF3366">FILETIME</font>结构的内容,载入一个<font color="#FF3366">SYSTEMTIME</font>结构<br>
<br>
</span></p>
<table width="100%" cellspacing="0" align="center">
<tr bgcolor="#F2FFFF">
<td>
<p><span class="p9">BOOL SystemTimeToFileTime(</span></p>
<p><span class="p9"> CONST SYSTEMTIME * lpst, // <font color="#FF3366">SYSTEMTIME</font>,包含了系统时间信息的一个结构
<br>
LPFILETIME lpft //<font color="#FF3366"> FILETIME</font>,用于装载文件时间的一个结构
<br>
); <br>
返回值 :非零表示成功,零表示失败。 </span></p>
</td>
</tr>
</table>
<p class="p9">4、SetTimer 创建一定时器,在指定时间内暂停<br>
<br>
</p>
<table width="100%" cellspacing="0" align="center">
<tr bgcolor="#F2FFFF">
<td class="p9">UINT SetTimer(<br>
HWND hwnd, // 时间信息句柄<br>
UINT idtimer, // 定时器ID 标识符<br>
UINT uTimeout, // 暂停时间<br>
TIMERPROC tmprc // 处理定时过程的程序入口地址<br>
); </td>
</tr>
</table>
<p align="center"><a href="../Catalog.htm"><img src="../image/navtoc.gif" width="84" height="23" border="0"></a><a href="Chap6-1-21.htm"><img src="../image/Navprev.gif" width="80" height="23" border="0"></a><a href="Chap6-1-31.htm"><img src="../image/navnext.gif" width="83" height="23" border="0"></a></p>
<hr width=735>
<div align="center"><span class="p9"><font size="2"><span class="p9"><font size="2"><span class="p9">Copyright
© 2000-2001 <a href="http://www.pediy.com/">KanXue Studio</a> All Rights
Reserved.</span></font></span></font></span></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -