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

pull/1962/head
Sein Coray 5 years ago
parent e300fe0d63
commit 2434380da2
No known key found for this signature in database
GPG Key ID: 44C4180EA69758EC

@ -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++)
{
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);
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);
}
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, "%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[i]);
out_len += sprintf (line_buf + out_len, "%02x", (pkzip->hashes[cnt].data[pkzip->hashes[cnt].data_length / 4] >> i*8) & 0xff);
}
}

@ -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++)
{
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);
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);
}
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, "%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[i]);
out_len += sprintf (line_buf + out_len, "%02x", (pkzip->hashes[cnt].data[pkzip->hashes[cnt].data_length / 4] >> i*8) & 0xff);
}
}

Loading…
Cancel
Save