home *** CD-ROM | disk | FTP | other *** search
- //******************************************************************
- //* solution for CrackMe Level 1 By noos@nettaxi.com *
- //* solved By Nuno1 on 22 july 1999 *
- //* any comments can be sent to nuno_2@hotmail.com *
- //******************************************************************
-
- //This file will search for all combinations until reach the
- //The Result.
-
- //the Key is 692659380
-
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- #include <time.h>
- //CharTables for the Key.
- const char CHARTABLE[26] ={'A','B','C','D','E','F','G','H','I','J','K','L',
- 'M','N','O','P','Q','R','S','T','U','V','W','X',
- 'Y','Z'};
-
- //**********************************************//
- // Print a logo for the program
- //**********************************************//
-
- void PrintLogo() {
- printf("************************************************\n");
- printf("solution for CrackMe Level 1 By noos@nettaxi.com\n");
- printf(" solved By Nuno1 on 22 july 1999 \n");
- printf(" any comments can be sent to nuno_2@hotmail.com \n");
- printf("************************************************\n");
- }
- //*********************************************//
- // Main Program //
- //*********************************************//
-
- void main() {
- unsigned long Count=0; //This will the Key when finished.
- unsigned long MyNumber=0;
- unsigned long TempNumber=0;
-
- char *RESULT ="TSSFTMEZDPKS"; //The result we need to get to.
- char *Code; //our build Key.
- int t;
- time_t ti; //solving how much time it took.
- time_t t1;
- int Min , Sec;
- //Print the logo
- PrintLogo();
- //get the current timer to resolve the total time it took.
- ti = time(NULL);
- printf("Please wait while computing the key .......");
- Code = (char *)malloc(13); //Get space for the code , the code
- //must be 13 characters.
- Code[12] = 0;
- //srand is just take the number you gave him and keep it.
- while(1) { //unfinished loop
- MyNumber = Count; //start the calculation
- for(t=0;t<=11;t++) {
- //This is rand function
- MyNumber = MyNumber * 0x343fd;
- MyNumber += 0x269ec3;
- TempNumber = MyNumber;
- TempNumber = TempNumber >> 0x10;
- TempNumber = TempNumber & 0x000007FFF;
-
- TempNumber = TempNumber % 0x1a;
- Code[t] =CHARTABLE[TempNumber];
- //Compare each character with the result.
- //if its not we break (t will not be 12).
- if (Code[t] != RESULT[t]) break;
- }
- //when t ==12 the code as been build.
- if(t == 12) {
- printf("\n%s = %ld \n",Code,Count);
- //take the current time
- t1 = time(NULL);
- t1 = t1 - ti; //sub it with the firs time.
- //we assume it will not take more then a hour.
- Min = t1 / 60; // take the minutes.
- Sec = t1 % 60; // take the seconds.
-
- printf("The search took %d minutes and %d seconds.\n",Min,Sec);
- //exit.
- exit(1);
- }
- //each time increate the counter by one.
- Count ++;
-
- }
- }
-
- //end of program.
-