استفاده از اين تكنيك بسيار مفيد است و كمك زيادي در حفاظت از برنامه مي كند .
با استفاده از اين تكنيك مي توانيد بخشي از كدهاي بررسي قفل را قبل از رسيدن به EntryPoint چك و ترتيب ديباگر و كركر را دارد من موفق شدم به نوعي با استفاده از DLL اون را پياده سازي كنم .
از دوستان تقاظا مي شود كه روش صحيح استفاده از اين تكنيك را آموزش دهند .
من يافته هاي خودم را قرار مي دهم :
مرحله اول ايجاد DLL :
library DLL_EntryPoint;
uses
SysUtils,
Windows,
Forms,
Classes,
Dialogs;
{$R *.res}
procedure book; stdcall;
begin
//Dummy
end;
procedure DLLEntryPoint(dwReason: DWORD); stdcall; //register; //stdcall;
begin
case dwReason of
DLL_THREAD_DETACH : ShowMessage('Thread Detach'); //0
DLL_PROCESS_ATTACH: //1
begin
// بررسي قفل
end;
DLL_THREAD_ATTACH : ShowMessage('Thread Attach'); //2
DLL_PROCESS_DETACH: //3
begin
// بررسي قفل
end;
end;
end;
exports
DLLEntryPoint,book;
begin
//DLLEntryPoint is specifically a Win32 and C++ implementation
//DLLProc is a pointer variable from the SYSTEM Unit (automatically included)
//The SYSTEM Unit is responsible for executing code assinged to DLLEntryPoint
DLLProc := @DLLEntryPoint; //Assign the address of DLLEntryPoint to DLLProc
DLLEntryPoint(DLL_PROCESS_ATTACH); //Indicate that the DLL is attaching to the process
end.
استفاده در برنامه اصلي :
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
procedure book ;
stdcall; external 'Dll_EntryPoint.DLL';
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
book;
end;
end.
منتظر كد هاي شما هستم 