Created
June 18, 2015 08:29
-
-
Save evernick/cac18a47b740d5ce2bd4 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 <stdio.h> | |
BOOL anti_debug() | |
{ | |
TCHAR pathname[512]; | |
TCHAR * filename; | |
GetModuleFileName(0, pathname, 512); | |
filename = wcsrchr(pathname, L'\\'); | |
if (wcsncmp(filename, L"\\%s%s.exe", 10) == 0) { | |
return 1; | |
} else { | |
return 0; | |
} | |
} | |
int main(int argc, char **argv) | |
{ | |
if(anti_debug()) | |
printf("Debugger Detected\n"); | |
else | |
printf("No Debugger...\n"); | |
system("pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment