Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting CPU or motherboard serial number?

I'm trying to get the CPU serial or motherboard serial using C or Python for licensing purposes. Is it possible?

I'm using Linux.

like image 220
Forge Avatar asked Dec 07 '22 00:12

Forge


2 Answers

Under Linux, you could use "lshw -quiet -xml" and parse its output. You'll find plenty of system information here: cpuid, motherboard id and much more.

like image 162
Simone Avatar answered Dec 21 '22 09:12

Simone


You need to use the CPUID instruction.

CPUID

Most C compilers have some support for inline assembly, but you will need to know what you are doing.

like image 32
dicroce Avatar answered Dec 21 '22 07:12

dicroce