Login Register






[Delphi Tutorial] Anti Sandboxie and Debugger filter_list
Author
Message
[Delphi Tutorial] Anti Sandboxie and Debugger #1
Hello Reality Forums, I have the flu and so I am extremely bored. Today I will be showing you how to protect you program from possible crackers/hackers.


***Note: I am using the old Delphi 7 IDE, don't judge >Biggrin ***

Step 1: [Image: 54vs4yA.png]
Hopefully you are intelligent enough to click the OK button afterwards.
Step 2: Add to the uses, "Windows" (no quotes) add a semicolon after it so you don't get a syntax error.
Step 3: add the below codes BEFORE the main begin end.
Code:
function IsSandboxie: boolean; begin Result := GetModuleHandle(pchar('SbieDll.dll')) > 0; end; //********************************* function DebuggerPresent : boolean; type  TDebugProc = function : boolean;    stdcall; var  Kernel32: HMODULE;  DebugProc: TDebugProc; begin  Result := False;  Kernel32 := GetModuleHandle('kernel32');  if Kernel32<>0 then  begin    @DebugProc := GetProcAddress(Kernel32, 'IsDebuggerPresent');    if Assigned(DebugProc) then      Result := DebugProc  end; end;

Now that we have added our functions we just need to use them in the begin-end (the run-time part)
Step 4: Add the code below. 
Code:
if IsSandboxie = ture then begin Halt(0); end; if DebuggerPresent = true then begin Halt(0); end;


If you don't know, or are new to Delphi, basically we are calling the functions we used earlier, specifically Boolean type functions so they will return ether True or False. If your application has a GUI then you can call Application.Terminate; instead of Halt(0); See This Link for more information about the two.

Now your done! Your program can't be run in sandboxie or be debugged by someone trying to crack your program. 
Your final code should look similar to this:
[Image: jXPpNCP.png]
If you have any questions please ask them. Thanks for wasting part of your life by reading this simple tutorial. :p

Reply

RE: [Delphi Tutorial] Anti Sandboxie and Debugger #2
Thanks for this man Biggrin

Reply