diff --git a/include/types.h b/include/types.h index a41c0ca66..127aabbfb 100644 --- a/include/types.h +++ b/include/types.h @@ -961,14 +961,9 @@ typedef struct char *new_restore_file; char *induction_directory; char *outfile_check_directory; - - - - u32 quiet; u32 pw_min; u32 pw_max; - opencl_ctx_t *opencl_ctx; hashconfig_t *hashconfig; hashes_t *hashes; diff --git a/src/autotune.c b/src/autotune.c index 399923282..b88db73e1 100644 --- a/src/autotune.c +++ b/src/autotune.c @@ -294,7 +294,7 @@ int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashcon #if defined (DEBUG) - if (data.quiet == false) + if (user_options->quiet == false) { clear_prompt (); diff --git a/src/dispatch.c b/src/dispatch.c index e51d0adf0..0df646b2f 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -38,9 +38,9 @@ extern hc_global_data_t data; -static void set_kernel_power_final (const u64 kernel_power_final) +static void set_kernel_power_final (const user_options_t *user_options, const u64 kernel_power_final) { - if (data.quiet == false) + if (user_options->quiet == false) { clear_prompt (); @@ -92,7 +92,7 @@ static uint get_work (opencl_ctx_t *opencl_ctx, const user_options_t *user_optio { if (data.kernel_power_final == 0) { - set_kernel_power_final (words_left); + set_kernel_power_final (user_options, words_left); } } diff --git a/src/ext_ADL.c b/src/ext_ADL.c index 01504fcc1..0ce867360 100644 --- a/src/ext_ADL.c +++ b/src/ext_ADL.c @@ -28,7 +28,7 @@ int adl_init (ADL_PTR *adl) if (!adl->lib) { - //if (data.quiet == false) + //if (user_options->quiet == false) // log_info ("WARNING: load ADL library failed, proceed without ADL HWMon enabled."); return -1; diff --git a/src/ext_nvapi.c b/src/ext_nvapi.c index 082f3a6a6..0b96a7f22 100644 --- a/src/ext_nvapi.c +++ b/src/ext_nvapi.c @@ -27,7 +27,7 @@ int nvapi_init (NVAPI_PTR *nvapi) if (!nvapi->lib) { - //if (data.quiet == false) + //if (user_options->quiet == false) // log_info ("WARNING: load NVAPI library failed, proceed without NVAPI HWMon enabled."); return -1; diff --git a/src/ext_nvml.c b/src/ext_nvml.c index 425e8fec7..1aecfec6e 100644 --- a/src/ext_nvml.c +++ b/src/ext_nvml.c @@ -36,7 +36,7 @@ int nvml_init (NVML_PTR *nvml) } else { - //if (data.quiet == false) + //if (user_options->quiet == false) // log_info ("WARNING: NVML library load failed, proceed without NVML HWMon enabled."); return -1; @@ -46,7 +46,7 @@ int nvml_init (NVML_PTR *nvml) } else { - //if (data.quiet == false) + //if (user_options->quiet == false) // log_info ("WARNING: NVML library load failed, proceed without NVML HWMon enabled."); return -1; @@ -65,7 +65,7 @@ int nvml_init (NVML_PTR *nvml) if (!nvml->lib) { - //if (data.quiet == false) + //if (user_options->quiet == false) // log_info ("WARNING: NVML library load failed, proceed without NVML HWMon enabled."); return -1; diff --git a/src/ext_xnvctrl.c b/src/ext_xnvctrl.c index 2abaf530c..b63cd90a2 100644 --- a/src/ext_xnvctrl.c +++ b/src/ext_xnvctrl.c @@ -26,9 +26,9 @@ int xnvctrl_init (XNVCTRL_PTR *xnvctrl) if (xnvctrl->lib_x11 == NULL) { - //if (data.quiet == false) log_info ("WARNING: Failed loading the X11 library: %s", dlerror()); - //if (data.quiet == false) log_info (" Please install libx11-dev package."); - //if (data.quiet == false) log_info (""); + //if (user_options->quiet == false) log_info ("WARNING: Failed loading the X11 library: %s", dlerror()); + //if (user_options->quiet == false) log_info (" Please install libx11-dev package."); + //if (user_options->quiet == false) log_info (""); return -1; } @@ -37,9 +37,9 @@ int xnvctrl_init (XNVCTRL_PTR *xnvctrl) if (xnvctrl->lib_xnvctrl == NULL) { - //if (data.quiet == false) log_info ("WARNING: Failed loading the XNVCTRL library: %s", dlerror()); - //if (data.quiet == false) log_info (" Please install libxnvctrl-dev package."); - //if (data.quiet == false) log_info (""); + //if (user_options->quiet == false) log_info ("WARNING: Failed loading the XNVCTRL library: %s", dlerror()); + //if (user_options->quiet == false) log_info (" Please install libxnvctrl-dev package."); + //if (user_options->quiet == false) log_info (""); return -1; } diff --git a/src/hash_management.c b/src/hash_management.c index 12fbf151d..6f3a9456f 100644 --- a/src/hash_management.c +++ b/src/hash_management.c @@ -234,7 +234,7 @@ void check_hash (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cons const u32 gidvid = plain->gidvid; const u32 il_pos = plain->il_pos; - const uint quiet = data.quiet; + const uint quiet = user_options->quiet; // debugfile diff --git a/src/hashcat.c b/src/hashcat.c index 0ecd9536d..6bbad4593 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -266,13 +266,6 @@ int main (int argc, char **argv) if (rc_user_options_sanity == -1) return -1; - // temporarily start - - if (1) - { - data.quiet = user_options->quiet; - } - if (user_options->version) { log_info ("%s", VERSION_TAG); @@ -1758,10 +1751,6 @@ int main (int argc, char **argv) { if (user_options->machine_readable == false) { - //quiet = 0; - - //user_options->quiet = quiet; - char *hash_type = strhashtype (hashconfig->hash_mode); // not a bug log_info ("Hashtype: %s", hash_type); @@ -1979,12 +1968,8 @@ int main (int argc, char **argv) data.combs_cnt = 1; - //user_options->quiet = 1; - const u64 words1_cnt = count_words (wl_data, user_options, user_options_extra, fp1, dictfile1, dictstat_ctx); - //user_options->quiet = quiet; - if (words1_cnt == 0) { log_error ("ERROR: %s: empty file", dictfile1); @@ -1997,12 +1982,8 @@ int main (int argc, char **argv) data.combs_cnt = 1; - //user_options->quiet = 1; - const u64 words2_cnt = count_words (wl_data, user_options, user_options_extra, fp2, dictfile2, dictstat_ctx); - //user_options->quiet = quiet; - if (words2_cnt == 0) { log_error ("ERROR: %s: empty file", dictfile2); @@ -2580,10 +2561,6 @@ int main (int argc, char **argv) { weak_hash_check (opencl_ctx, device_param, user_options, user_options_extra, hashconfig, hashes, salt_pos); } - - // Display hack, guarantee that there is at least one \r before real start - - //if (user_options->quiet == false) log_info (""); } /** diff --git a/src/terminal.c b/src/terminal.c index 50e390de0..1d3c800a6 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -68,7 +68,7 @@ void *thread_keypress (void *p) hashconfig_t *hashconfig = data.hashconfig; hashes_t *hashes = data.hashes; - uint quiet = data.quiet; + uint quiet = user_options->quiet; tty_break (); diff --git a/src/wordlist.c b/src/wordlist.c index d672cfa4e..5e8aa3f93 100644 --- a/src/wordlist.c +++ b/src/wordlist.c @@ -332,8 +332,8 @@ u64 count_words (wl_data_t *wl_data, const user_options_t *user_options, const u keyspace *= data.combs_cnt; } - if (data.quiet == false) log_info ("Cache-hit dictionary stats %s: %" PRIu64 " bytes, %" PRIu64 " words, %" PRIu64 " keyspace", dictfile, d.stat.st_size, cached_cnt, keyspace); - if (data.quiet == false) log_info (""); + if (user_options->quiet == false) log_info ("Cache-hit dictionary stats %s: %" PRIu64 " bytes, %" PRIu64 " words, %" PRIu64 " keyspace", dictfile, d.stat.st_size, cached_cnt, keyspace); + if (user_options->quiet == false) log_info (""); hc_signal (sigHandler_default); @@ -409,13 +409,13 @@ u64 count_words (wl_data_t *wl_data, const user_options_t *user_options, const u double percent = (double) comp / (double) d.stat.st_size; - if (data.quiet == false) log_info_nn ("Generating dictionary stats for %s: %" PRIu64 " bytes (%.2f%%), %" PRIu64 " words, %" PRIu64 " keyspace", dictfile, comp, percent * 100, cnt2, cnt); + if (user_options->quiet == false) log_info_nn ("Generating dictionary stats for %s: %" PRIu64 " bytes (%.2f%%), %" PRIu64 " words, %" PRIu64 " keyspace", dictfile, comp, percent * 100, cnt2, cnt); time (&prev); } - if (data.quiet == false) log_info ("Generated dictionary stats for %s: %" PRIu64 " bytes, %" PRIu64 " words, %" PRIu64 " keyspace", dictfile, comp, cnt2, cnt); - if (data.quiet == false) log_info (""); + if (user_options->quiet == false) log_info ("Generated dictionary stats for %s: %" PRIu64 " bytes, %" PRIu64 " words, %" PRIu64 " keyspace", dictfile, comp, cnt2, cnt); + if (user_options->quiet == false) log_info (""); dictstat_append (dictstat_ctx, &d);