• 标 题:暴力破解Paragon CD Emulator时间及功能限制 (7千字)
  • 作 者:henryw
  • 时 间:2001-3-24 11:51:44
  • 链 接:http://bbs.pediy.com

暴力破解Paragon CD Emulator时间及功能限制

[下载]
    已经很长时间了,估计应该在www.inhua.com下载,手里的版本为1.02.007

[破解工具]
WDasm
IDA Pro
Trw2000
Regmonitor
Filemonitor

[破解过程]

通过使用软件来收集信息发现:

1. 软件启动的时候会跳出对话框,提示还有多少天的使用期。
2. 超过30天的试用期会提示过期了。程序调用一些功能时候也显示过期了,拒绝调用。
3. Regmonitor发现程序找不到user和registration两个注册表的值。
4. Add Image功能因为是Trial Version受到限制。

现在就可以开始动手术了。

使用WDasm和IDA Pro进行反汇编,查看区别。

首先,cdman.exe经过反汇编,在WDasm的Import里面,看到了对cdshell的函数的调用。看来程序还有一个cdshell.dll,
所以除了反汇编cdman.exe以外,还需要反汇编cdshell.dll。

浪费了许多时间后发现,程序的Trial Version和Full Version的版本号是不同的,因此似乎无法打开注册对话框来输入
注册码,虽然使用ResHack可以看见注册对话框。所以无法对上述3的信息进行进一步操作。

IDA里面甚至看到了license的文件名,cde.lic。不过,这个东东是为网络版应用的,个人版看来只需破解时间限制即可。

由于所有的提示信息都可以在cdshell.dll的反汇编文件中找到,所以,它成了主要目标。

既然是时间限制,很容易想到GetSystemTimeA;自从IDA配备了三个查找Import,Export以及String Reference的plugin
以后,查找的事情变得很简单了。经过考虑,加上trw2000在这里的跟踪,注意力集中到了下面地方:
.........
.........
:1001C3C9 6800AB0410              push 1004AB00  <-------- IDA里告诉我们,这里是放入FlagEx
:1001C3CE 68B8A90410              push 1004A9B8  <-------- 这里是注册表的路径
:1001C3D3 E868160000              call 1001DA40
.........
.........
:1001C41A E811170000              call 1001DB30
:1001C41F 3BC3                    cmp eax, ebx
:1001C421 7456                    je 1001C479    <-------- 这里不能跳,否则过期了。
:1001C423 8B54240C                mov edx, dword ptr [esp+0C]
:1001C427 51                      push ecx
:1001C428 8BC4                    mov eax, esp
:1001C42A 895E20                  mov dword ptr [esi+20], ebx
:1001C42D 8D4C241C                lea ecx, dword ptr [esp+1C]

* Possible Reference to String Resource ID=00001: "Create CD Image File"
                                  |
:1001C431 BB01000000              mov ebx, 00000001
:1001C436 8910                    mov dword ptr [eax], edx
:1001C438 8D442414                lea eax, dword ptr [esp+14]
:1001C43C 50                      push eax
:1001C43D E8BE160000              call 1001DB00
:1001C442 8B08                    mov ecx, dword ptr [eax]
:1001C444 B807452EC2              mov eax, C22E4507
:1001C449 F7E9                    imul ecx
:1001C44B 03D1                    add edx, ecx
:1001C44D 8BC3                    mov eax, ebx
:1001C44F C1FA10                  sar edx, 10
:1001C452 8BCA                    mov ecx, edx
:1001C454 C1E91F                  shr ecx, 1F
:1001C457 03D1                    add edx, ecx    <-------- edx显示还有多少天。
:1001C459 895624                  mov dword ptr [esi+24], edx  <------- 这里修改edx为1D(29天),程序会认为仍在使用期内
:1001C45C 5F                      pop edi
:1001C45D 5E                      pop esi
:1001C45E 5B                      pop ebx
:1001C45F 83C408                  add esp, 00000008
:1001C462 C3                      ret

经过以上修改,发现程序没有进行其他的过期检测。第一步成功。

第二步来解它的NagScreen,就是提醒还有多少天的对话框。依旧在cdshell.dll里面:

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:10006EFD(C)
|
:10006F08 8B442430                mov eax, dword ptr [esp+30]
:10006F0C 85C0                    test eax, eax
:10006F0E 0F84B6000000            je 10006FCA    <----------  跳去显示NagScreen,因为下面可见“cdshell.cdMessageBox”
:10006F14 8D4C2408                lea ecx, dword ptr [esp+08]
:10006F18 E8EB2B0300              call 10039B08
:10006F1D 8D4C2404                lea ecx, dword ptr [esp+04]
:10006F21 C744244000000000        mov [esp+40], 00000000
:10006F29 E8DA2B0300              call 10039B08
..............
..............
* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:10006F0E(C)
|

* Possible Reference to String Resource ID=00048: "%s/s; %.3f kHz; %i Bits; %s"
                                  |
:10006FCA 6A30                    push 00000030

* Possible Reference to String Resource ID=00062: "You work with the trial version of the program.
This version"
                                  |
:10006FCC 6A3E                    push 0000003E

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:10006F03(U)
|

* Possible Reference to String Resource ID=00140: "Paragon CD Emulator Manager"
                                  |
:10006FCE 688C000000              push 0000008C
* Reference To: cdshell.cdMessageBox
                                  |
:10006FD3 E888FEFFFF              call 10006E60
:10006FD8 83C40C                  add esp, 0000000C

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:10006EF1(C)
|
:10006FDB 8B4C2438                mov ecx, dword ptr [esp+38]
:10006FDF 8BC6                    mov eax, esi
:10006FE1 64890D00000000          mov dword ptr fs:[00000000], ecx
:10006FE8 5E                      pop esi
:10006FE9 83C440                  add esp, 00000040
:10006FEC C3                      ret

所以干脆让10006F0E跳到10006EF1来,结果,程序启动时候以及以后的NagScreen都不见了。

=======此为 cdshell.dll反汇编的东东==========
Exported fn(): cdTrialInfo - Ord:0027h
:10007750 6A43                    push 00000043

* Possible Reference to String Resource ID=00070: "

This function is unavailable in the trial version.
You can"
                                  |
:10007752 6A46                    push 00000046
* Reference To: cdshell.cdRestrictionInfo
                                  |
:10007754 E8D7FDFFFF              call 10007530
:10007759 83C408                  add esp, 00000008
:1000775C C3                      ret
=======此为 cdman.exe反汇编的东东==========
* Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
|:0040A00F(C), :0040A018(C)
|
:0040A028 E8B39AFFFF              call 00403AE0
:0040A02D 85C0                    test eax, eax
:0040A02F 741F                    je 0040A050    <--------------  需要跳转。
:0040A031 8B8500010000            mov eax, dword ptr [ebp+00000100]
:0040A037 85C0                    test eax, eax
:0040A039 7515                    jne 0040A050
:0040A03B 8B8504010000            mov eax, dword ptr [ebp+00000104]
:0040A041 85C0                    test eax, eax
:0040A043 750B                    jne 0040A050

* Reference To: cdshell.cdTrialInfo, Ord:0026h    <--------------  要跳过这里
                                  |
:0040A045 FF15D4CE4500            Call dword ptr [0045CED4]
:0040A04B E9C9040000              jmp 0040A519

总结一下需要修改的地方:
[cdshell.dll]
1.  1001C421 7456  --->  9090

2.  1001C457 03D1                    add edx, ecx                <----  改成mov byte ptr [esi+24], 1D,由于
    1001C459 895624                  mov dword ptr [esi+24], edx  <----  原来6个字节,改后成5个,要添一个90
   
3.  10006F0E 0F84B6000000            je 10006FCA  --->  jmp 10006EF1

[cdman.exe]
1.  0040A02F 741F                    je 0040A050  --->  jmp 0040A050

于是,破解完成了。:)

不过,希望有高手能讲解一下它的时间是如何运算的。