这次切入正题
*****************************************************************************
标 题:一个delphi控件的破解 (12千字)
发信人:1212
时 间:2001-3-31 17:21:30
详细信息:
Abakus是一套Delphi的工控控件,很好的。可惜搞不到源码。
从下面这个地方可以下载到2.01版,没有源码。
URL:http://www.torry.net/vcl/indicat/packs/abkda.zip
大小: 1159615
表现症状:当你放一个控件到你的Form,会有一个information的对话框出现;当你编译好一个程序,
在delphi没有运行的情况下,会有一个Error的对话框出现。
破解工具:Dede250,Ultraedit。
作者:sxlz
1。分析:看看所有的DCU文件,有没有可疑的地方,发现一个_abinfo.dcu,好像有问题!先拿它试试,
如果不成的话,最看别的。
2。运行Dede.exe,选取DCU Dumper,把_abinfo.dcu给Dumpe一下。
3。发现:
uses
_PrjInfo {
A
Name, A
Version, A:Copyright, A:Mail, A:WWW},
_AbProc {
A:AbDelphiIsRunning},
IniFiles,
里有AbDelphiIsRunning,哈哈,继续查AbDelphiIsRunning,又发现:
procedure TAbInfo.nagTimerEvent (Self: TAbInfo; sender: System.TObject);
begin
00000000 : 55 PUSH EBP
00000001 : 8B EC MOV EBP,ESP
00000003 : 6A 00 PUSH $00
00000005 : 6A 00 PUSH $00
00000007 : 53 PUSH EBX
00000008 : 8B D8 MOV EBX,EAX
0000000A : 33 C0 XOR EAX,EAX
0000000C : 55 PUSH EBP
0000000D : 68(50 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000150
00000012 : 64 FF 30 PUSH DWORD PTR FS:[EAX]
00000015 : 64 89 20 MOV DWORD PTR FS:[EAX],ESP
00000018 : A1(00 00 00 00 MOV EAX,DWORD PTR [AbInfo{0x44}]
0000001D : 8B 40 1C MOV EAX,DWORD PTR [EAX+28]
00000020 : 33 D2 XOR EDX,EDX
00000022 : E8(00 00 00 00 CALL TTimer.SetEnabled{0x10}
00000027 : A1(00 00 00 00 MOV EAX,DWORD PTR [pName{0x2}]
0000002C : FF 30 PUSH DWORD PTR [EAX]
0000002E : 68(64 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000164
00000033 : A1(00 00 00 00 MOV EAX,DWORD PTR [pVersion{0x3}]
00000038 : FF 30 PUSH DWORD PTR [EAX]
0000003A : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
0000003F : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
00000044 : 68(7C 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$0000017C
00000049 : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
0000004E : 68(C4 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$000001C4
00000053 : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
00000058 : 68(0C 02 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$0000020C
0000005D : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
00000062 : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
00000067 : 68(40 02 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000240
0000006C : A1(00 00 00 00 MOV EAX,DWORD PTR [Mail{0x5}]
00000071 : FF 30 PUSH DWORD PTR [EAX]
00000073 : 68(54 02 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000254
00000078 : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
0000007D : A1(00 00 00 00 MOV EAX,DWORD PTR [WWW{0x6}]
00000082 : FF 30 PUSH DWORD PTR [EAX]
00000084 : 68(68 02 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000268
00000089 : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
0000008E : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
00000093 : A1(00 00 00 00 MOV EAX,DWORD PTR [Copyright{0x4}]
00000098 : FF 30 PUSH DWORD PTR [EAX]
0000009A : 8D 45 FC LEA EAX,DWORD PTR [EBP-4]
0000009D : BA 15 00 00 00 MOV EDX,$00000015
000000A2 : E8(00 00 00 00 CALL @LStrCatN{0x3B}
000000A7 : 68(88 02 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000288
000000AC : FF 73 04 PUSH DWORD PTR [EBX+4]
000000AF : 68(B4 02 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$000002B4
000000B4 : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
000000B9 : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
000000BE : 68(40 02 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000240
000000C3 : A1(00 00 00 00 MOV EAX,DWORD PTR [Mail{0x5}]
000000C8 : FF 30 PUSH DWORD PTR [EAX]
000000CA : 68(54 02 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000254
000000CF : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
000000D4 : A1(00 00 00 00 MOV EAX,DWORD PTR [WWW{0x6}]
000000D9 : FF 30 PUSH DWORD PTR [EAX]
000000DB : 68(68 02 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000268
000000E0 : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
000000E5 : 68(70 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000170
000000EA : A1(00 00 00 00 MOV EAX,DWORD PTR [Copyright{0x4}]
000000EF : FF 30 PUSH DWORD PTR [EAX]
000000F1 : 8D 45 F8 LEA EAX,DWORD PTR [EBP-8]
000000F4 : BA 0E 00 00 00 MOV EDX,$0000000E
000000F9 : E8(00 00 00 00 CALL @LStrCatN{0x3B}
000000FE : E8(00 00 00 00 CALL AbDelphiIsRunning{0x8} --------------------检查delphi有没有运行
00000103 : 66 85 C0 TEST AX,AX
00000106 : 74 15 JE +21; (0x11D) --------------------跳过去的话可以看到有halt0,凭直觉就不好,那就不跳好了。
00000108 : 6A 00 PUSH $00
0000010A : 66 8B 0D(C4 02 00 00 MOV CX,WORD PTR [TAbInfo.nagTimerEvent{0x4C}+$000002C4]
00000111 : B2 02 MOV DL,$02
00000113 : 8B 45 FC MOV EAX,DWORD PTR [EBP-4]
00000116 : E8(00 00 00 00 CALL MessageDlg{0x12}
0000011B : EB 18 JMP +24; (0x135)
0000011D : 6A 00 PUSH $00
0000011F : 66 8B 0D(C4 02 00 00 MOV CX,WORD PTR [TAbInfo.nagTimerEvent{0x4C}+$000002C4]
00000126 : B2 01 MOV DL,$01
00000128 : 8B 45 F8 MOV EAX,DWORD PTR [EBP-8]
0000012B : E8(00 00 00 00 CALL MessageDlg{0x12}
00000130 : E8(00 00 00 00 CALL @Halt0{0x3A}
00000135 : 33 C0 XOR EAX,EAX
00000137 : 5A POP EDX
00000138 : 59 POP ECX
00000139 : 59 POP ECX
0000013A : 64 89 10 MOV DWORD PTR FS:[EAX],EDX
0000013D : 68(57 01 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}+$00000157
00000142 : 8D 45 F8 LEA EAX,DWORD PTR [EBP-8]
00000145 : BA 02 00 00 00 MOV EDX,$00000002
0000014A : E8(00 00 00 00 CALL @LStrArrayClr{0x3C}
0000014F : C3 RET NEAR
00000150 : E9(00 00 00 00 JMP @HandleFinally{0x3D}
00000155 : EB EB JMP -21; (0x142)
00000157 : 5B POP EBX
00000158 : 59 POP ECX
00000159 : 59 POP ECX
0000015A : 5D POP EBP
0000015B : C3 RET NEAR
这个可以消除information的对话框。
4。查前面有函数:
var
AbInfo:TAbInfo;
const
Reg:System.AnsiString = raw[$0..$3]at $157
0: ....{08 00 00 00|K5 Reg{0x45}, K1 _NF_46;
function LoadAbakusInfo: TAbInfo;
那就找LoadAbakusInfo,发现:
function LoadAbakusInfo: TAbInfo;
begin
00000000 : 53 PUSH EBX
00000001 : 56 PUSH ESI
00000002 : BB(00 00 00 00 MOV EBX,AbInfo{0x44}---------这一行带(的是动态地址
00000007 : 83 3B 00 CMP DWORD PTR [EBX],0--------这个改成1,跳过去就妥了!
0000000A : 0F 85 B2 00 00 00 JNE +178; (0xC2)
00000010 : B2 01 MOV DL,$01
00000012 : A1(00 00 00 00 MOV EAX,DWORD PTR [TAbInfo{0x42}]
00000017 : E8(00 00 00 00 CALL TAbInfo.Create{0x49}
0000001C : 89 03 MOV DWORD PTR [EBX],EAX
0000001E : 8B 03 MOV EAX,DWORD PTR [EBX]
00000020 : FF 40 18 INC DWORD PTR [EAX+24]
00000023 : 8B 0D(00 00 00 00 MOV ECX,DWORD PTR [Application{0x19}]
00000029 : 8B 09 MOV ECX,DWORD PTR [ECX]
0000002B : B2 01 MOV DL,$01
0000002D : A1(00 00 00 00 MOV EAX,DWORD PTR [TTimer{0xC}]
00000032 : E8(00 00 00 00 CALL TTimer.Create{0xD}
00000037 : 8B F0 MOV ESI,EAX
00000039 : 8B 03 MOV EAX,DWORD PTR [EBX]
0000003B : 89 70 1C MOV DWORD PTR [EAX+28],ESI
0000003E : 8B C6 MOV EAX,ESI
00000040 : BA F4 01 00 00 MOV EDX,$000001F4
00000045 : E8(00 00 00 00 CALL TTimer.SetInterval{0xE}
0000004A : 8B 03 MOV EAX,DWORD PTR [EBX]
0000004C : 50 PUSH EAX
0000004D : 68(00 00 00 00 PUSH TAbInfo.nagTimerEvent{0x4C}
00000052 : 8B 03 MOV EAX,DWORD PTR [EBX]
00000054 : 8B 40 1C MOV EAX,DWORD PTR [EAX+28]
00000057 : E8(00 00 00 00 CALL TTimer.SetOnTimer{0xF}
0000005C : 8B 03 MOV EAX,DWORD PTR [EBX]
0000005E : 8B 40 1C MOV EAX,DWORD PTR [EAX+28]
00000061 : B2 01 MOV DL,$01
00000063 : E8(00 00 00 00 CALL TTimer.SetEnabled{0x10}
00000068 : 8B 03 MOV EAX,DWORD PTR [EBX]
0000006A : 83 C0 04 ADD EAX,4
0000006D : 8B 15(00 00 00 00 MOV EDX,DWORD PTR [pName{0x2}]
00000073 : 8B 12 MOV EDX,DWORD PTR [EDX]
00000075 : E8(00 00 00 00 CALL @LStrAsg{0x35}
0000007A : 8B 03 MOV EAX,DWORD PTR [EBX]
0000007C : 83 C0 08 ADD EAX,8
0000007F : 8B 15(00 00 00 00 MOV EDX,DWORD PTR [pVersion{0x3}]
00000085 : 8B 12 MOV EDX,DWORD PTR [EDX]
00000087 : E8(00 00 00 00 CALL @LStrAsg{0x35}
0000008C : 8B 03 MOV EAX,DWORD PTR [EBX]
0000008E : 83 C0 0C ADD EAX,12
00000091 : 8B 15(00 00 00 00 MOV EDX,DWORD PTR [Copyright{0x4}]
00000097 : 8B 12 MOV EDX,DWORD PTR [EDX]
00000099 : E8(00 00 00 00 CALL @LStrAsg{0x35}
0000009E : 8B 03 MOV EAX,DWORD PTR [EBX]
000000A0 : 83 C0 10 ADD EAX,16
000000A3 : 8B 15(00 00 00 00 MOV EDX,DWORD PTR [Mail{0x5}]
000000A9 : 8B 12 MOV EDX,DWORD PTR [EDX]
000000AB : E8(00 00 00 00 CALL @LStrAsg{0x35}
000000B0 : 8B 03 MOV EAX,DWORD PTR [EBX]
000000B2 : 83 C0 14 ADD EAX,20
000000B5 : 8B 15(00 00 00 00 MOV EDX,DWORD PTR [WWW{0x6}]
000000BB : 8B 12 MOV EDX,DWORD PTR [EDX]
000000BD : E8(00 00 00 00 CALL @LStrAsg{0x35}
000000C2 : 8B 03 MOV EAX,DWORD PTR [EBX]
000000C4 : 5E POP ESI
000000C5 : 5B POP EBX
000000C6 : C3 RET NEAR
end;
这个可以解决Error对话框的问题。
5。改完后,打开AbakusD5.dpk重新编译一下,重新安装。
6。要是有源码的话还是源码的好,谁有的话发给我testdog@sina.com非常感谢。
7。第一次写得不好,请原谅。
--------------------------------------------------------------------------------