⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crackme02.htm

📁 为所有对破解感兴趣的朋友准备的礼物。希望大家能够喜欢。
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<html>

<head>

<title>看雪学苑</title>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<style type="text/css">

<!--

.p8 {  font-size: 8pt}

.p9 {  font-size: 9pt}

a:hover {  color: #00FF00}

a {  text-decoration: none; color: #3333CC}

.p12 {  font-size: 12pt; font-weight: bold; color: #FF3333}

-->

</style>

</head>



<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000" alink="#000000">

<p><span class="p9"><a href="index.htm" tppabs="http://toye.dihou.org/index.htm">首页</a>>><a href="crackme.htm" tppabs="http://toye.dihou.org/crackme.htm">Crack 

  ME</a></span></p>

<p align="center"><span class="p9">金天地MH型软件狗 "时间间隔检测保护"的一点分析 </span></p>

<blockquote> 

  <p><span class="p9"><br>

    保护方式:&nbsp; &nbsp;&nbsp;金天地 MH 型狗 "时间间隔检测" <br>

    <br>

    【保护方式分析】 <br>

    初步分析可以发现,该程序文件NotepadMH.exe比Notepad.exe多了几个Section: .gdata&nbsp; .gidata .gtide 

    <br>

    从跟踪中可以发现,程序使用 GetLocalTime 进行获取时间,用 CreateFileA / DeviceIoControl 从GSDOG.VXD中获取数据。 

    <br>

    <br>

    1、用iceload.exe加载程序,中断在第一条指令处。设断点&nbsp; bpx CreateFileA ,按 F5 键,将再一次中断。下指令 

    bd 0 禁止该断点。 <br>

    <br>

    2、设断点 bpx 408D46,按 F5 键继续,中断。 <br>

    <br>

    015F:00408D3C&nbsp; A300304100&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV&nbsp; 

    &nbsp; &nbsp; [00413000],EAX <br>

    015F:00408D41&nbsp; E8DA150000&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CALL&nbsp; 

    &nbsp; &nbsp; 0040A320 <br>

    015F:00408D46&nbsp; 8945C8&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    MOV&nbsp; &nbsp; &nbsp; [EBP-38],EAX&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&lt;--中断在此处,如果EAX=0,则正常,否则说明检测失败。 

    <br>

    015F:00408D49&nbsp; 837DC800&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CMP&nbsp; 

    &nbsp; &nbsp; DWORD PTR [EBP-38],00 <br>

    015F:00408D4D&nbsp; 7405&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    JZ&nbsp; &nbsp; &nbsp; &nbsp; 00408D54 <br>

    <br>

    因此,我们可以修改在 EAX 中的返回值。我用的是直接修改代码字节的方法,即下指令&nbsp; eb eip c7,45,c8,0,0,0,0,eb 

    。 <br>

    这样就把 <br>

    <br>

    015F:00408D46&nbsp; 8945C8&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    MOV&nbsp; &nbsp; &nbsp; [EBP-38],EAX <br>

    015F:00408D49&nbsp; 837DC800&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CMP&nbsp; 

    &nbsp; &nbsp; DWORD PTR [EBP-38],00 <br>

    015F:00408D4D&nbsp; 7405&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    JZ&nbsp; &nbsp; &nbsp; &nbsp; 00408D54 <br>

    <br>

    这三条指令修改为 <br>

    <br>

    015F:00408D46&nbsp; C745C800000000&nbsp; &nbsp; &nbsp; MOV&nbsp; &nbsp; &nbsp; 

    [EBP-38],0 <br>

    015F:00408D4D&nbsp; EB05&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    JMP&nbsp; &nbsp; &nbsp; 00408D54 <br>

    <br>

    3、设断点 bpx 408F28,按 F5 键继续,中断。 <br>

    <br>

    015F:00408F28&nbsp; C705183041004C9B4000MOV&nbsp; &nbsp; &nbsp; DWORD PTR 

    [00413018],00409B4C &lt;--中断在此处 <br>

    015F:00408F32&nbsp; C745C000000000&nbsp; &nbsp; &nbsp; MOV&nbsp; &nbsp; &nbsp; 

    DWORD PTR [EBP-40],00000000 <br>

    015F:00408F39&nbsp; EB3C&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    JMP&nbsp; &nbsp; &nbsp; 00408F77 <br>

    <br>

    这里说明一下,其实当程序执行到此时,已经“认为”检测失败了,为什么我不直接拦在前面的判断处呢? <br>

    <br>

    暂时不管这些,先下指令&nbsp; eb eip c7,05,be,32,41,00,d3,00,00,00 <br>

    这样就把 <br>

    <br>

    015F:00408F28&nbsp; C705183041004C9B4000MOV&nbsp; &nbsp; &nbsp; DWORD PTR 

    [00413018],00409B4C <br>

    <br>

    这条指令修改为 <br>

    <br>

    015F:00408F28&nbsp; C705BE324100D3000000MOV&nbsp; &nbsp; &nbsp; DWORD PTR 

    [004132BE],000000D3 <br>

    <br>

    现在我来解释一下原因。 <br>

    其实,小牧童所加的这 6 个壳都有共同的特点。关键的地方就是检测软件狗和还原程序数据。其中检测软件狗的代码部分,可以改改跳转就过关了,但是还原程序数据的部分则是最关键的。因为它从软件狗中读取 

    4 个字节的数据进行运算后做为“密匙”,来还原数据。因此,我对程序进行的修改就是这两个方面的内容。其中,[004132BE] 中保存的就是这个“密匙”,当然,原来的值是错误的,因为,我们没有狗,当然,计算了一个错误的值了,将来还原也就会得到一堆垃圾了,而我改成的 

    D3 就是真正的“密匙”。至于,为什么我把修改的语句放在判断语句之后?那是因为,如果在前面的判断处修改跳转方向的话,程序将在其后进行几种“新”的检测,但是如果程序这里“认为”检测失败的话,就会省略进行这几项检测,而其后一段过程无论是否检测失败或者检测成功,程序的流程都相同,都会进行一段还原过程然后跳转到程序入口执行,当然了如果检测失败的话,还原出来的就是垃极数据了。也许你有疑问:如果这样的话,为什么程序没有发生异常中止的现象,而是悄然退出呢?这就是上面设断的这条指令的作用了,当程序检测失败的话,程序就会把原本程序跳转到真正入口处的地址改为退出的地址(即 

    409B4C )。而我为了让程序省略几项检测,(当然也为了少PATCH几处代码),所以就让程序认为已经检测失败了,这里我修改的代码是为以后作准备的。其中 

    [004132BE] 地址处保存的就是从将来在还原过程中用到的“密匙”。这个数据是由程序从狗中读取后进行一定运算得到的,当然每个程序不同,这个数据是我分析了一下它的还原方法后计算得到的,其实你一看我的改法就明白,程序的加密算法很简单,自己分析分析就过关了。 

    <br>

    <br>

    4、设断点 bpx 408A69 do "d 4132be",按 F5 键继续,中断。然后下指令禁止该断点。 <br>

    <br>

    015F:00408A60&nbsp; 55&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; PUSH&nbsp; &nbsp; &nbsp; EBP <br>

    015F:00408A61&nbsp; 8BEC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    MOV&nbsp; &nbsp; &nbsp; EBP,ESP <br>

    015F:00408A63&nbsp; 83EC18&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    SUB&nbsp; &nbsp; &nbsp; ESP,18 <br>

    015F:00408A66&nbsp; 53&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; PUSH&nbsp; &nbsp; &nbsp; EBX <br>

    015F:00408A67&nbsp; 56&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; PUSH&nbsp; &nbsp; &nbsp; ESI <br>

    015F:00408A68&nbsp; 57&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; PUSH&nbsp; &nbsp; &nbsp; EDI <br>

    015F:00408A69&nbsp; A1BE324100&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV&nbsp; 

    &nbsp; &nbsp; EAX,[004132BE]&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&lt;--中断在此处 

    <br>

    015F:00408A6E&nbsp; C1E810&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    SHR&nbsp; &nbsp; &nbsp; EAX,10 <br>

    015F:00408A71&nbsp; 8945FC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    MOV&nbsp; &nbsp; &nbsp; [EBP-04],EAX <br>

    015F:00408A74&nbsp; A1BE324100&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MOV&nbsp; 

    &nbsp; &nbsp; EAX,[004132BE] <br>

    015F:00408A79&nbsp; 25FFFF0000&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND&nbsp; 

    &nbsp; &nbsp; EAX,0000FFFF <br>

    <br>

    这里我们所设的断点只是为了让你了解一下它取“密匙”的地方,这段代码就是把“密匙”进行一定的变换后来还原加密数据了。有兴趣的话你可以去看看。 <br>

    <br>

    5、设断点 bpx 408A55,按 F5 键继续,中断。 <br>

    <br>

    015F:00408A4E&nbsp; 58&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; POP&nbsp; &nbsp; &nbsp; EAX <br>

    015F:00408A4F&nbsp; 5B&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; POP&nbsp; &nbsp; &nbsp; EBX <br>

    015F:00408A50&nbsp; 59&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; POP&nbsp; &nbsp; &nbsp; ECX <br>

    015F:00408A51&nbsp; 5A&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; POP&nbsp; &nbsp; &nbsp; EDX <br>

    015F:00408A52&nbsp; 5F&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; POP&nbsp; &nbsp; &nbsp; EDI <br>

    015F:00408A53&nbsp; 5E&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; POP&nbsp; &nbsp; &nbsp; ESI <br>

    015F:00408A54&nbsp; C9&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; LEAVE <br>

    015F:00408A55&nbsp; FF2518304100&nbsp; &nbsp; &nbsp; &nbsp; JMP&nbsp; &nbsp; 

    &nbsp; [00413018]&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&lt;--中断在此处,即将跳转到 

    OEP 处。 <br>

    015F:00408A5B&nbsp; 5F&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; POP&nbsp; &nbsp; &nbsp; EDI <br>

    015F:00408A5C&nbsp; 5E&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; POP&nbsp; &nbsp; &nbsp; ESI <br>

    015F:00408A5D&nbsp; 5B&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; POP&nbsp; &nbsp; &nbsp; EBX <br>

    015F:00408A5E&nbsp; C9&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; LEAVE <br>

    015F:00408A5F&nbsp; C3&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 

    &nbsp; RET <br>

    <br>

    好了,到此程序将进入到 OEP (程序原入口点)了。如果你还记得第 3 步中的代码,那么现在是否应该明白了,当程序检测失败时,为什么要修改 413018 

    处的内容。 <br>

    <br>

    【后记】 <br>

    好了,到这里应该就结束了,好象我没有对时间间隔进行特别处理一样,其实,这只是 <br>

    软件狗把所有原程序要用到的API函数都进行了“包装”而已,所a以每当程序调用API函数时都会先运行软件狗所加的检测代码。以上我的改法虽然可以运行,但是如果你的程序运行得有些慢的话(毕竟每调用一次API都要进行一次检测也有点浪费时间),也可以去掉软件狗所加的一层“包装”,就自己动手吧,也比较简单。 

    <br>

    <br>

    其实,以上的方法,最终不是一个完善的解决方案。如果编个程序完全脱掉软件狗的壳才是最终方案。当然,目前的一些脱壳工具对这几个壳是没有意义的。因为,这几个壳的脱壳关键倒不是还原Import 

    Table。而是把程序修改过的一些代码恢复成原来模样才是关键的。 </span></p>

</blockquote>

<hr>

<p>&nbsp;</p>

<div align="left"><span class="p9"><font color=blue>标 题:金天地MH型软件狗 "时间间隔检测保护"补充</font><br>

  <font color=blue>发信人:</font>ljtt<br>

  <font color=blue>时 间:</font>2000-12-29 18:54:19 <br>

  <font color=blue>详细信息:</font><br>

  </span>

  <blockquote><span class="p9"> 可能是有问题。那是晚上熬夜写的,写到晚上1点,人困马乏,加上是从记录中整理的,就没有象以前实际测试一遍,让你浪费时间了,你试试这样看行不行。这是我以前跟踪时所用的断点。现在没有以前那么多时间可以写那么长的东东了。 

    <br>

    <br>

    用iceload加载程序,然后 be 0 ,然后一路按 F5 试试。我现在也差不多不记得当时的跟踪情况,大致是这样,如果有错误,。。。就自己试着解决吧。奸笑! 

    <br>

    我对狗了解也很少,其实按招我的东东来解狗有点浪费时间,我的错误太多了,只希望你能了解思路就行了。你完全自己做到的,关键是自己掌握分析和跟踪方法。 <br>

    <br>

    0: bpx CreateFileA do "bd 0; be 3" <br>

    1: bpx 408D46 do "eb eip c7,45,c8,0,0,0,0,eb" <br>

    2:&nbsp; &nbsp;&nbsp;bpx 408F28 do "eb eip c7,05,be,32,41,00,d3,0,0,0" <br>

    3:&nbsp; &nbsp;&nbsp;bpx 408A69 do "d 4132be; bd 3" <br>

    4:&nbsp; &nbsp;&nbsp;bpx 4079EB do "eb eip c7,45,b4,0,0,0,0,eb" <br>

    5:&nbsp; &nbsp;&nbsp;bpx 408A55 </span></blockquote>

  <hr>

  <span class="p9"><font color=blue>标 题:</font>对ljtt《金天地MH型软件狗 "时间间隔检测保护"的一点分析》一文的一点补充 

  (1千字)<br>

  <font color=blue>发信人:</font>真.hp<br>

  <font color=blue>时 间:</font>2000-12-29 22:28:52 <br>

  <font color=blue>详细信息:</font><br>

  </span>

  <blockquote><span class="p9"> 我看了ljtt的那篇文章,于是跟着作了,但却不成功,于是我也跟踪了一下, <br>

    发现程序在015F:00408A2F处有一call走过之后就会推出,于是用F8跟进 <br>

    <br>

    0040782F 55&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push&nbsp; &nbsp; 

    ebp <br>

    00407830 8BEC&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov&nbsp; &nbsp; ebp, 

    esp <br>

    00407832 83EC4C&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sub&nbsp; &nbsp; esp, 4Ch 

    <br>

    00407835 53&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push&nbsp; &nbsp; 

    ebx <br>

    00407836 56&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push&nbsp; &nbsp; 

    esi <br>

    00407837 57&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push&nbsp; &nbsp; 

    edi <br>

    00407838 C745C800000000&nbsp; mov&nbsp; &nbsp; dword ptr [ebp-38h], 0 <br>

    0040783F 833D7C30410000&nbsp; cmp&nbsp; &nbsp; ds:dword_41307C, 0&nbsp; &nbsp; 

    &nbsp; &lt;-判断此处是否为0 <br>

    00407846 0F843B010000&nbsp; &nbsp; jz&nbsp; &nbsp; &nbsp; loc_407987&nbsp; 

    &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;-跳就完了 <br>

    0040784C C745D0724102CF&nbsp; mov&nbsp; &nbsp; [ebp+var_30], 0CF024172h <br>

    00407853 8175D035247683&nbsp; xor&nbsp; &nbsp; [ebp+var_30], 83762435h <br>

    <br>

    由于后面的程序还会判断41307C是否为0,所以我把0040783F处的代码改为 <br>

    <br>

    0040783F C6057C30410001&nbsp; mov&nbsp; &nbsp; &nbsp; ds:dword_41307C, 1 <br>

    <br>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -