diff --git a/include/status.h b/include/status.h index 6a5a0f0a6..00903bb78 100644 --- a/include/status.h +++ b/include/status.h @@ -12,7 +12,7 @@ double get_avg_exec_time (hc_device_param_t *device_param, const int last_num_entries); void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hashes_t *hashes); -void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes); +void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const user_options_t *user_options); void status_benchmark_automate (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig); void status_benchmark (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig); diff --git a/include/types.h b/include/types.h index 710bb27e0..73d1d2845 100644 --- a/include/types.h +++ b/include/types.h @@ -1007,11 +1007,6 @@ typedef struct char *veracrypt_keyfiles; u32 veracrypt_pim; - char *custom_charset_1; - char *custom_charset_2; - char *custom_charset_3; - char *custom_charset_4; - hashconfig_t *hashconfig; hashes_t *hashes; user_options_t *user_options; diff --git a/src/hashcat.c b/src/hashcat.c index e1129272b..d5f67e009 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -280,10 +280,6 @@ int main (int argc, char **argv) { data.attack_mode = user_options->attack_mode; data.benchmark = user_options->benchmark; - data.custom_charset_1 = user_options->custom_charset_1; - data.custom_charset_2 = user_options->custom_charset_2; - data.custom_charset_3 = user_options->custom_charset_3; - data.custom_charset_4 = user_options->custom_charset_4; data.force = user_options->force; data.gpu_temp_abort = user_options->gpu_temp_abort; data.gpu_temp_disable = user_options->gpu_temp_disable; @@ -3740,7 +3736,7 @@ int main (int argc, char **argv) log_info (""); - status_display (opencl_ctx, hashconfig, hashes); + status_display (opencl_ctx, hashconfig, hashes, user_options); log_info (""); } @@ -3748,7 +3744,7 @@ int main (int argc, char **argv) { if (user_options->status == true) { - status_display (opencl_ctx, hashconfig, hashes); + status_display (opencl_ctx, hashconfig, hashes, user_options); } } } diff --git a/src/monitor.c b/src/monitor.c index 2137cd0b9..efdeaf5d0 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -342,7 +342,7 @@ void *thread_monitor (void *p) if (user_options->quiet == false) log_info (""); - status_display (opencl_ctx, hashconfig, hashes); + status_display (opencl_ctx, hashconfig, hashes, user_options); if (user_options->quiet == false) log_info (""); diff --git a/src/status.c b/src/status.c index cce41a239..cbd84c9ed 100644 --- a/src/status.c +++ b/src/status.c @@ -286,7 +286,7 @@ void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hashes_t * fflush (out); } -void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes) +void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const user_options_t *user_options) { if (opencl_ctx->devices_status == STATUS_INIT) { @@ -353,6 +353,11 @@ void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, c * show input */ + char *custom_charset_1 = user_options->custom_charset_1; + char *custom_charset_2 = user_options->custom_charset_2; + char *custom_charset_3 = user_options->custom_charset_3; + char *custom_charset_4 = user_options->custom_charset_4; + if (data.attack_mode == ATTACK_MODE_STRAIGHT) { if (data.wordlist_mode == WL_MODE_FILE) @@ -403,31 +408,14 @@ void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, c log_info ("Input.Mode.....: %s", tmp_buf); - if (data.custom_charset_1 || data.custom_charset_2 || data.custom_charset_3 || data.custom_charset_4) + if ((custom_charset_1 != NULL) || (custom_charset_2 != NULL) || (custom_charset_3 != NULL) || (custom_charset_4 != NULL)) { - char *custom_charset_1 = data.custom_charset_1; - char *custom_charset_2 = data.custom_charset_2; - char *custom_charset_3 = data.custom_charset_3; - char *custom_charset_4 = data.custom_charset_4; + if (custom_charset_1 == NULL) custom_charset_1 = "Undefined"; + if (custom_charset_2 == NULL) custom_charset_2 = "Undefined"; + if (custom_charset_3 == NULL) custom_charset_3 = "Undefined"; + if (custom_charset_4 == NULL) custom_charset_4 = "Undefined"; - if (custom_charset_1 == NULL) - { - custom_charset_1 = "Undefined"; - } - if (custom_charset_2 == NULL) - { - custom_charset_2 = "Undefined"; - } - if (custom_charset_3 == NULL) - { - custom_charset_3 = "Undefined"; - } - if (custom_charset_4 == NULL) - { - custom_charset_4 = "Undefined"; - } - - log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); + log_info ("Custom.Charset.: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); } } @@ -437,62 +425,30 @@ void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, c { if (data.dictfile != NULL) log_info ("Input.Left.....: File (%s)", data.dictfile); if (data.mask != NULL) log_info ("Input.Right....: Mask (%s) [%i]", data.mask, data.css_cnt); - if (data.custom_charset_1 || data.custom_charset_2 || data.custom_charset_3 || data.custom_charset_4) + + if ((custom_charset_1 != NULL) || (custom_charset_2 != NULL) || (custom_charset_3 != NULL) || (custom_charset_4 != NULL)) { - char *custom_charset_1 = data.custom_charset_1; - char *custom_charset_2 = data.custom_charset_2; - char *custom_charset_3 = data.custom_charset_3; - char *custom_charset_4 = data.custom_charset_4; + if (custom_charset_1 == NULL) custom_charset_1 = "Undefined"; + if (custom_charset_2 == NULL) custom_charset_2 = "Undefined"; + if (custom_charset_3 == NULL) custom_charset_3 = "Undefined"; + if (custom_charset_4 == NULL) custom_charset_4 = "Undefined"; - if (custom_charset_1 == NULL) - { - custom_charset_1 = "Undefined"; - } - if (custom_charset_2 == NULL) - { - custom_charset_2 = "Undefined"; - } - if (custom_charset_3 == NULL) - { - custom_charset_3 = "Undefined"; - } - if (custom_charset_4 == NULL) - { - custom_charset_4 = "Undefined"; - } - - log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); + log_info ("Custom.Charset.: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); } } else if (data.attack_mode == ATTACK_MODE_HYBRID2) { if (data.mask != NULL) log_info ("Input.Left.....: Mask (%s) [%i]", data.mask, data.css_cnt); if (data.dictfile != NULL) log_info ("Input.Right....: File (%s)", data.dictfile); - if (data.custom_charset_1 || data.custom_charset_2 || data.custom_charset_3 || data.custom_charset_4) + + if ((custom_charset_1 != NULL) || (custom_charset_2 != NULL) || (custom_charset_3 != NULL) || (custom_charset_4 != NULL)) { - char *custom_charset_1 = data.custom_charset_1; - char *custom_charset_2 = data.custom_charset_2; - char *custom_charset_3 = data.custom_charset_3; - char *custom_charset_4 = data.custom_charset_4; + if (custom_charset_1 == NULL) custom_charset_1 = "Undefined"; + if (custom_charset_2 == NULL) custom_charset_2 = "Undefined"; + if (custom_charset_3 == NULL) custom_charset_3 = "Undefined"; + if (custom_charset_4 == NULL) custom_charset_4 = "Undefined"; - if (custom_charset_1 == NULL) - { - custom_charset_1 = "Undefined"; - } - if (custom_charset_2 == NULL) - { - custom_charset_2 = "Undefined"; - } - if (custom_charset_3 == NULL) - { - custom_charset_3 = "Undefined"; - } - if (custom_charset_4 == NULL) - { - custom_charset_4 = "Undefined"; - } - - log_info ("Custom.Chars...: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); + log_info ("Custom.Charset.: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4); } } diff --git a/src/terminal.c b/src/terminal.c index ce2d72d6f..b2e6e6a83 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -63,8 +63,9 @@ void *thread_keypress (void *p) while (opencl_ctx->devices_status == STATUS_INIT) hc_sleep_ms (100); - hashconfig_t *hashconfig = data.hashconfig; - hashes_t *hashes = data.hashes; + user_options_t *user_options = data.user_options; + hashconfig_t *hashconfig = data.hashconfig; + hashes_t *hashes = data.hashes; uint quiet = data.quiet; @@ -95,7 +96,7 @@ void *thread_keypress (void *p) log_info (""); - status_display (opencl_ctx, hashconfig, hashes); + status_display (opencl_ctx, hashconfig, hashes, user_options); log_info ("");