0

I'm trying to generate a unique hardware id for my application and I saw something simple but it's from autoit, the function is _WinAPI_UniqueHardwareID() which generate unique id base on hardware and changes every time you change/add something on your computer. My question is there a similar function in c++ or simplest way to generate similar output.

NOTE: for windows only and as I said, if there is no similar , how to do this in c++?

Ahmed Masud
  • 21,655
  • 3
  • 33
  • 58
  • 2
    The C++ standard does not describe any method of acquiring hardware specific information. For this, you'll have to rely on compiler extensions/external libraries. – randomusername Apr 28 '14 at 02:10
  • What system familly are you targetting? – Paweł Stawarz Apr 28 '14 at 02:13
  • Possible duplicate of http://stackoverflow.com/questions/18328129/detect-hardware-information-in-c-application, http://stackoverflow.com/questions/4253164/how-to-get-hardware-information-in-windows-using-c, http://stackoverflow.com/questions/3722384/query-hardware-specific-information-on-windows-with-c, etc. – jweyrich Apr 28 '14 at 02:19

1 Answers1

2

There's no way to do that in C++ itself. This feature is completely platform dependent. On Windows, you got some way to do with _WinAPI_UniqueHardwareID. Other systems you need to do this "analog function by yourself"... example: getting CPU id + Network MAC Address + Harddrive size + memory size + ... + whatever the platform delivers to you!

Some systems you can be UNABLE to do that... for example, iOS you just can't grab any information from hardware ENOUGH to identify the device as that particular device...

in other words: isn't not related to C/C++... it's completely related to the platform!

Wagner Patriota
  • 5,494
  • 26
  • 49