Get Demo
  • Windows
  • MacOS
  • Linux

Integration into application

In the several steps described below, we will create a test application that interacts with the licensing system: it provides serial numbers, receives their status, and reads their contents. In the first stage, we use the licensing system in test mode; in the second stage, we use it as it would be in actual production.

Work modes of the licensing system

Building protection always goes through two main stages: development and release. For licensing, you first create an application, integrate protection into it, and then add checks and functional limitations. Only after thorough testing can you make the product available to users and begin the second stage. Testing a protected application is a complex process, because you need to ensure that all checks and conditional branches work correctly. Creating “real” serial numbers for all possible test cases is inconvenient. That is why the licensing system also offers a “developer mode” (also known as “test mode”). In this mode, no real protection is applied to the application, and the system’s responses to serial numbers are defined in a configuration file. When the application is free of bugs and correctly works with the licensing system, VMProtect replaces the “test” licensing module with the real one, which performs actual serial number validation. This happens during protection, so it cannot be skipped accidentally.

Stage 1: Test mode

In test mode, all responses of the licensing system (statuses and returned data) to serial numbers are described in a configuration file. The file is called “VMProtectLicense.ini” and should be located in the application’s working directory. In the 10 steps provided below, we will go from creating a simple application to full-featured use of the licensing system in test mode, including hardware locking and limiting the free upgrade period.

Stage 2: Real mode

In real mode, the VMProtect licensing system embeds a special licensing module into the protected application. This module performs the same functions as the test SDK module, but works with the contents of a serial number instead of a configuration INI file. The next five steps illustrate the process of protecting a simple application with full-featured protection based on VMProtect and the licensing system.

Additional information

Values of all bit flags, structure formats, and function call parameters can be found in the Licensing system API section of this help file. Use this section as a reference, while the steps above help you implement a typical ready-to-use protection.

Last updated 11 days ago