Step 2.4: Testing the results
Serial number expiration date
Let’s create another serial number with a certain expiration date. For example, 2005. This date has already passed and therefore our serial number must be incorrect. Switch to the “Licenses” section and click the “Add license” button on the toolbar. In the “Add license” dialog window enable the “Expiration date” option and specify September 30, 2005. Create the serial number, copy it and paste to serial.txt, then run the program:
C:\test>dummy_app.vmp.exe serial number is bad state = SERIAL_STATE_FLAG_DATE_EXPIRED
the licensing module returned the “serial number is expired” flag. Now, put the working serial number back to the serial.txt file and make sure the licensing module accepts it perfectly.
C:\test>dummy_app.vmp.exe serial number is correct, calling foo() I'm foo done
Adding a serial number to the black list
Let’s imagine our “good” serial number has leaked to the Internet and is compromised now. We need to block it so that it will not work in future versions of the program. To do this, select the serial number in the list and set the “Blocked” property in the main panel to “Yes”. For now, the serial number is not yet blocked, but when you protect the file again, the application will not accept this number any more. Let’s make sure this is really so. If we run our program now, it should accept the blocked serial number without any problems, because this is the old version that knows nothing about the blocked number:
C:\test>dummy_app.vmp.exe serial number is correct, calling foo() I'm foo done
Now we make a copy of our program and name it as “dummy_app1.vmp.exe”, then open VMProtect and protect the application again. Then run this new version:
C:\test>dummy_app.vmp.exe serial number is bad state = SERIAL_STATE_FLAG_BLACKLISTED
And the old version again, for comparison:
C:\test>dummy_app1.vmp.exe serial number is correct, calling foo() I'm foo done
The older version doesn’t know about the blocked serial number and works as before.
On the next step we will try to lock the code to a serial number. But before we proceed, unblock the serial number and reapply protection in VMProtect to the application to make it accept this serial number again. Or simply create a new license.