4 static unsigned char *ptr[100];
16 static int active[100];
19 static int active_pos;
27 memset(max, 0, sizeof(max));
29 for (b = 0; b < 0x800; b++)
32 for (i = 0; i < activec; i++)
34 for (u = i + 1; u < activec; u++)
36 if (ptr[active[i]][b] == ptr[active[u]][b])
45 for (i = 0; i < M; i ++)
66 printf("no solution!\n");
70 for (i = 0; i < M; i++)
79 active_pos = max[i].pos;
80 printf("0x%03X (%d) ", active_pos, max[i].cnt);
92 for (i = 0; i < activec; i++)
94 for (j = 0; j < activec; j++)
100 if (ptr[active[i]][active_pos] ==
101 ptr[active[j]][active_pos])
111 for (i = 0; i < activec; i++)
113 printf("%02X ", ptr[active[i]][active_pos]);
118 memcpy(active, tmpa, sizeof(active));
123 main(int argc, char *argv[])
137 for (i = 0; i < ptrc; i++)
139 ptr[i] = malloc(0x800);
140 f = fopen(argv[i + 1], "rb");
141 fread(ptr[i], 1, 0x800, f);