home *** CD-ROM | disk | FTP | other *** search
- #include <stdlib.h>
- #include <stdio.h>
- #include <conio.h>
-
- #define EQUATIONS 1008
-
- unsigned char buffer[200];
- FILE *plik, *out;
- int chars, passbits, i, j, cos;
-
- main()
- {
- cputs("\r\n╔══════════════════════════════════════════════════════════════════════════════╗");
- cputs("║ TEST4 by LordByte SOLVED ║");
- cputs("║ All the hard work was done in 1997 by CR00CK ║");
- cputs("║ Firstly, run TESTCRK, and then SHOWEQU, entering same number in both ║");
- cputs("║ Then, check EQU.TXT - numbers on the left are bit numbers in password ║");
- cputs("║ On the right you have value, which you should get after XORING bits ║");
- cputs("║ If there is nothing on the left side (line is = 1), it means there are some ║");
- cputs("║ CONTRADICTORY equations, so password of this length cannot be found ║");
- cputs("║ CR00CK ║");
- cputs("╚══════════════════════════════════════════════════════════════════════════════╝");
- if ((plik = fopen("EQU.DAT", "rb")) == NULL)
- {
- printf("\nCannot find EQU.DAT!\n");
- return 255;
- }
- do {
- printf("How many chars (1 - 12): ");
- scanf("%i", &chars);
- } while (chars < 1 || chars > 12);
- passbits = chars * 8;
- if ((out = fopen("EQU.TXT", "w")) == NULL)
- {
- printf("\nCannot create EQU.TXT!\n");
- return 255;
- }
-
- for (i = 0; i < EQUATIONS; i++)
- {
- fread(buffer, passbits + 1, 1, plik);
- cos = 0;
- for (j = 0; j < passbits; j++)
- if (buffer[j])
- {
- fprintf(out, "%i, ", j);
- cos = 1;
- }
- if (cos || buffer[passbits])
- fprintf(out, "= %i\n", buffer[passbits]);
- }
- fclose(plik);
- fclose(out);
-
- return 0;
- }