Get Demo
  • Windows
  • MacOS
  • Linux

Step 1.5: Checking the expiration date of the serial number

Now add a new line to the INI file in the following format: ExpDate=YYYYMMDD. For example:

ExpDate=20000101

The date specified in this line must already be in the past, that is, the maximum date is yesterday. When we run the program, we should see the following:

state = SERIAL_STATE_FLAG_DATE_EXPIRED
please register!

Now let’s retrieve some additional information before the “please register” message is shown and the program exits:

if (res)
{
    VMProtectSerialNumberData sd = {0};
    VMProtectGetSerialNumberData(&sd, sizeof(sd));
    printf("exp. date: y = %d, m = %d, d = %d\n",
           sd.dtExpire.wYear,
           sd.dtExpire.bMonth,
           sd.dtExpire.bDay);
    printf("please register!\n");
    return 0;
}

The second run of the app now provides more details:

state = SERIAL_STATE_FLAG_DATE_EXPIRED
exp. date: y = 2000, m = 1, d = 1
please register!

Now remove the ExpDate=… line from the INI file so it does not affect the rest of the steps.

Last updated 11 days ago