1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 22:58:30 +00:00

Merge pull request #3566 from PenguinKeeper7/QoLHexFix

QoL status hex fix
This commit is contained in:
Jens Steube 2023-01-07 23:52:29 +01:00 committed by GitHub
commit eb3e0ac599
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -865,16 +865,40 @@ 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))
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);
exec_hexify (plain_ptr2, plain_len2, plain_ptr2);
plain_ptr1[plain_len1 * 2] = 0;
plain_ptr2[plain_len2 * 2] = 0;
plain_ptr2[plain_len2] = 0;
snprintf (display, HCBUFSIZ_TINY, "$HEX[%s] -> $HEX[%s]", plain_ptr1, plain_ptr2);
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);
}
}
// Neither candidate needs to be $HEX-ed
else
{
plain_ptr1[plain_len1] = 0;
@ -882,7 +906,6 @@ char *status_get_guess_candidates_dev (const hashcat_ctx_t *hashcat_ctx, const i
snprintf (display, HCBUFSIZ_TINY, "%s -> %s", plain_ptr1, plain_ptr2);
}
return display;
}