How to get HWID in C++

12,145

I believe this is what you are looking for:

HW_PROFILE_INFO hwProfileInfo;
if (GetCurrentHwProfile(&hwProfileInfo))
    printf("HWID: %s\n", hwProfileInfo.szHwProfileGuid);

There is no guarantee this value won't change though. This is the GUID of current hardware profile on Windows, but it can be set up to have more than one of those.

I believe this GUID will change automatically if there's a drastic hardware change, like replacing the motherboard. Though this would also deactivate the Windows license, so I suppose Windows too rely on hardware profile to validate it's licensing.

Share:
12,145
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I'm making a program, to stop pirating i'm adding a hwid lock. I want to use the output of the wmic command wmic csproduct get uuid. However I am not sure how to set its output as a variable.

  • Marek Kijo
    Marek Kijo over 3 years
    It is not the same data