Skip to content

Instantly share code, notes, and snippets.

@spnow
Forked from evernick/GetTickCount.cpp
Created August 1, 2017 23:10
Show Gist options
  • Save spnow/6d1a70e52d9041a67b38335d3f76a75b to your computer and use it in GitHub Desktop.
Save spnow/6d1a70e52d9041a67b38335d3f76a75b to your computer and use it in GitHub Desktop.
#include <windows.h>
#include <stdio.h>
#pragma comment(lib, "winmm.lib")
BOOL anti_debug(DWORD count1)
{
DWORD count2;
count2 = GetTickCount();
if ((count2-count1) > 0x10) {
return 1;
}
return 0;
}
int main(int argc, char **argv)
{
DWORD count1;
count1 = GetTickCount();
if(anti_debug(count1))
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