From 57a70710aee075924eb8f96fb777fa556c39df0f Mon Sep 17 00:00:00 2001 From: jsteube Date: Wed, 20 Sep 2017 11:03:38 +0200 Subject: [PATCH] Small wordlist loading performance optimization --- src/dispatch.c | 4 ++++ src/wordlist.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dispatch.c b/src/dispatch.c index c3a36ad1b..81ca61fb8 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -154,6 +154,8 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par u32 words_extra_total = 0; + memset (device_param->pws_buf, 0, device_param->size_pws); + while (device_param->pws_cnt < device_param->kernel_power) { char *line_buf = fgets (buf, HCBUFSIZ_LARGE - 1, stdin); @@ -483,6 +485,8 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) u32 words_extra_total = 0; + memset (device_param->pws_buf, 0, device_param->size_pws); + while (words_extra) { const u32 work = get_work (hashcat_ctx, device_param, words_extra); diff --git a/src/wordlist.c b/src/wordlist.c index 60a5f59fb..0e989f01a 100644 --- a/src/wordlist.c +++ b/src/wordlist.c @@ -248,7 +248,8 @@ void pw_add (hc_device_param_t *device_param, const u8 *pw_buf, const int pw_len memcpy (ptr, pw_buf, pw_len); - memset (ptr + pw_len, 0, sizeof (pw->i) - pw_len); + //memset zero to entire buffer done in outer loop + //memset (ptr + pw_len, 0, sizeof (pw->i) - pw_len); pw->pw_len = pw_len;