1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-26 18:08:20 +00:00

Fix cp_sys type def and add ?H charset

This commit is contained in:
unix-ninja 2016-11-10 13:25:04 -05:00
parent 5f11231238
commit ca0bc3fc19
3 changed files with 13 additions and 1 deletions

View File

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

View File

@ -250,6 +250,8 @@ static int mp_expand (hashcat_ctx_t *hashcat_ctx, char *in_buf, size_t in_len, c
break; 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); 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; 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; } 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); rc = mp_add_cs_buf (hashcat_ctx, mp_usr[0].cs_buf, mp_usr[0].cs_len, mp_usr, mp_usr_offset);
break; break;
@ -354,6 +356,8 @@ static int mp_gen_css (hashcat_ctx_t *hashcat_ctx, char *mask_buf, size_t mask_l
break; break;
case 'h': rc = mp_add_cs_buf (hashcat_ctx, mp_sys[6].cs_buf, mp_sys[6].cs_len, css_buf, css_pos); case 'h': rc = mp_add_cs_buf (hashcat_ctx, mp_sys[6].cs_buf, mp_sys[6].cs_len, css_buf, css_pos);
break; 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; } 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); rc = mp_add_cs_buf (hashcat_ctx, mp_usr[0].cs_buf, mp_usr[0].cs_len, css_buf, css_pos);
break; break;
@ -522,6 +526,13 @@ static void mp_setup_sys (cs_t *mp_sys)
for (chr = 'a'; chr <= 'f'; chr++) { donec[chr] = 1; for (chr = 'a'; chr <= 'f'; chr++) { donec[chr] = 1;
mp_sys[6].cs_buf[pos++] = chr; mp_sys[6].cs_buf[pos++] = chr;
mp_sys[6].cs_len = pos; } 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) static int mp_setup_usr (hashcat_ctx_t *hashcat_ctx, cs_t *mp_sys, cs_t *mp_usr, char *buf, u32 index)

View File

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