#include <stdlib.h>
#include <string>
std::string GetCpuID()
{
unsigned long s1, s2;
char cpuID[25];
__asm{
mov eax, 01h
xor edx, edx
cpuid
mov s1, edx
mov s2, eax
}
sprintf_s(cpuID, 25, "%08X%08X\n", s1, s2);
std::string strCpuId(cpuID);
return strCpuId;
}
#include <string>
std::string GetCpuID()
{
unsigned long s1, s2;
char cpuID[25];
__asm{
mov eax, 01h
xor edx, edx
cpuid
mov s1, edx
mov s2, eax
}
sprintf_s(cpuID, 25, "%08X%08X\n", s1, s2);
std::string strCpuId(cpuID);
return strCpuId;
}