Serial number expiration date
Let’s create another serial number with a specific expiration date. For example, 2005. This date has already passed, so the serial number must be invalid. Switch to the “Licenses” section and click the “Add license” button on the toolbar. In the “Add license” dialog, enable the “Expiration date” option and set it to September 30, 2005. Create the serial number, copy it into serial.txt, and 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 a valid serial number back into serial.txt and verify that the licensing module accepts it correctly.
C:\test>dummy_app.vmp.exe
serial number is correct, calling foo()
I'm foo
done
Adding a serial number to the blacklist
Let’s assume our “good” serial number has leaked online and is now compromised. We need to block it so 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 after rebuilding the protected file, the application will no longer accept it. Let’s verify this. If we run our program now, it should still accept the serial number, because this is the old version that is unaware of the blacklist:
C:\test>dummy_app.vmp.exe
serial number is correct, calling foo()
I'm foo
done
Now we make a copy of the program and name it “dummy_app1.vmp.exe”, then open VMProtect and protect the application again. Then run the 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 does not know about the blocked serial number and continues to work as before.
On the next step we will try locking code to a serial number. Before proceeding, unblock the serial number and reapply protection in VMProtect so the application accepts it again, or simply create a new license.