Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save spnow/28ba8376fe08690e2adf03df528c3d36 to your computer and use it in GitHub Desktop.
Save spnow/28ba8376fe08690e2adf03df528c3d36 to your computer and use it in GitHub Desktop.
#include <windows.h>
#include <stdio.h>
BOOL anti_debug(LARGE_INTEGER cnt1)
{
LARGE_INTEGER cnt2;
QueryPerformanceCounter (&cnt2);
if ((cnt2.QuadPart-cnt1.QuadPart) > 0xFF) {
return 1;
}
return 0;
}
int main(int argc, char **argv)
{
LARGE_INTEGER cnt1;
QueryPerformanceCounter(&cnt1);
if(anti_debug(cnt1))
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