I want to write a c program that can detect CPU id for activation process. Some advise me to use UUID but I like to try CPU id instead. After searching I found some good answer. But I am using Windows 8 64bit and Mingw. So I am afraid I cant use it.
Asked
Active
Viewed 679 times
1 Answers
1
Yes, two pieces of information, since you wanted to be guided and not shown code :)
Use the CPUID x86 instruction http://x86.renejeschke.de/html/file_module_x86_id_45.html
... with gnu inline assembler syntax for C programs https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
That's it. Create a small inline C function that has an asm {} block in it and the single instruction inthere would be CPUID.Be aware of how to return values from these assembly blocks, gcc has a special syntax for it.
With this info, I reckon you can solve your problem.

George André
- 770
- 1
- 6
- 14
-
Thank you so much :). It help me a lot. Let me test it bro. – Blue Phoenix Aug 07 '15 at 16:46
-
@BluePhoenix please mark this as an answer if it solved your problem. – George André Feb 25 '16 at 13:12
-
Sure bro I will for sure, but I don't know how to :P wait pls. And I cant vote either since I don't have enough reputation here :( – Blue Phoenix Mar 06 '16 at 16:29
-
Andre Finally I found it :) – Blue Phoenix Mar 06 '16 at 16:33