How do I obtain the serial number of the CPU in a PC?
相关问题
- Where can the code be more efficient for checking
- NASM x86 print integer using extern printf
- “rdtsc”: “=a” (a0), “=d” (d0) what does this do? [
- Can a “PUSH” instruction's operation be perfor
- Long latency instruction
相关文章
- How to get CPU serial under Linux without root per
- Is it possible to run 16 bit code in an operating
- x86 instruction encoding tables
- x86 Program Counter abstracted from microarchitect
- Assembler : why BCD exists?
- Visual Studio: How to properly build and specify t
- The location of EIP and other Registers in x86 Pro
- How to benchmark in Qemu i386 system using rdtsc
Based upon 'licensing' tag you have used for your question, you might get better results reading network MAC address. Identifying PC by a MAC address isn't totally unbreakable method for copy protection, still it is sometimes used.
There is no CPU serial ID (PSN; CPUID edx bit 18 "psn" Processor Serial Number) after Pentium III in Intel CPUs; and there was never any psn in AMD chips:
https://software.intel.com/en-us/forums/watercooler-catchall/topic/308483 (at 2005)
https://en.wikipedia.org/wiki/Pentium_III#Controversy_about_privacy_issues
https://en.wikipedia.org/wiki/CPUID#EAX=3:_Processor_Serial_Number
__get_cpuid (unsigned int __level, unsigned int *__eax, unsigned int *__ebx, unsigned int *__ecx, unsigned int *__edx);
#include <cpuid.h>
Note: The processor serial number was introduced on Intel Pentium III, but due to privacy concerns, this feature is no longer implemented on later models.
Source : wikipedia
Some more details please: operating system, language.
For example on Windows you can get it by using WMI and reading Win32_Processor.ProcessorId.
Executing the CPUID instruction with the proper register settings will retrieve the processor serial number in EAX, EBX, ECX, and EDX. However, this functionality is only available on Pentium 3 and later processors. Also on Pentium 4 and newer processors the instruction always returns 0x00000000 in all 4 registers. Later model Pentium 3's may also return 0x00000000's. The feature was primarily aimed at copy protection, allowing software to be linked to specific processors. It did not go over well with the community, and lawsuits ensued. The feature was removed from late model P3's and all newer processors. The feature is present in newer processors for compatibility reasons. it is rumored than you can special order processors with serial numbers, btu the minimum purchase is something like 1 million processors. For the specific register settings prior to executing the CPUID instruction, check Intels system programmer PDF available through their website.
Also -
In windows, I am sure there is a system call, In linux one could try "sudo lshw" but most kernels do not seem to support CPU serial numbers, and preliminary research seems to indicate that the general outrage against uniquely identifiable computers means that there is no perfect answer.
What are you trying to do? Almost certainly someone has done it before and it may be wise to reuse or emulate what they have done.