Created
February 24, 2014 20:39
-
-
Save RobinDavid/9196548 to your computer and use it in GitHub Desktop.
Know if we are on a virtual machine thank's to the processor cache trick
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> | |
int main () { | |
unsigned char m[2+4], rpill[] = "\x0f\x01\x0d\x00\x00\x00\x00\xc3"; | |
*((unsigned*) & rpill[3]) = (unsigned)m; | |
((void(*)()) & rpill)(); | |
printf ("idt base: %#x\n", *((unsigned*) & m[2])); | |
if (m[5]>0xd0) { | |
printf ("Inside Matrix!\n", m[5]); | |
return 1; | |
} | |
else { | |
printf ("Not in Matrix.\n"); | |
return 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment