home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Quantico / km / avp101lc.c.txt < prev    next >
Encoding:
Text File  |  2000-05-25  |  1.3 KB  |  61 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. void genlic(unsigned char *name, unsigned char *company, unsigned char *lic)
  5. {
  6.     int i, len, sum1=0xe, sum2=0x2e;
  7.     char ser1[10]="*1*632*85", ser2[9]="0829****";
  8.     char buf1[10];
  9.     long int sl1;
  10.     char tch1;
  11.  
  12.     for (i=0; i<5; i++)
  13.         sum1 += name[i];
  14.  
  15.     itoa(sum1, buf1, 10);
  16.     ser1[6] = buf1[0];
  17.     ser1[2] = buf1[1];
  18.     ser1[0] = buf1[2];
  19.  
  20.     sscanf(ser1, "%lu", &sl1);
  21.     sprintf(ser1, "%lX", sl1);
  22.     tch1 = ser1[0];
  23.     ser1[0] = ser1[1];
  24.     ser1[1] = ser1[2];
  25.     ser1[2] = tch1;
  26.  
  27.     len = strlen(name);
  28.     for (i=0; i<len; i++)
  29.         sum2 += name[i] + 2;
  30.     len = strlen(company);
  31.     for (i=0; i<len; i++)
  32.         sum2 += company[i] + 1;
  33.     sprintf(ser2 + 4, "%04u", sum2);
  34.  
  35.     sscanf(ser2, "%lu", &sl1);
  36.     sprintf(ser2, "%lX", sl1);
  37.     tch1 = ser2[0];
  38.     ser2[0] = ser2[1];
  39.     ser2[1] = tch1;
  40.  
  41.     strcpy(lic, ser1);
  42.     strcat(lic, "G");
  43.     strcat(lic, ser2);
  44. }
  45.  
  46. void main()
  47. {
  48.     char name[100]="", company[100]="", lic[100];
  49.  
  50.     printf("Allvue Pro 1.01 License # generator\n");
  51.     printf("\nEnter Name (5 chars min) > ");
  52.     gets(name);
  53.     printf("Enter Company            > ");
  54.     gets(company);
  55.     genlic(name, company, lic);
  56.     printf("\nName    : %s\n", name);
  57.     printf("Company : %s\n", company);
  58.     printf("License : %s\n", lic);
  59.     printf("\nEnter the above info into your Allvue registration dialog.\n");
  60.     printf("NOTE: strings are case-sensitive\n");
  61. }