Multiple license activation not possible on same PC

Issues related to VMProtect
Post Reply
ChMo
Posts: 21
Joined: Mon Aug 26, 2013 11:54 am

Multiple license activation not possible on same PC

Post by ChMo »

Looks like a WebLM bug.
I've written a small test application which just calls VMProtectActivateLicense with the entered activation code, and returns the result.
I've also created a product and an activation code for one activation on the weblm.vmpsoft.com test server.
Activating the generated code works fine, even if called multiple times on the same PC.
When called on another PC it fails, because the code is already in use.
That's perfectly fine.

Now I did the same thing with my copy of WebLM, but it behaved differently.
Activation worked once, and additional activations on the same hardware fail.

This is a part of the query that's executed by WebLM when checking if there is already an existing license for an activation code, thus the activation count doesn't need to be increased:

Code: Select all

FROM vmp_hwdata h
LEFT JOIN vmp_licenses l ON h.licenseid = l.id
WHERE l.activationid = '1603'
AND l.blocked = '0'
AND h.value
IN ( 593995064 , -598438031 , -2011063309 , -1054116846, 529625838 )
Only the two positive values can be found in the DB, the negative ones aren't present. There are "0" entries instead.

That's because the creation script...

Code: Select all

mysql_query("CREATE TABLE {$DB_PREFIX}hwdata (
id int primary key auto_increment,
licenseid int,
type int,
value int unsigned
..creates the HWID as unsigned. Thus negative values become 0.

I've now simply changed the field type to signed, and multiple activations work fine now.
Admin
Site Admin
Posts: 2586
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Multiple license activation not possible on same PC

Post by Admin »

Could you send us the HWID value for this issue?

P.S. Anyway we don't recommend to change your sources because you can get more bugs in the future.
ChMo
Posts: 21
Joined: Mon Aug 26, 2013 11:54 am

Re: Multiple license activation not possible on same PC

Post by ChMo »

Here's the request from the log file, containing a HWID:

Code: Select all

/weblm/activation.php?code=PHQN-PXTJ-4MYS&hwid=OKVnI3GPVNzzmyGIEnQrwe5ykR8%3D&hash=n%2F1kjw9KgHkKzCIGbljnaBPBQvs%3D
The test box has PHP 5.4 and MySQL 5.5.27 on Windows.
The HWID(s) were generated on two distinct Windows 7 x64 versions for testing.
Admin
Site Admin
Posts: 2586
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Multiple license activation not possible on same PC

Post by Admin »

Could you test this script on your server?

Code: Select all

<?

require_once "include/dbopen.inc.php";
require_once "include/activation.inc.php";

$hwdata = Hwdata::HwidDecode("OKVnI3GPVNzzmyGIEnQrwe5ykR8=");

echo Sql($hwdata)

?>

Here is our result:
http://weblm.vmpsoft.com/test.php
ChMo
Posts: 21
Joined: Mon Aug 26, 2013 11:54 am

Re: Multiple license activation not possible on same PC

Post by ChMo »

Code: Select all

593995064,-598438031,-2011063309,-1054116846,529625838
So our server does something in a different way, although using the same code.
Your code appears to be correct, you unpack it as "V*" - unsigned long LE.

It could some related to some supposedly fixed PHP bugs:
https://bugs.php.net/bug.php?id=47564
https://bugs.php.net/bug.php?id=52729

So I guess it'll go away when running WebLM on a proper production server, and not on our test box.
Admin
Site Admin
Posts: 2586
Joined: Mon Aug 21, 2006 8:19 pm
Location: Russia, E-burg
Contact:

Re: Multiple license activation not possible on same PC

Post by Admin »

The fixed hwdata.inc.php is attached. Please try it.

P.S. Don't forget about your modified field "hwdata.value" :))
Attachments
hwdata.inc.zip
(541 Bytes) Downloaded 462 times
ChMo
Posts: 21
Joined: Mon Aug 26, 2013 11:54 am

Re: Multiple license activation not possible on same PC

Post by ChMo »

Works!
Thanks :)
Post Reply