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