-
-
Save spnow/d3421fef7c04908e4a0fe588ef557bb8 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 <stdio.h> | |
#include <windows.h> | |
int anti_debug(){ | |
int rc=0; | |
__try | |
{ | |
__asm | |
{ | |
mov eax, 'VMXh' | |
mov ebx, 0; | |
mov ecx, 0xA | |
mov edx, 'VX' | |
in eax, dx; | |
cmp ebx, 'VMXh' | |
jne notVmware | |
jmp isVmware | |
notVmware: | |
mov rc, 0 | |
jmp done | |
isVmware: | |
mov rc, eax | |
done: | |
} | |
} | |
__except(EXCEPTION_EXECUTE_HANDLER) | |
{ | |
rc = 0; | |
} | |
return rc; | |
} | |
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