1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-08 14:51:10 +00:00

Fix hex conversion and formatting

Co-Authored-By: SQL master <bnzm5270@gmail.com>
This commit is contained in:
Devin AI 2024-12-13 17:09:53 +00:00
parent 3db39cfde8
commit 01470d941a

View File

@ -118,8 +118,16 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_buf[out_len] = hashconfig->separator;
out_len += 1;
u8_to_hex ((const u8 *) salt->salt_buf, 4, out_buf + out_len);
out_len += 8;
// Convert salt to hex (4 bytes)
const u8 *salt_ptr = (const u8 *) salt->salt_buf;
u8 hex[2];
for (int i = 0; i < 4; i++)
{
u8_to_hex (salt_ptr[i], hex);
out_buf[out_len++] = hex[0];
out_buf[out_len++] = hex[1];
}
return out_len;
}