Compare hwid base64 string to detect hardware change
Posted: Fri Jun 17, 2022 4:35 am
I plan to use activation code to limit my software to be installed in at most 3 different hardwares.
I plan to compare hwid base64 string returned by VMProtectGetCurrentHWID() to do the detection for simplicity.
But when I look into the weblm code. (I bought web license manager as well as vmprotect ultimate version). I saw this sql:
$sql = "SELECT licenseid, SUM(value) as c FROM " .
"(SELECT DISTINCT h.licenseid, h.type, CASE h.type WHEN 0 THEN 10 ELSE 1 END AS value FROM " .
"{$DB_PREFIX}hwdata h LEFT JOIN {$DB_PREFIX}licenses l ON h.licenseid=l.id WHERE " .
"l.activationid=" . Sql($act->id) . " AND l.blocked='0' AND h.value IN (" . Sql($hwdata) . ")) as t " .
"GROUP BY t.licenseid HAVING c>=12 ORDER BY c DESC LIMIT 1";
From my understanding, hwid (base64 decoded) is a collection of 4 bytes devices. From my own computer and some samples, hwid normally has less than 12 devices. So it means if type 0 device matches and 2 more devices match, the hardwares are considered equal. (Correct me if my understanding is incorrect)
So my questions:
1. What is this type 0 device?
2. If user does some minor change to the hardware, simply do hwid base64 string comparison would return different? It could annoy users.
3. If user reinstalls the same windows OS, would hwid returns the same?
Thanks.
I plan to compare hwid base64 string returned by VMProtectGetCurrentHWID() to do the detection for simplicity.
But when I look into the weblm code. (I bought web license manager as well as vmprotect ultimate version). I saw this sql:
$sql = "SELECT licenseid, SUM(value) as c FROM " .
"(SELECT DISTINCT h.licenseid, h.type, CASE h.type WHEN 0 THEN 10 ELSE 1 END AS value FROM " .
"{$DB_PREFIX}hwdata h LEFT JOIN {$DB_PREFIX}licenses l ON h.licenseid=l.id WHERE " .
"l.activationid=" . Sql($act->id) . " AND l.blocked='0' AND h.value IN (" . Sql($hwdata) . ")) as t " .
"GROUP BY t.licenseid HAVING c>=12 ORDER BY c DESC LIMIT 1";
From my understanding, hwid (base64 decoded) is a collection of 4 bytes devices. From my own computer and some samples, hwid normally has less than 12 devices. So it means if type 0 device matches and 2 more devices match, the hardwares are considered equal. (Correct me if my understanding is incorrect)
So my questions:
1. What is this type 0 device?
2. If user does some minor change to the hardware, simply do hwid base64 string comparison would return different? It could annoy users.
3. If user reinstalls the same windows OS, would hwid returns the same?
Thanks.