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

  1. #include <stdio.h>
  2. #include <time.h>
  3.  
  4. unsigned int Now() {
  5.     time_t timer;
  6.     struct tm* ptm;
  7.  
  8.     timer = time(NULL);
  9.     ptm = localtime(&timer);
  10.  
  11.     return ptm->tm_year * 365 + (ptm->tm_year - 1) / 4 + ptm->tm_yday + 2;
  12. }
  13.  
  14. void main()
  15. {
  16.     unsigned long today, code1, code2, code3, tcode;
  17.     char authcode[100];
  18.  
  19.     printf("Financial Engineer Authorization String Generator (by Fossil)\n");
  20.  
  21.     today = Now();
  22.     code1 = (today - 2712) * 13 + 81193;
  23.     code2 = (today + 90 - 2712) * 13 + 81193;
  24.     code3 = 0;
  25.     tcode = code2;
  26.     while (tcode > 0) {
  27.         code3 += tcode % 10;
  28.         tcode = tcode / 10;
  29.     }
  30.  
  31.     printf("\nAuthorization code : %luP0%lu%02u\n", code1, code2, code3);
  32.     printf("\nNOTE: This code is valid *today* only !\n");
  33. }