Skip to content

Instantly share code, notes, and snippets.

@evernick
Created June 18, 2015 08:29
Show Gist options
  • Save evernick/cac18a47b740d5ce2bd4 to your computer and use it in GitHub Desktop.
Save evernick/cac18a47b740d5ce2bd4 to your computer and use it in GitHub Desktop.
#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