1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-15 12:29:35 +00:00

Make dictstat support modular

This commit is contained in:
jsteube 2016-09-30 11:50:13 +02:00
parent 8034fb31b8
commit 7e3905e1db

View File

@ -29,15 +29,20 @@ void dictstat_init (dictstat_ctx_t *dictstat_ctx, const user_options_t *user_opt
{ {
dictstat_ctx->enabled = false; dictstat_ctx->enabled = false;
if (user_options->show == true) return; if (user_options->benchmark == true) return;
if (user_options->left == true) return; if (user_options->keyspace == true) return;
if (user_options->keyspace == true) return; if (user_options->left == true) return;
if (user_options->benchmark == 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->filename = (char *) mymalloc (HCBUFSIZ_TINY);
dictstat_ctx->base = (dictstat_t *) mycalloc (MAX_DICTSTAT, sizeof (dictstat_t)); dictstat_ctx->base = (dictstat_t *) mycalloc (MAX_DICTSTAT, sizeof (dictstat_t));
dictstat_ctx->cnt = 0; dictstat_ctx->cnt = 0;
dictstat_ctx->enabled = true;
snprintf (dictstat_ctx->filename, HCBUFSIZ_TINY - 1, "%s/hashcat.dictstat", folder_config->profile_dir); 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->filename);
myfree (dictstat_ctx->base); myfree (dictstat_ctx->base);
myfree (dictstat_ctx);
} }
void dictstat_read (dictstat_ctx_t *dictstat_ctx) void dictstat_read (dictstat_ctx_t *dictstat_ctx)