From 4da995cf88dcc8a46066ba24934c6e64be557ede Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 7 Nov 2023 22:08:55 +0000 Subject: [PATCH] Change hlfmt.c strategy to extract dynamic-x hash-mode --- src/hlfmt.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/hlfmt.c b/src/hlfmt.c index c775cd5d8..9c6b813c3 100644 --- a/src/hlfmt.c +++ b/src/hlfmt.c @@ -28,14 +28,13 @@ static void hlfmt_hash_hashcat (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, char *l const user_options_t *user_options = hashcat_ctx->user_options; const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; - if ((user_options->username == true) && (user_options->dynamic_x == true)) - { + *hashbuf_pos = line_buf; + *hashbuf_len = line_len; - } - else if (user_options->username == true) + if (user_options->username == true) { - char *pos = line_buf; - size_t len = line_len; + char *pos = *hashbuf_pos; + size_t len = *hashbuf_len; for (int i = 0; i < line_len; i++, pos++, len--) { @@ -52,14 +51,10 @@ static void hlfmt_hash_hashcat (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, char *l *hashbuf_pos = pos; *hashbuf_len = len; } - else if (user_options->dynamic_x == true) - { - } - else + if (user_options->dynamic_x == true) { - *hashbuf_pos = line_buf; - *hashbuf_len = line_len; + } }