Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save spnow/520284f1d5e8bde1a9047af0bb2371e5 to your computer and use it in GitHub Desktop.
Save spnow/520284f1d5e8bde1a9047af0bb2371e5 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