From feb0afadf2e153e6cdf1d1e5ff845716d791c548 Mon Sep 17 00:00:00 2001 From: PenguinKeeper7 <64717060+PenguinKeeper7@users.noreply.github.com> Date: Sat, 7 Jan 2023 00:15:48 +0000 Subject: [PATCH 1/2] Update status.c --- src/status.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/status.c b/src/status.c index 5c3701dd8..18ca7adbf 100644 --- a/src/status.c +++ b/src/status.c @@ -865,23 +865,24 @@ char *status_get_guess_candidates_dev (const hashcat_ctx_t *hashcat_ctx, const i const bool need_hex1 = need_hexify (plain_ptr1, plain_len1, 0, always_ascii); const bool need_hex2 = need_hexify (plain_ptr2, plain_len2, 0, always_ascii); - if ((need_hex1 == true) || (need_hex2 == true)) - { + // Left candidate needs to be $HEX-ed + if(need_hex1 == true){ exec_hexify (plain_ptr1, plain_len1, plain_ptr1); - exec_hexify (plain_ptr2, plain_len2, plain_ptr2); - plain_ptr1[plain_len1 * 2] = 0; + } + else{plain_ptr1[plain_len1] = 0;} + + // Right candidate needs to be $HEX-ed + if(need_hex2 == true){ + exec_hexify (plain_ptr2, plain_len2, plain_ptr2); plain_ptr2[plain_len2 * 2] = 0; - - snprintf (display, HCBUFSIZ_TINY, "$HEX[%s] -> $HEX[%s]", plain_ptr1, plain_ptr2); } - else - { - plain_ptr1[plain_len1] = 0; - plain_ptr2[plain_len2] = 0; + else { plain_ptr2[plain_len2] = 0; } - snprintf (display, HCBUFSIZ_TINY, "%s -> %s", plain_ptr1, plain_ptr2); - } + if(need_hex1 == true && need_hex2 == true) {snprintf (display, HCBUFSIZ_TINY, "$HEX[%s] -> $HEX[%s]", plain_ptr1, plain_ptr2);} + else if(need_hex1 == true && need_hex2 == false) {snprintf (display, HCBUFSIZ_TINY, "$HEX[%s] -> %s", plain_ptr1, plain_ptr2);} + else if(need_hex1 == false && need_hex2 == true) {snprintf (display, HCBUFSIZ_TINY, "%s -> $HEX[%s]", plain_ptr1, plain_ptr2);} + else if(need_hex1 == false && need_hex2 == false) {snprintf (display, HCBUFSIZ_TINY, "%s -> %s", plain_ptr1, plain_ptr2);} return display; } From 24214d39a095e33b0e9d51712877ef6e8ce5f65f Mon Sep 17 00:00:00 2001 From: PenguinKeeper7 <64717060+PenguinKeeper7@users.noreply.github.com> Date: Sat, 7 Jan 2023 02:07:34 +0000 Subject: [PATCH 2/2] Update status.c --- src/status.c | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/src/status.c b/src/status.c index 18ca7adbf..4e964fd3b 100644 --- a/src/status.c +++ b/src/status.c @@ -865,25 +865,47 @@ char *status_get_guess_candidates_dev (const hashcat_ctx_t *hashcat_ctx, const i const bool need_hex1 = need_hexify (plain_ptr1, plain_len1, 0, always_ascii); const bool need_hex2 = need_hexify (plain_ptr2, plain_len2, 0, always_ascii); - // Left candidate needs to be $HEX-ed - if(need_hex1 == true){ + if((need_hex1 == true) || (need_hex2 == true)) + { + // Right candidate needs to be $HEX-ed + if(need_hex1 == false) + { + exec_hexify (plain_ptr2, plain_len2, plain_ptr2); + + plain_ptr1[plain_len1] = 0; + plain_ptr2[plain_len2 * 2] = 0; + + snprintf (display, HCBUFSIZ_TINY, "%s -> $HEX[%s]", plain_ptr1, plain_ptr2); + } + // Left candidate needs to be $HEX-ed + else if(need_hex2 == false) + { exec_hexify (plain_ptr1, plain_len1, plain_ptr1); + plain_ptr1[plain_len1 * 2] = 0; + plain_ptr2[plain_len2] = 0; + + snprintf (display, HCBUFSIZ_TINY, "$HEX[%s] -> %s", plain_ptr1, plain_ptr2); + } + // Both candidates need to be $HEX-ed + else { + exec_hexify (plain_ptr1, plain_len1, plain_ptr1); + exec_hexify (plain_ptr2, plain_len2, plain_ptr2); + + plain_ptr1[plain_len1 * 2] = 0; + plain_ptr2[plain_len2 * 2] = 0; + + snprintf (display, HCBUFSIZ_TINY, "$HEX[%s] -> $HEX[%s]", plain_ptr1, plain_ptr2); + } } - else{plain_ptr1[plain_len1] = 0;} + // Neither candidate needs to be $HEX-ed + else + { + plain_ptr1[plain_len1] = 0; + plain_ptr2[plain_len2] = 0; - // Right candidate needs to be $HEX-ed - if(need_hex2 == true){ - exec_hexify (plain_ptr2, plain_len2, plain_ptr2); - plain_ptr2[plain_len2 * 2] = 0; + snprintf (display, HCBUFSIZ_TINY, "%s -> %s", plain_ptr1, plain_ptr2); } - else { plain_ptr2[plain_len2] = 0; } - - if(need_hex1 == true && need_hex2 == true) {snprintf (display, HCBUFSIZ_TINY, "$HEX[%s] -> $HEX[%s]", plain_ptr1, plain_ptr2);} - else if(need_hex1 == true && need_hex2 == false) {snprintf (display, HCBUFSIZ_TINY, "$HEX[%s] -> %s", plain_ptr1, plain_ptr2);} - else if(need_hex1 == false && need_hex2 == true) {snprintf (display, HCBUFSIZ_TINY, "%s -> $HEX[%s]", plain_ptr1, plain_ptr2);} - else if(need_hex1 == false && need_hex2 == false) {snprintf (display, HCBUFSIZ_TINY, "%s -> %s", plain_ptr1, plain_ptr2);} - return display; }