home *** CD-ROM | disk | FTP | other *** search
/ Cracking 2 / Cracking II..iso / Texty / crackme / dl4gen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-04-29  |  1.7 KB  |  62 lines

  1. // This is the C++ Source Code of my KeyGEN. I hope you like it.
  2. // I've compiled it using Symantec C/C++ 6.11
  3.  
  4. #include <ctype.h>
  5. #include <stdio.h>
  6.  
  7. int main()
  8. {
  9. short int i=0;
  10. short int x=0;
  11. char constant_1[] = "A1LSK2DJF4HGP3QWO5EIR6UTZY8MXN7CBV9";
  12. char constant_2[] = "SU7CSJKF09NCSDO9SDF09SDRLVK7809S4NF";
  13. char name[10] = {0};
  14.  
  15. printf("   ____                     __       __\n");
  16. printf("  /  _/_ _  __ _  ___  ____/ /____ _/ /\n");
  17. printf(" _/ //  ' \\/  ' \\/ _ \\/ __/ __/ _ `/ /\n");
  18. printf("/___/_/_/_/_/_/_/\\___/_/  \\__/\\_,_/_/\n");
  19. printf("   ____                          __          __\n");
  20. printf("  / __ \\___ ___ _______ ___  ___/ /__ ____  / /____\n");
  21. printf(" / /_/ / -_|_-</ __/ -_) _ \\/ _  / _ `/ _ \\/ __(_-<\n");
  22. printf("/_____/\\__/___/\\__/\\__/_//_/\\_,_/\\_,_/_//_/\\__/___/\n\n");
  23.  
  24. for (;;){ 
  25. printf("\nDuelist's CrackMe 4.0 KeyGEN - d0NE bY TORN@DO in '99\n");
  26. printf("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
  27. printf("User Name:         ");
  28. gets(name);
  29.  
  30. if (strlen(name)<1) return 0;
  31.  
  32. if (strlen(name)>8)
  33.  {printf("ERROR:             Name can't be greater than 8 chars long!");
  34.   exit(-1);
  35.  }
  36.  
  37. else break;
  38. }
  39.  
  40. // convert to uppercase
  41. for (i=1; i<=strlen(name); i++) name[i-1] = toupper(name[i-1]);
  42.  
  43. // check for illegal characters
  44. for (i=1; i<=strlen(name); i++)
  45. if (!isalpha(name[i-1]))
  46. {
  47.  
  48.    if (!isdigit(name[i-1]) || name[i-1] == 0x30)
  49.    {printf("ERROR:             Name may only contain chars A to Z and numbers 1 to 9!");
  50.     exit(-1);}
  51. }
  52.  
  53.  
  54. printf("Registration Code: ");
  55.  
  56. // print out registration code
  57. for (i=1; i<=(strlen(name)); i++)
  58.  for (x=1; x <= strlen(constant_1); x++)
  59.  if (name[i-1] == constant_1[x-1]) printf("%c", constant_2[x-1]);
  60.  
  61. return 0;
  62. }