现在的位置: 首页 > 综合 > 正文

3年前的小程序:破解需要delphi IDE 环境的vcl 控件

2011年06月15日 ⁄ 综合 ⁄ 共 3009字 ⁄ 字号 评论关闭
基本原理:有些vcl组件未注册的话,会显示没有注册的信息,但在设计期间不显示这些信息,表示该组件会检查delphi的ide 环境,解决办法就是让自己的exe带上ide的信息;

组件检查ide的办法无非就是使用api查找特定的delphi窗体类名称,如下是代码,建立几个看不见的窗体,名称和delphi ide的主要窗口一样;当然,这样做不见得100%破解检查ide环境的组件,有些组件可以遍历窗体的子件类,总之方法很多,要更好的办法,简单;用dede反编译delphi的主程序,把dfm资源搞出来,到自己工程里加入就行了。

以下是代码,见笑;

{********************* 破解需要delphi IDE 的vcl 控件*****
//请直接将该单元加入到工程中,并放到最初启动位置,无需调
//用方法,自动完成解密过程
//版权所有:随飞
//该版为 Pascal 代码版本
********************************************************}
unit vclAntIde;
interface
uses
  Windows, Messages;

const
  AppBuilder        
= 'TAppBuilder';
  EditWindow        = 'TEditWindow';
  PropertyInspector = 'TPropertyInspector';
  ObjectTreeView    = 'TObjectTreeView';

implementation

function WindowProc(Window: Integer; AMessage, wParam, lParam: Integer):
  
Integer;
  stdcall; export;
begin
  WindowProc :
= 0;
  
case AMessage of
    WM_DESTROY, WM_QUIT, WM_QUERYENDSESSION, WM_CLOSE:
      begin
        PostQuitMessage(
0);
        
Exit;
      
end;
  
end;
  WindowProc :
= DefWindowProc(Window, AMessage, wParam, lParam);
end;

function WinRegister(AppName: PAnsiChar): boolean;
var
  WindowClass       : TWndClass;
begin
  WindowClass.Style :
= 2 or 1;
  WindowClass.lpfnWndProc :
= @WindowProc;
  WindowClass.cbClsExtra :
= 0;
  WindowClass.cbWndExtra :
= 0;
  WindowClass.hInstance :
= HInstance;
  WindowClass.hIcon :
= LoadIcon(0, idi_Application);
  WindowClass.hCursor :
= LoadCursor(0, idc_Arrow);
  WindowClass.hbrBackground :
= HBrush(Color_Window);
  WindowClass.lpszMenuName :
= nil;
  WindowClass.lpszClassName :
= AppName;

  Result :
= RegisterClass(WindowClass) <> 0;
end;

function WinCreate(AppName: PAnsiChar): HWnd;
var
  hWindow           : HWnd;
begin
  hWindow :
= CreateWindow(AppName,
    AppName,
    WS_OVERLAPPEDWINDOW,
    
0,
    
0,
    
1,
    
1,
    
0,
    
0,
    HInstance,
    nil);
  
if hWindow <> 0 then
  begin
    
//      ShowWindow(hWindow, cmdShow);
    
//      UpdateWindow(hWindow);
  
end;

  Result :
= hWindow;
end;

var
  AMessage          : TMsg;
  hWindow           : HWnd;
  
begin
//HWND handle = GetSafeHwnd();

  
if GlobalFindAtom('@TaskAgent')=0 then
  begin
    GlobalAddAtom(
'@TaskAgent');
  end;

  
if not WinRegister(AppBuilder) then
  begin
    MessageBox(
0'注册失败!', nil, mb_Ok);
    Exit;
  
end;
  
if not WinRegister(EditWindow) then
  begin
    MessageBox(
0'注册失败!', nil, mb_Ok);
    Exit;
  
end;
  
if not WinRegister(PropertyInspector) then
  begin
    MessageBox(
0'注册失败!', nil, mb_Ok);
    Exit;
  
end;
  
if not WinRegister(ObjectTreeView) then
  begin
    MessageBox(
0'注册失败!', nil, mb_Ok);
    Exit;
  
end;

  hWindow :
= WinCreate(AppBuilder);
  
if hWindow = 0 then
  begin
    MessageBox(
0'创建失败', nil, mb_Ok);
    Exit;
  
end;

  hWindow :
= WinCreate(EditWindow);
  
if hWindow = 0 then
  begin
    MessageBox(
0'创建失败', nil, mb_Ok);
    Exit;
  
end;
  hWindow :
= WinCreate(PropertyInspector);
  
if hWindow = 0 then
  begin
    MessageBox(
0'创建失败', nil, mb_Ok);
    Exit;
  
end;

  hWindow :
= WinCreate(ObjectTreeView);
  
if hWindow = 0 then
  begin
    MessageBox(
0'创建失败', nil, mb_Ok);
    Exit;
  
end;

end.

抱歉!评论已关闭.