diff --git a/include/outfile_check.h b/include/outfile_check.h index 22a563245..a0dcd8bc6 100644 --- a/include/outfile_check.h +++ b/include/outfile_check.h @@ -13,7 +13,7 @@ void *thread_outfile_remove (void *p); -int outcheck_ctx_init (outcheck_ctx_t *outcheck_ctx, const user_options_t *user_options, const folder_config_t *folder_config); -void outcheck_ctx_destroy (outcheck_ctx_t *outcheck_ctx); +int outcheck_ctx_init (hashcat_ctx_t *hashcat_ctx); +void outcheck_ctx_destroy (hashcat_ctx_t *hashcat_ctx); #endif // _OUTFILE_CHECK_H diff --git a/src/hashcat.c b/src/hashcat.c index 508e7767c..16ca49c02 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -1241,7 +1241,6 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold induct_ctx_t *induct_ctx = hashcat_ctx->induct_ctx; logfile_ctx_t *logfile_ctx = hashcat_ctx->logfile_ctx; loopback_ctx_t *loopback_ctx = hashcat_ctx->loopback_ctx; - outcheck_ctx_t *outcheck_ctx = hashcat_ctx->outcheck_ctx; status_ctx_t *status_ctx = hashcat_ctx->status_ctx; tuning_db_t *tuning_db = hashcat_ctx->tuning_db; user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; @@ -1315,7 +1314,7 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold * outfile-check directory */ - const int rc_outcheck_ctx_init = outcheck_ctx_init (outcheck_ctx, user_options, folder_config); + const int rc_outcheck_ctx_init = outcheck_ctx_init (hashcat_ctx); if (rc_outcheck_ctx_init == -1) return -1; @@ -1504,7 +1503,7 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold outfile_destroy (hashcat_ctx); - outcheck_ctx_destroy (outcheck_ctx); + outcheck_ctx_destroy (hashcat_ctx); folder_config_destroy (hashcat_ctx); diff --git a/src/outfile_check.c b/src/outfile_check.c index 12cd6d489..bd0e655a2 100644 --- a/src/outfile_check.c +++ b/src/outfile_check.c @@ -318,8 +318,12 @@ void *thread_outfile_remove (void *p) return NULL; } -int outcheck_ctx_init (outcheck_ctx_t *outcheck_ctx, const user_options_t *user_options, const folder_config_t *folder_config) +int outcheck_ctx_init (hashcat_ctx_t *hashcat_ctx) { + folder_config_t *folder_config = hashcat_ctx->folder_config; + outcheck_ctx_t *outcheck_ctx = hashcat_ctx->outcheck_ctx; + user_options_t *user_options = hashcat_ctx->user_options; + outcheck_ctx->enabled = false; if (user_options->keyspace == true) return 0; @@ -372,8 +376,10 @@ int outcheck_ctx_init (outcheck_ctx_t *outcheck_ctx, const user_options_t *user_ return 0; } -void outcheck_ctx_destroy (outcheck_ctx_t *outcheck_ctx) +void outcheck_ctx_destroy (hashcat_ctx_t *hashcat_ctx) { + outcheck_ctx_t *outcheck_ctx = hashcat_ctx->outcheck_ctx; + if (outcheck_ctx->enabled == false) return; if (rmdir (outcheck_ctx->root_directory) == -1)