Multiple license activation not possible on same PC

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:

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…

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.

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.

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

/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.

Could you test this script on your server?

<?

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

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:

So I guess it’ll go away when running WebLM on a proper production server, and not on our test box.

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

P.S. Don’t forget about your modified field “hwdata.value” :slight_smile:)

Works!
Thanks :slight_smile: