2016-09-08 14:32:24 +00:00
|
|
|
/**
|
2016-09-11 20:20:15 +00:00
|
|
|
* Author......: See docs/credits.txt
|
2016-09-08 14:32:24 +00:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _WORDLIST_H
|
|
|
|
#define _WORDLIST_H
|
|
|
|
|
2016-09-11 08:28:59 +00:00
|
|
|
#define HEX_WORDLIST 0
|
|
|
|
#define SEGMENT_SIZE 32
|
|
|
|
|
2016-09-08 14:32:24 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char *buf;
|
|
|
|
u32 incr;
|
|
|
|
u32 avail;
|
|
|
|
u32 cnt;
|
|
|
|
u32 pos;
|
|
|
|
|
|
|
|
} wl_data_t;
|
|
|
|
|
|
|
|
uint convert_from_hex (char *line_buf, const uint line_len);
|
|
|
|
|
|
|
|
void load_segment (wl_data_t *wl_data, FILE *fd);
|
|
|
|
|
|
|
|
void get_next_word_lm (char *buf, u32 sz, u32 *len, u32 *off);
|
|
|
|
void get_next_word_uc (char *buf, u32 sz, u32 *len, u32 *off);
|
|
|
|
void get_next_word_std (char *buf, u32 sz, u32 *len, u32 *off);
|
|
|
|
|
|
|
|
void get_next_word (wl_data_t *wl_data, FILE *fd, char **out_buf, uint *out_len);
|
|
|
|
|
|
|
|
void pw_add (hc_device_param_t *device_param, const u8 *pw_buf, const int pw_len);
|
|
|
|
|
2016-09-12 10:59:40 +00:00
|
|
|
u64 count_words (wl_data_t *wl_data, FILE *fd, const char *dictfile, dictstat_ctx_t *dictstat_ctx);
|
|
|
|
|
2016-09-08 14:32:24 +00:00
|
|
|
#endif // _WORDLIST_H
|