1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 16:18:09 +00:00

Merge pull request #2041 from s3inlc/pkzip-mingw-warning-fix

fixed mingw warnings by making clean hex to binary conversion on hash parsing
This commit is contained in:
Jens Steube 2019-05-21 18:03:17 +02:00 committed by GitHub
commit b795e2689c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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]);
}
}