#include #include #include int countbits(int val) { int res=0; while (val) { if (val & 1) res++; val >>= 1; } return res; } void main() { char name[100]; int kp1=0, kp2=0, kp3=0, kp4=0, kp5, kp6=12, kp7=345, kp8=678, kp9=901; int cnt, lenstr, var1, var2, var3; printf("Live Image Wizard v1.26 License Key Generator\n"); printf("Enter the name that will appear on your registration\n>"); gets(name); lenstr = strlen(name); var1 = lenstr / 4; var2 = lenstr / 2; var3 = lenstr * 3 / 4; for (cnt=0; cnt cnt) kp1 = (name[cnt] + kp1) % 10; if (var2 > cnt) kp2 = (name[cnt] + kp2) % 10; if (var3 > cnt) kp3 = (name[cnt] + kp3) % 10; kp4 = (name[cnt] + kp4) % 10; } kp5 = ( countbits(kp1 * 1000 + kp6) + countbits(kp2 * 1000 + kp7) + countbits(kp3 * 1000 + kp8) + countbits(kp4 * 1000 + kp9) + 1 ) % 10; printf("\nUsername : %s\n", name); printf("License Key : %d%03d%d%03d-%d%03d%d-%03d%d\n", kp1, kp6, kp2, kp7, kp3, kp8, kp4, kp9, kp5); printf("\nEnter the above information into your Live Image registration\n"); printf("dialog (NOTE: Username is case sensitive)\n"); }