From 03b7d08585aad9949a0e0f2751a37f78cc6e6b6c Mon Sep 17 00:00:00 2001 From: jsteube Date: Sat, 24 Sep 2016 13:10:19 +0200 Subject: [PATCH] Move debugfile_init() out of outer loop --- src/hashcat.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/hashcat.c b/src/hashcat.c index 5af498315..7cc020b59 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -76,7 +76,6 @@ #include "outfile_check.h" #include "weak_hash.h" #include "remove.h" -#include "debugfile.h" #include "runtime.h" #include "attack_mode.h" #include "powertune.h" @@ -350,16 +349,6 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_ bitmap_ctx_init (bitmap_ctx, user_options, hashconfig, hashes); - /** - * debugfile - */ - - debugfile_ctx_t *debugfile_ctx = mymalloc (sizeof (debugfile_ctx_t)); - - data.debugfile_ctx = debugfile_ctx; - - debugfile_init (debugfile_ctx, user_options->debug_mode, user_options->debug_file); - /** * word len */ @@ -3156,8 +3145,6 @@ static int outer_loop (user_options_t *user_options, user_options_extra_t *user_ local_free (masks); - debugfile_destroy (debugfile_ctx); - potfile_write_close (potfile_ctx); wl_data_destroy (wl_data); @@ -3434,6 +3421,16 @@ int main (int argc, char **argv) loopback_init (loopback_ctx); + /** + * debugfile init + */ + + debugfile_ctx_t *debugfile_ctx = mymalloc (sizeof (debugfile_ctx_t)); + + data.debugfile_ctx = debugfile_ctx; + + debugfile_init (debugfile_ctx, user_options->debug_mode, user_options->debug_file); + /** * cpu affinity */ @@ -3561,6 +3558,8 @@ int main (int argc, char **argv) local_free (rd); + debugfile_destroy (debugfile_ctx); + rules_ctx_destroy (rules_ctx); tuning_db_destroy (tuning_db);