/* for creating WG3 activation codes */

#include <stdio.h>
#include <string.h>

void main(void)
{
    char    mask[11];
    char    regnum[11];
    char    key[11];
    int     i;

    strcpy(mask,    "1496012538");
    /*                 3   7     */
    strcpy(regnum, "451x969x29");

    for (i = 0; i != strlen(mask); ++i)
    {
        if (i != 3 && i != 7)
        {
            key[i] = 'A' + regnum[i] - '0';
            key[i] += mask[i] - '0';
        }
        else
        {
            key[i] = 'A' + regnum[i - 1] - '0';
            key[i] += mask[i] - '0';
        }
    }

    key[10] = 0;
    printf("%s\n", key);
}
