From 4dceea914f04b252a32fc2df3f3919d33a2c2637 Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 10 Oct 2023 21:03:07 +0000 Subject: [PATCH] Refactor wordlist_autohex_disable variable to wordlist_autohex, same idea as outfile_autohex variable --- include/types.h | 4 ++-- src/brain.c | 20 ++++++++++---------- src/user_options.c | 6 +++--- src/wordlist.c | 4 ++-- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/types.h b/include/types.h index d56e5c735..5a4e09766 100644 --- a/include/types.h +++ b/include/types.h @@ -717,7 +717,7 @@ typedef enum user_options_defaults VERSION = false, VERACRYPT_PIM_START = 485, VERACRYPT_PIM_STOP = 485, - WORDLIST_AUTOHEX_DISABLE = false, + WORDLIST_AUTOHEX = true, WORKLOAD_PROFILE = 2, } user_options_defaults_t; @@ -2373,7 +2373,7 @@ typedef struct user_options bool veracrypt_pim_start_chgd; bool veracrypt_pim_stop_chgd; bool version; - bool wordlist_autohex_disable; + bool wordlist_autohex; #ifdef WITH_BRAIN char *brain_host; char *brain_password; diff --git a/src/brain.c b/src/brain.c index 17592016b..625aae78f 100644 --- a/src/brain.c +++ b/src/brain.c @@ -209,9 +209,9 @@ u32 brain_compute_attack (hashcat_ctx_t *hashcat_ctx) XXH64_update (state, &hex_wordlist, sizeof (hex_wordlist)); - const int wordlist_autohex_disable = user_options->wordlist_autohex_disable; + const int wordlist_autohex = user_options->wordlist_autohex; - XXH64_update (state, &wordlist_autohex_disable, sizeof (wordlist_autohex_disable)); + XXH64_update (state, &wordlist_autohex, sizeof (wordlist_autohex)); if (user_options->encoding_from) { @@ -259,9 +259,9 @@ u32 brain_compute_attack (hashcat_ctx_t *hashcat_ctx) XXH64_update (state, &hex_wordlist, sizeof (hex_wordlist)); - const int wordlist_autohex_disable = user_options->wordlist_autohex_disable; + const int wordlist_autohex = user_options->wordlist_autohex; - XXH64_update (state, &wordlist_autohex_disable, sizeof (wordlist_autohex_disable)); + XXH64_update (state, &wordlist_autohex, sizeof (wordlist_autohex)); if (user_options->encoding_from) { @@ -409,9 +409,9 @@ u32 brain_compute_attack (hashcat_ctx_t *hashcat_ctx) XXH64_update (state, &hex_wordlist, sizeof (hex_wordlist)); - const int wordlist_autohex_disable = user_options->wordlist_autohex_disable; + const int wordlist_autohex = user_options->wordlist_autohex; - XXH64_update (state, &wordlist_autohex_disable, sizeof (wordlist_autohex_disable)); + XXH64_update (state, &wordlist_autohex, sizeof (wordlist_autohex)); if (user_options->encoding_from) { @@ -504,9 +504,9 @@ u32 brain_compute_attack (hashcat_ctx_t *hashcat_ctx) XXH64_update (state, &hex_wordlist, sizeof (hex_wordlist)); - const int wordlist_autohex_disable = user_options->wordlist_autohex_disable; + const int wordlist_autohex = user_options->wordlist_autohex; - XXH64_update (state, &wordlist_autohex_disable, sizeof (wordlist_autohex_disable)); + XXH64_update (state, &wordlist_autohex, sizeof (wordlist_autohex)); if (user_options->encoding_from) { @@ -549,9 +549,9 @@ u32 brain_compute_attack (hashcat_ctx_t *hashcat_ctx) XXH64_update (state, &hex_wordlist, sizeof (hex_wordlist)); - const int wordlist_autohex_disable = user_options->wordlist_autohex_disable; + const int wordlist_autohex = user_options->wordlist_autohex; - XXH64_update (state, &wordlist_autohex_disable, sizeof (wordlist_autohex_disable)); + XXH64_update (state, &wordlist_autohex, sizeof (wordlist_autohex)); if (user_options->encoding_from) { diff --git a/src/user_options.c b/src/user_options.c index bcf90e8c6..3ff645721 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -289,7 +289,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx) user_options->veracrypt_pim_start = VERACRYPT_PIM_START; user_options->veracrypt_pim_stop = VERACRYPT_PIM_STOP; user_options->version = VERSION; - user_options->wordlist_autohex_disable = WORDLIST_AUTOHEX_DISABLE; + user_options->wordlist_autohex = WORDLIST_AUTOHEX; user_options->workload_profile = WORKLOAD_PROFILE; user_options->rp_files_cnt = 0; user_options->rp_files = (char **) hccalloc (256, sizeof (char *)); @@ -468,7 +468,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv) case IDX_OUTFILE_JSON: user_options->outfile_json = true; break; case IDX_OUTFILE_AUTOHEX_DISABLE: user_options->outfile_autohex = false; break; case IDX_OUTFILE_CHECK_TIMER: user_options->outfile_check_timer = hc_strtoul (optarg, NULL, 10); break; - case IDX_WORDLIST_AUTOHEX_DISABLE: user_options->wordlist_autohex_disable = true; break; + case IDX_WORDLIST_AUTOHEX_DISABLE: user_options->wordlist_autohex = false; break; case IDX_HEX_CHARSET: user_options->hex_charset = true; break; case IDX_HEX_SALT: user_options->hex_salt = true; break; case IDX_HEX_WORDLIST: user_options->hex_wordlist = true; break; @@ -3263,7 +3263,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx) logfile_top_uint (user_options->outfile_check_timer); logfile_top_uint (user_options->outfile_format); logfile_top_uint (user_options->outfile_json); - logfile_top_uint (user_options->wordlist_autohex_disable); + logfile_top_uint (user_options->wordlist_autohex); logfile_top_uint (user_options->potfile_disable); logfile_top_uint (user_options->progress_only); logfile_top_uint (user_options->quiet); diff --git a/src/wordlist.c b/src/wordlist.c index 62941295f..1776b4885 100644 --- a/src/wordlist.c +++ b/src/wordlist.c @@ -37,7 +37,7 @@ size_t convert_from_hex (hashcat_ctx_t *hashcat_ctx, char *line_buf, const size_ return (i); } - if (user_options->wordlist_autohex_disable == false) + if (user_options->wordlist_autohex == true) { if (is_hexify ((const u8 *) line_buf, line_len) == true) { @@ -730,7 +730,7 @@ int wl_data_init (hashcat_ctx_t *hashcat_ctx) } else { - if (user_options->wordlist_autohex_disable == false) + if (user_options->wordlist_autohex == true) { wl_data->func = get_next_word_lm_hex_or_text; // might be $HEX[] notation }