Advertisement
Madmouse

QEMU cpuid shennanigans

Dec 27th, 2015
1,930
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. // QEMU vulnerable to disclosing real host values for cpuid, this is bad for security and for breaking reliant code
  2.  
  3. bool is_64(void)
  4. {
  5.     register int eax asm("eax");
  6.     register int esi asm("esi");
  7.     asm(".intel_syntax noprefix\n"
  8.     "xor eax, eax\n"
  9.     "cpuid\n"
  10.     "mov esi, eax\n"
  11.     "mov eax, 0x80000000\n"
  12.     "cpuid\n");
  13.     return (eax == esi) ? false : true;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement