From 7e3905e1dbeefc55d9c605193b6b21e29a5a1e9a Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 30 Sep 2016 11:50:13 +0200 Subject: [PATCH] Make dictstat support modular --- src/dictstat.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/dictstat.c b/src/dictstat.c index 12766618b..f8a0b73e9 100644 --- a/src/dictstat.c +++ b/src/dictstat.c @@ -29,15 +29,20 @@ void dictstat_init (dictstat_ctx_t *dictstat_ctx, const user_options_t *user_opt { dictstat_ctx->enabled = false; - if (user_options->show == true) return; - if (user_options->left == true) return; - if (user_options->keyspace == true) return; - if (user_options->benchmark == true) return; + if (user_options->benchmark == true) return; + if (user_options->keyspace == true) return; + if (user_options->left == true) return; + if (user_options->show == true) return; + if (user_options->usage == true) return; + if (user_options->version == true) return; + + if (user_options->attack_mode == ATTACK_MODE_BF) return; + + dictstat_ctx->enabled = true; dictstat_ctx->filename = (char *) mymalloc (HCBUFSIZ_TINY); dictstat_ctx->base = (dictstat_t *) mycalloc (MAX_DICTSTAT, sizeof (dictstat_t)); dictstat_ctx->cnt = 0; - dictstat_ctx->enabled = true; snprintf (dictstat_ctx->filename, HCBUFSIZ_TINY - 1, "%s/hashcat.dictstat", folder_config->profile_dir); } @@ -48,6 +53,8 @@ void dictstat_destroy (dictstat_ctx_t *dictstat_ctx) myfree (dictstat_ctx->filename); myfree (dictstat_ctx->base); + + myfree (dictstat_ctx); } void dictstat_read (dictstat_ctx_t *dictstat_ctx)