Created
June 18, 2015 10:03
-
-
Save evernick/35f88965af41cb9cf865 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <excpt.h> | |
#include <stdio.h> | |
BOOL anti_debug_flag = TRUE; | |
void anti_debug() | |
{ | |
__try | |
{ | |
__asm { int 3 } | |
} | |
__except(EXCEPTION_EXECUTE_HANDLER) | |
{ | |
anti_debug_flag = FALSE; | |
} | |
} | |
int main(int argc, char **argv) | |
{ | |
anti_debug(); | |
if(anti_debug_flag) | |
printf("Debugger Detected\n"); | |
else | |
printf("No Debugger...\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment