| 1 |
root |
1.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 |
|
|
extern int use_unzip; |
| 28 |
|
|
|
| 29 |
|
|
#define FILE_SIZE 12 |
| 30 |
|
|
#define CRC_SIZE 2 |
| 31 |
|
|
#define HEADER_SIZE (FILE_SIZE+CRC_SIZE) |
| 32 |
|
|
|
| 33 |
|
|
#define MAX_FILES 8 |
| 34 |
|
|
|
| 35 |
|
|
extern u8 files[MAX_FILES*HEADER_SIZE]; |
| 36 |
|
|
extern const char *file_path[MAX_FILES]; |
| 37 |
|
|
extern int file_count; |
| 38 |
|
|
|
| 39 |
|
|
typedef struct { |
| 40 |
|
|
char *desc; |
| 41 |
|
|
void (*init_crack_pw)(void); |
| 42 |
|
|
int (*crack_pw)(gen_func, callback_func); |
| 43 |
|
|
void (*load_file)(const char *); |
| 44 |
|
|
} method; |
| 45 |
|
|
|
| 46 |
|
|
extern method methods[]; |
| 47 |
|
|
extern int default_method; |
| 48 |
|
|
|
| 49 |
|
|
#endif |