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

  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     unsigned char name[80], ch;
  6.     int i, len;
  7.     short int wkey = 0x3a97;
  8.     long lkey = 0x29a;
  9.  
  10.     printf("PC Baby v5.0 Registration Key generator\n");
  11.     printf("Enter the name that will appear on your registration\n>");
  12.     gets(name);
  13.  
  14.     len = strlen(name);
  15.     for (i=0; i < len; i++) {
  16.         ch = name[i] ^ (wkey >> 8);
  17.         wkey += ch;
  18.         wkey = wkey * 0xce6d + 0x58bf;
  19.         lkey += ch * (i + 1);
  20.     }
  21.  
  22.     printf("\nName\t\t   : %s\n", name);
  23.     printf("Registration Code  : %d\n", lkey);
  24.  
  25.     printf("\nEnter the above information into your PC Baby 98 Registration\n");
  26.     printf("dialog located in 'Help' menu.\n");
  27.     printf("NOTE: the name is case-sensitive\n");
  28.  
  29.     return 0;
  30. }