📄 cpumessage.txt
字号:
#include <windows.h>
#include <iostream.h>
#include <stdio.h>
int main()
{
char OEMString[13];
char Company[64];
int iEAXValue,iEBXValue,iECXValue,iEDXValue;
_asm {
mov eax,0
cpuid
mov DWORD PTR OEMString, ebx
mov DWORD PTR OEMString+4, edx
mov DWORD PTR OEMString+8, ecx
}
OEMString[12]=0;
if ( !strcmp(OEMString, "GenuineIntel")) strcpy(Company, "Intel Corporation");
else if ( !strcmp(OEMString, "UMC UMC UMC ")) strcpy(Company, "United Microelectronics Corp.");
else if ( !strcmp(OEMString, "AuthenticAMD")) strcpy(Company, "Advanced Micro Devices");
else if ( !strcmp(OEMString, "AMD ISBETTER")) strcpy(Company, "Advanced Micro Devices");
else if ( !strcmp(OEMString, "CyrixInstead")) strcpy(Company, "Cyrix Corp., VIA Inc.");
else if ( !strcmp(OEMString, "NexGenDriven")) strcpy(Company, "NexGen Inc., Advanced Micro Devices");
else if ( !strcmp(OEMString, "CentaurHauls")) strcpy(Company, "IDT\\Centaur, Via Inc.");
else if ( !strcmp(OEMString, "RiseRiseRise")) strcpy(Company, "Rise");
else if ( !strcmp(OEMString, "GenuineTMx86")) strcpy(Company, "Transmeta");
else if ( !strcmp(OEMString, "TransmetaCPU")) strcpy(Company, "Transmeta");
else if ( !strcmp(OEMString, "Geode By NSC")) strcpy(Company, "National Semiconductor");
cout<< "This CPU's OEM String is:"<< OEMString<< endl;
cout<< "The cpu is product by "<<Company<<endl;
_asm {
mov eax,1
cpuid
mov iEAXValue,eax
mov iEBXValue,ebx
mov iECXValue,ecx
mov iEDXValue,edx
}
int iCPUType =(0x0000F000 & iEAXValue) >> 12;
int iCPUFamily=(0x00000F00 & iEAXValue) >> 8;
int iCPUModel =(0x000000F0 & iEAXValue) >> 4;
int iCPUStep =(0x0000000F & iEAXValue);
cout << "CPU Type is: " <<iCPUType <<endl;
cout << "CPU Family is: " <<iCPUFamily <<endl;
cout << "CPU Model is: " <<iCPUModel <<endl;
cout << "CPU Stepping is: " <<iCPUStep <<endl;
char Specification[49];
_asm {
mov eax,0x80000002
cpuid
mov DWORD PTR Specification, eax
mov DWORD PTR Specification+4, ebx
mov DWORD PTR Specification+8, ecx
mov DWORD PTR Specification+12, edx
}
_asm {
mov eax,0x80000003
cpuid
mov DWORD PTR Specification+16, eax
mov DWORD PTR Specification+20, ebx
mov DWORD PTR Specification+24, ecx
mov DWORD PTR Specification+28, edx
}
_asm {
mov eax,0x80000004
cpuid
mov DWORD PTR Specification+32, eax
mov DWORD PTR Specification+36, ebx
mov DWORD PTR Specification+40, ecx
mov DWORD PTR Specification+44, edx
}
Specification[48]=0;
cout << "CPU Specification is:" <<Specification <<endl;
getchar();
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -