Skip to content

Instantly share code, notes, and snippets.

@evernick
Created June 18, 2015 09:44
Show Gist options
  • Save evernick/d78386b0f12705293a96 to your computer and use it in GitHub Desktop.
Save evernick/d78386b0f12705293a96 to your computer and use it in GitHub Desktop.
#include <windows.h>
#include <stdio.h>
BOOL anti_debug()
{
HKEY hKey;
int i=0;
if( RegOpenKeyEx (HKEY_LOCAL_MACHINE, "SYSTEM\\CurrentControlSet\\Enum\\IDE\\DiskVMware_Virtual_IDE_Hard_Drive___________00000001", 0L, KEY_READ , &hKey) )
return 0;
return 1;
}
int main(int argc, char **argv)
{
if(anti_debug())
printf("VM Detected\n");
else
printf("No VM...\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment