Mega Code Archive

 
Categories / Delphi / Ide Indy
 

Simulating Delphi running to bypass evaluation version protection

Title: Simulating Delphi running to bypass evaluation version protection Question: How can I use components that only work when Delphi is running ? Answer: Some Delphi authors write trial versions of their shareware components by using a 'protection' that consists in testing if Delphi is running or not, with a function like : function IsDelphiRunning : boolean; begin Result := (FindWindow('TAppBuilder',nil) 0) and (FindWindow('TPropertyInspector',nil) 0) and (FindWindow('TAlignPalette',nil) 0); end; If Delphi is not running, these components doesn't work or display shareware information. This 'protection' can be easily cracked by creating similar windows to Delphi's. In your 'uses' clause, simply insert the following unit before the shareware component. (****************************************************************************** DSim 1.2 simulates Delphi running Copyright (C) 2001 Antarlac Software http://antarlac.intercosmos.com ******************************************************************************) unit DSim; interface implementation uses Windows; const AppBuilderWindowClass :TWndClass = ( style :0; lpfnWndProc :@DefWindowProc; cbClsExtra :0; cbWndExtra :0; hInstance :0; hIcon :0; hCursor :0; hbrBackground :0; lpszMenuName :NIL; lpszClassName :'TAppBuilder' ); PropertyInspectorWindowClass :TWndClass = ( style :0; lpfnWndProc :@DefWindowProc; cbClsExtra :0; cbWndExtra :0; hInstance :0; hIcon :0; hCursor :0; hbrBackground :0; lpszMenuName :NIL; lpszClassName :'TPropertyInspector' ); AlignPaletteWindowClass :TWndClass = ( style :0; lpfnWndProc :@DefWindowProc; cbClsExtra :0; cbWndExtra :0; hInstance :0; hIcon :0; hCursor :0; hbrBackground :0; lpszMenuName :NIL; lpszClassName :'TAlignPalette' ); var AppBuilderHWND :HWND; PropertyInspectorHWND :HWND; AlignPaletteHWND :HWND; initialization { TAppBuilder } if FindWindow(AppBuilderWindowClass.lpszClassName,NIL) = 0 then begin RegisterClass(AppBuilderWindowClass); AppBuilderHWND := CreateWindowEx(0, AppBuilderWindowClass.lpszClassName, '', 0, 0, 0, 0, 0, 0, 0, HInstance, NIL); end; { TPropertyInspector } if FindWindow(PropertyInspectorWindowClass.lpszClassName,NIL) = 0 then begin RegisterClass(PropertyInspectorWindowClass); PropertyInspectorHWND := CreateWindowEx(0, PropertyInspectorWindowClass.lpszClassName, '', 0, 0, 0, 0, 0, 0, 0, HInstance, NIL); end; { TAlignPalette } if FindWindow(AlignPaletteWindowClass.lpszClassName,NIL) = 0 then begin RegisterClass(AlignPaletteWindowClass); AlignPaletteHWND := CreateWindowEx(0, AlignPaletteWindowClass.lpszClassName, '', 0, 0, 0, 0, 0, 0, 0, HInstance, NIL); end; finalization { TAppBuilder } UnregisterClass(AppBuilderWindowClass.lpszClassName, HInstance); if AppBuilderHWND 0 then DestroyWindow(AppBuilderHWND); { TPropertyInspector } UnregisterClass(PropertyInspectorWindowClass.lpszClassName, HInstance); if PropertyInspectorHWND 0 then DestroyWindow(PropertyInspectorHWND); { TAlignPalette } UnregisterClass(AlignPaletteWindowClass.lpszClassName, HInstance); if AlignPaletteHWND 0 then DestroyWindow(AlignPaletteHWND); end.