Created
August 23, 2012 04:37
-
-
Save Wunkolo/3432455 to your computer and use it in GitHub Desktop.
Get cpu vendor ID x86
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 <iostream> | |
using namespace std; | |
int main(){ | |
unsigned int idcmd = 0; | |
unsigned int EBX_REG=0; | |
unsigned int EDX_REG=0; | |
unsigned int ECX_REG=0; | |
unsigned int EAX_SIZE=0; | |
char VendorID[13]; VendorID[12] = 0; | |
__asm{ | |
mov eax, idcmd | |
cpuid | |
mov EBX_REG, ebx | |
mov EDX_REG, edx | |
mov ECX_REG, ecx | |
mov EAX_SIZE, eax | |
} | |
memcpy(&VendorID[0],&EBX_REG,4); | |
memcpy(&VendorID[4],&EDX_REG,4); | |
memcpy(&VendorID[8],&ECX_REG,4); | |
printf("%s\n",VendorID); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment