Fix cp_sys type def and add ?H charset

pull/576/head
unix-ninja 8 years ago
parent 5f11231238
commit ca0bc3fc19

@ -1518,7 +1518,7 @@ typedef struct mask_ctx
{
bool enabled;
cs_t mp_sys[6];
cs_t mp_sys[8];
cs_t mp_usr[4];
u64 bfs_cnt;

@ -250,6 +250,8 @@ static int mp_expand (hashcat_ctx_t *hashcat_ctx, char *in_buf, size_t in_len, c
break;
case 'h': rc = mp_add_cs_buf (hashcat_ctx, mp_sys[6].cs_buf, mp_sys[6].cs_len, mp_usr, mp_usr_offset);
break;
case 'H': rc = mp_add_cs_buf (hashcat_ctx, mp_sys[7].cs_buf, mp_sys[7].cs_len, mp_usr, mp_usr_offset);
break;
case '1': if (mp_usr[0].cs_len == 0) { event_log_error (hashcat_ctx, "Custom-charset 1 is undefined"); return -1; }
rc = mp_add_cs_buf (hashcat_ctx, mp_usr[0].cs_buf, mp_usr[0].cs_len, mp_usr, mp_usr_offset);
break;
@ -354,6 +356,8 @@ static int mp_gen_css (hashcat_ctx_t *hashcat_ctx, char *mask_buf, size_t mask_l
break;
case 'h': rc = mp_add_cs_buf (hashcat_ctx, mp_sys[6].cs_buf, mp_sys[6].cs_len, css_buf, css_pos);
break;
case 'H': rc = mp_add_cs_buf (hashcat_ctx, mp_sys[7].cs_buf, mp_sys[7].cs_len, css_buf, css_pos);
break;
case '1': if (mp_usr[0].cs_len == 0) { event_log_error (hashcat_ctx, "Custom-charset 1 is undefined"); return -1; }
rc = mp_add_cs_buf (hashcat_ctx, mp_usr[0].cs_buf, mp_usr[0].cs_len, css_buf, css_pos);
break;
@ -522,6 +526,13 @@ static void mp_setup_sys (cs_t *mp_sys)
for (chr = 'a'; chr <= 'f'; chr++) { donec[chr] = 1;
mp_sys[6].cs_buf[pos++] = chr;
mp_sys[6].cs_len = pos; }
for (pos = 0, chr = '0'; chr <= '9'; chr++) { donec[chr] = 1;
mp_sys[7].cs_buf[pos++] = chr;
mp_sys[7].cs_len = pos; }
for (chr = 'A'; chr <= 'F'; chr++) { donec[chr] = 1;
mp_sys[7].cs_buf[pos++] = chr;
mp_sys[7].cs_len = pos; }
}
static int mp_setup_usr (hashcat_ctx_t *hashcat_ctx, cs_t *mp_sys, cs_t *mp_usr, char *buf, u32 index)

@ -375,6 +375,7 @@ static const char *USAGE_BIG[] =
" u | ABCDEFGHIJKLMNOPQRSTUVWXYZ",
" d | 0123456789",
" h | 0123456789abcdef",
" H | 0123456789ABCDEF",
" s | !\"#$%%&'()*+,-./:;<=>?@[\\]^_`{|}~",
" a | ?l?u?d?s",
" b | 0x00 - 0xff",

Loading…
Cancel
Save