1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-13 19:28:56 +00:00

Get rid of quiet variable in data. context

This commit is contained in:
jsteube 2016-09-22 15:56:32 +02:00
parent f2f7dccb90
commit 095dfdc730
11 changed files with 22 additions and 50 deletions

View File

@ -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;

View File

@ -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 ();

View File

@ -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);
}
}

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;
}

View File

@ -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

View File

@ -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 ("");
}
/**

View File

@ -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 ();

View File

@ -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);