Step #4: Get user name and e-mail
Let’s start from the simplest things: let’s get user name and e-mail from the serial number. We may show them in “About” window in the real application, but we’ll just print them. As we are in test mode, the licensing module will read data from INI-file instead of serial number, so we need to put name and e-mail to INI-file. Let’s add two lines to our INI-file:
[TestLicense] AcceptedSerialNumber=Xserialnumber UserName=John Doe EMail=john@doe.com
Now we need to modify our application. In case of successful registration, let’s get more data about the serial number:
VMProtectSerialNumberData sd = {0};
VMProtectGetSerialNumberData(&sd, sizeof(sd));
printf("name = %ls,\ne-mail = %ls\n", sd.wUserName, sd.wEMail);
VMProtectSerialNumberData structure stores strings in UNICODE, so we have to use “%ls” markers for printf() instead of “%s”. If you run the application, you should see the following:
state = 0 We are registered. name = John Doe, e-mail = john@doe.com