Skip to content

Instantly share code, notes, and snippets.

@evernick
Created June 18, 2015 10:04
Show Gist options
  • Save evernick/07331174a4f66137dde9 to your computer and use it in GitHub Desktop.
Save evernick/07331174a4f66137dde9 to your computer and use it in GitHub Desktop.
#include <windows.h>
#include <excpt.h>
#include <stdio.h>
LONG WINAPI UnhandledExcepFilter(PEXCEPTION_POINTERS pExcepPointers)
{
SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)
pExcepPointers->ContextRecord->Eax);
pExcepPointers->ContextRecord->Eip += 2;
return EXCEPTION_CONTINUE_EXECUTION;
}
int main(int argc, char **argv)
{
SetUnhandledExceptionFilter(UnhandledExcepFilter);
__asm{xor eax, eax}
__asm{div eax}
printf("No Debugger...\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment