1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 15:18:16 +00:00

fixed printing of hash for module 17220 and 17230 using the u32 data array

This commit is contained in:
Sein Coray 2019-05-14 14:00:18 +02:00
parent e300fe0d63
commit 2434380da2
No known key found for this signature in database
GPG Key ID: 44C4180EA69758EC
2 changed files with 20 additions and 4 deletions

View File

@ -308,6 +308,10 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int cnt = 0; cnt < pkzip->hash_count; cnt++) for (int cnt = 0; cnt < pkzip->hash_count; cnt++)
{ {
if (cnt > 0)
{
out_len += sprintf (line_buf + out_len, "*");
}
out_len += sprintf (line_buf + out_len, "%i*%i*", pkzip->hashes[cnt].data_type_enum, pkzip->hashes[cnt].magic_type_enum); out_len += sprintf (line_buf + out_len, "%i*%i*", pkzip->hashes[cnt].data_type_enum, pkzip->hashes[cnt].magic_type_enum);
if (pkzip->hashes[cnt].data_type_enum > 1) if (pkzip->hashes[cnt].data_type_enum > 1)
{ {
@ -320,9 +324,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += sprintf (line_buf + out_len, "%x*", pkzip->hashes[cnt].checksum_from_timestamp); out_len += sprintf (line_buf + out_len, "%x*", pkzip->hashes[cnt].checksum_from_timestamp);
} }
for (u32 i = 0; i < pkzip->hashes[cnt].data_length; i++) for (u32 i = 0; i < pkzip->hashes[cnt].data_length / 4; i++)
{ {
out_len += sprintf (line_buf + out_len, "%02x", pkzip->hashes[cnt].data[i]); out_len += sprintf (line_buf + out_len, "%08x", byte_swap_32 (pkzip->hashes[cnt].data[i]));
}
for (u32 i = 0; i < pkzip->hashes[cnt].data_length % 4; i++)
{
out_len += sprintf (line_buf + out_len, "%02x", (pkzip->hashes[cnt].data[pkzip->hashes[cnt].data_length / 4] >> i*8) & 0xff);
} }
} }

View File

@ -309,6 +309,10 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
for (int cnt = 0; cnt < pkzip->hash_count; cnt++) for (int cnt = 0; cnt < pkzip->hash_count; cnt++)
{ {
if (cnt > 0)
{
out_len += sprintf (line_buf + out_len, "*");
}
out_len += sprintf (line_buf + out_len, "%i*%i*", pkzip->hashes[cnt].data_type_enum, pkzip->hashes[cnt].magic_type_enum); out_len += sprintf (line_buf + out_len, "%i*%i*", pkzip->hashes[cnt].data_type_enum, pkzip->hashes[cnt].magic_type_enum);
if (pkzip->hashes[cnt].data_type_enum > 1) if (pkzip->hashes[cnt].data_type_enum > 1)
{ {
@ -321,9 +325,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
out_len += sprintf (line_buf + out_len, "%x*", pkzip->hashes[cnt].checksum_from_timestamp); out_len += sprintf (line_buf + out_len, "%x*", pkzip->hashes[cnt].checksum_from_timestamp);
} }
for (u32 i = 0; i < pkzip->hashes[cnt].data_length; i++) for (u32 i = 0; i < pkzip->hashes[cnt].data_length / 4; i++)
{ {
out_len += sprintf (line_buf + out_len, "%02x", pkzip->hashes[cnt].data[i]); out_len += sprintf (line_buf + out_len, "%08x", byte_swap_32 (pkzip->hashes[cnt].data[i]));
}
for (u32 i = 0; i < pkzip->hashes[cnt].data_length % 4; i++)
{
out_len += sprintf (line_buf + out_len, "%02x", (pkzip->hashes[cnt].data[pkzip->hashes[cnt].data_length / 4] >> i*8) & 0xff);
} }
} }