<title>Step 1.1: Creating a protected application</title>
</head>
<body>
<h1>Step 1.1: Creating a protected application</h1>
<p>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..</p>
<preclass="code">#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;
}
</pre>
<p>The program uses a very simple way to check the serial number. The <strong>is_registered()</strong> 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</p>
<p>The <ahref="step12_code.htm">next step</a> is to add the code to check the serial number using the licensing system of