# Step 1.1: Creating a protected application

The first step is to create an application. This would be a simple app without any user interface and with no serious capabilities. Our goal is to pass a serial number to the licensing system and receive its answer..

    #include <windows.h>
    #include <stdio.h>

    bool is_registered(const char *serial)
    {
            return serial && serial[0] == 'X';
    }

    int main(int argc, char **argv)
    {
            char *serial = "Xserialnumber"; // we set the serial number directly in the code, for simplicity
            if (!is_registered(serial))
            {
                    printf("please register!\n");
                    return 0;
            }
            printf("We are registered.\n");
            return 0;
    }

The program uses a very simple way to check the serial number. The is_registered() function compares the first symbol of the serial number with 'X' and thinks the number is correct if this they match. For an incorrect serial number, a registration message is displayed, while if a user enter the correct key, "We are registered." is shown instead

The next step is to add the code to check the serial number using the licensing system of VMProtect.

© 2006-2015 Copyright VMProtect Software