1 #ifndef CRACK_H 2 #define CRACK_H 3 4 #define MAX_PW 40 /* should be low, but conservative. */ 5 #define BENCHMARK_LOOPS 5000000 6 7 extern u8 pw[MAX_PW+1]; 8 extern u8 *pw_end; 9 10 /* a gen_func must modify the global variables "pw" and "pw_end" to the next 11 * password to be checked and return the number of characters that have 12 * changed, counting from the end, or zero, to indicate end of cracking. 13 */ 14 typedef int (*gen_func)(void); 15 16 /* a callback_func can investigate the passed password. nonzero 17 * return values stop cracking (and the return value will be handed 18 * out to the caller. 19 */ 20 typedef int (*callback_func)(const char *, const char *); 21 22 /* brute force. */ 23 extern u8 bf_next[256]; 24 extern u8 bf_last; 25 26 extern int verbosity; 27 28 #define FILE_SIZE 12 29 #define CRC_SIZE 2 30 #define HEADER_SIZE (FILE_SIZE+CRC_SIZE) 31 32 #define MAX_FILES 8 33 34 extern u8 files[MAX_FILES*HEADER_SIZE]; 35 extern const char *file_path[MAX_FILES]; 36 extern int file_count; 37 38 typedef struct { 39 char *desc; 40 void (*init_crack_pw)(void); 41 int (*crack_pw)(gen_func, callback_func); 42 void (*load_file)(const char *); 43 } method; 44 45 extern method methods[]; 46 extern int default_method; 47 48 #endif 49