Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 16th, 2012  |  syntax: C++  |  size: 0.38 KB  |  hits: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #include <stdio.h>
  2. #include <windows.h>
  3.  
  4. int debugged;
  5.  
  6. LONG WINAPI Handler(struct _EXCEPTION_POINTERS *pointer)
  7. {
  8.         printf ("NOT DEBUGGED\n");
  9.         debugged = 0;
  10.         return EXCEPTION_CONTINUE_EXECUTION;
  11. }
  12.  
  13. int main ()
  14. {
  15.         int a = 0;
  16.         int b = 1;
  17.         debugged = 1;
  18.  
  19.         SetUnhandledExceptionFilter(Handler);
  20.  
  21.         int c = b/a;
  22.  
  23. continue:
  24.  
  25.         if (debugged)
  26.                 return 1;
  27.  
  28.         return 0;
  29. }