1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-26 01:50:10 +00:00

fixed mingw warnings by making clean hex to binary conversion on hash parsing

This commit is contained in:
Sein Coray 2019-05-20 22:03:55 +02:00
parent 90ad225a8c
commit 3ac09d31a3
No known key found for this signature in database
GPG Key ID: 44C4180EA69758EC
4 changed files with 12 additions and 16 deletions

View File

@ -172,10 +172,9 @@ u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED
void hex_to_binary (const char *source, int len, char* out)
{
const char *pos = source;
for (size_t count = 0; count < (size_t) len/2; count++) {
sscanf(pos, "%2hhx", &out[count]);
pos += 2;
for (int i = 0, j = 0; j < len; i += 1, j += 2)
{
out[i] = hex_to_u8 ((const u8 *) &source[j]);
}
}

View File

@ -172,10 +172,9 @@ u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED
void hex_to_binary (const char *source, int len, char* out)
{
const char *pos = source;
for (size_t count = 0; count < (size_t) len/2; count++) {
sscanf(pos, "%2hhx", &out[count]);
pos += 2;
for (int i = 0, j = 0; j < len; i += 1, j += 2)
{
out[i] = hex_to_u8 ((const u8 *) &source[j]);
}
}

View File

@ -172,10 +172,9 @@ u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED
void hex_to_binary (const char *source, int len, char* out)
{
const char *pos = source;
for (size_t count = 0; count < (size_t) len/2; count++) {
sscanf(pos, "%2hhx", &out[count]);
pos += 2;
for (int i = 0, j = 0; j < len; i += 1, j += 2)
{
out[i] = hex_to_u8 ((const u8 *) &source[j]);
}
}

View File

@ -172,10 +172,9 @@ u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED
void hex_to_binary (const char *source, int len, char* out)
{
const char *pos = source;
for (size_t count = 0; count < (size_t) len/2; count++) {
sscanf(pos, "%2hhx", &out[count]);
pos += 2;
for (int i = 0, j = 0; j < len; i += 1, j += 2)
{
out[i] = hex_to_u8 ((const u8 *) &source[j]);
}
}