From 1bae3383dc9d617aa4dbc40d679cc7ec1a3a6801 Mon Sep 17 00:00:00 2001 From: PenguinKeeper7 Date: Mon, 18 Sep 2023 16:16:47 +0100 Subject: [PATCH] Fix -o warning when already used --- include/types.h | 1 + src/main.c | 14 ++++++++++++-- src/user_options.c | 3 ++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/types.h b/include/types.h index 511c56625..d2a74710c 100644 --- a/include/types.h +++ b/include/types.h @@ -2305,6 +2305,7 @@ typedef struct user_options bool nonce_error_corrections_chgd; bool spin_damp_chgd; bool backend_vector_width_chgd; + bool outfile_chgd; bool outfile_format_chgd; bool remove_timer_chgd; bool rp_gen_seed_chgd; diff --git a/src/main.c b/src/main.c index e0df90e74..87e3e31a9 100644 --- a/src/main.c +++ b/src/main.c @@ -563,7 +563,12 @@ static void main_outerloop_mainscreen (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, { event_log_advice (hashcat_ctx, "ATTENTION! Potfile storage is disabled for this hash mode."); event_log_advice (hashcat_ctx, "Passwords cracked during this session will NOT be stored to the potfile."); - event_log_advice (hashcat_ctx, "Consider using -o to save cracked passwords."); + + if(user_options->outfile_chgd == false) + { + event_log_advice (hashcat_ctx, "Consider using -o to save cracked passwords."); + } + event_log_advice (hashcat_ctx, NULL); } @@ -571,7 +576,12 @@ static void main_outerloop_mainscreen (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, { event_log_advice (hashcat_ctx, "ATTENTION! Potfile read/write is disabled for this attack mode."); event_log_advice (hashcat_ctx, "Passwords cracked during this session will NOT be stored to the potfile."); - event_log_advice (hashcat_ctx, "Consider using -o to save cracked passwords."); + + if(user_options->outfile_chgd == false) + { + event_log_advice (hashcat_ctx, "Consider using -o to save cracked passwords."); + } + event_log_advice (hashcat_ctx, NULL); } /** diff --git a/src/user_options.c b/src/user_options.c index a024ce1d1..57845e257 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -459,7 +459,8 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv) case IDX_MARKOV_INVERSE: user_options->markov_inverse = true; break; case IDX_MARKOV_THRESHOLD: user_options->markov_threshold = hc_strtoul (optarg, NULL, 10); break; case IDX_MARKOV_HCSTAT2: user_options->markov_hcstat2 = optarg; break; - case IDX_OUTFILE: user_options->outfile = optarg; break; + case IDX_OUTFILE: user_options->outfile = optarg; + user_options->outfile_chgd = true; break; case IDX_OUTFILE_FORMAT: user_options->outfile_format = outfile_format_parse (optarg); user_options->outfile_format_chgd = true; break; case IDX_OUTFILE_AUTOHEX_DISABLE: user_options->outfile_autohex = false; break;