Home » Support » User Manual » The Software Licensing System » Example of usage

Example of usage

In a few steps described below, we’ll create a test application that will operate with licensing module: put serial numbers and get states and data. At the first stage we’ll use licensing module in the “test” mode and at the second state, we’ll use it in the “real” mode.

Supported modes of licensing module

There are two stages at software protection implementation: development and usage. At first you create application, add protection modules and code, then test them all and only after that you give the application to customers and the second phase begins. Testing of protected application is a complex and complicated process: you have to check every limitation, every branch of code that will work or not depending on serial number. It is not a good idea to test protection code with real serial numbers – it is difficult. That’s why the licensing system has “test” mode. In test mode application is not being protected and work with emulator of licensing module that works exactly as the real module, but doesn’t analyze serial numbers. Every aspect of its work is defined in INI-file: accepted and blacklisted serial numbers, date of expiration, user name etc – everything is read from INI-file. You may use various INI-files or create them on-the-fly and test your appliation and protection code. When application is tested and works fine with emulation of licensing module, you will protect the application using VMProtect and it will replace emulator with the real licensing module that will not read INI-file and that will check contents of serial numbers.

Stage #1: Test mode

In test mode everything is defined by INI-file. Licensing module emulator reads VMProtectLicense.ini from the working directory of application. In the next 10 steps we’ll go from creation of simple application to hardware locking and limitation of period of free updates.

Stage #2: Real mode

When VMProtect protects the application, it replaces emulator of licensing module with the real module. It works exactly as emulator, but doesn’t read INI-files. It reads serial number contents instead. In the next 5 steps we’ll build another simple application and protect if with “real” protection using VMProtect.

Notes

Steps above is a good tutorial with examples of real-world tasks, but if you need to know values of flags, format of structures or functions arguments – everything is listed in Licensing Module API section.