Skip to content

Instantly share code, notes, and snippets.

@Wunkolo
Created August 23, 2012 04:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Wunkolo/3432455 to your computer and use it in GitHub Desktop.
Save Wunkolo/3432455 to your computer and use it in GitHub Desktop.
Get cpu vendor ID x86
#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