Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

how can i detect if my program opened with a Debuger (in Delphi)

Featured Replies

Posted

hi all.


 


before reading Excuse me for my poor English.


 


 


i want to detect if my program opened with a Debuger in Delphi.


 


i found a few code in other website ,but thats not work true!


 


please help me.


search for anti-debugging techniques in the forum, you will get your answer.


Edited by Kingstaa

@ Sam7sam7


specifically write your problem in detail and with the attached file for testing


  • Author

thank you for help :sly:


 


I used the "IsDebuggerPresent" function in  my app  but this not work in OllyDbg!!!


 


 


my problem solved with this function



procedure AntiDebug;
var
  bISDebug: Boolean;
begin
  bISDebug := True;
  try
    asm
      INT 2Dh
      nop
    end;
  except
    bISDebug := False;
  end;
  if  bISDebug then
    TerminateProcess(GetCurrentProcess, 0)
end;

Edited by Sam7sam7

This simple debugger detection can be killed with a simple one byte patch...


Its really easy to bypass this...


  • 2 weeks later...
  • Author

This simple debugger detection can be killed with a simple one byte patch...

Its really easy to bypass this...

can you give me a better way ?

Sam7sam7 you can convert this for c++?

 

Using:

 

bool Example()

{

__asm{

      INT 2Dh

      nop

 

}

}

  • Author

Sam7sam7 you can convert this for c++?

 

Using:

 

bool Example()

{

__asm{

      INT 2Dh

      nop

 

}

}

I wrote the following function in delphi but when i open my app in ollydbg can't detect it!!

{ -------------------------------------------------------------------------------  + Function : Int2D_DBG  + DateTime  : 2013.03.28  + Result    : Bool  ------------------------------------------------------------------------------- }Function Int2D_DBG(): Bool;{ Exception Based Anti-Debugging }ASM  mov Result,$0 // Return False@@_TRY :  pushad  mov esi, offset @@_Handler  push esi  push    FS:[0]  mov     FS:[0], ESP  // ---------------------  int     2Dh  nop  // ---------------------@@_EXCEPT:  mov Result,$1  // Return True  jmp @@_NoException@@_Handler:  mov esp, [esp + 8]  pop dword ptr fs:[0]  add esp, 4  popad@@_TRY_END :  jmp @@_ExceptionHandled@@_NoException:  pop dword ptr fs:[0]  add esp, 32 + 4@@_ExceptionHandled:End;

example of use :

  if Int2D_DBG = True then    ShowMessage('IS DBG')  else    ShowMessage('Is not DBG');

Edited by Sam7sam7

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.