diff --git a/src/modules/module_17200.c b/src/modules/module_17200.c index 7236b14d3..b40ace1e9 100644 --- a/src/modules/module_17200.c +++ b/src/modules/module_17200.c @@ -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]); } } diff --git a/src/modules/module_17210.c b/src/modules/module_17210.c index 2e1d90298..8d395a2a1 100644 --- a/src/modules/module_17210.c +++ b/src/modules/module_17210.c @@ -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]); } } diff --git a/src/modules/module_17220.c b/src/modules/module_17220.c index 2b6c16bfa..cc3c5a851 100644 --- a/src/modules/module_17220.c +++ b/src/modules/module_17220.c @@ -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]); } } diff --git a/src/modules/module_17230.c b/src/modules/module_17230.c index 649996f45..741bb0e5a 100644 --- a/src/modules/module_17230.c +++ b/src/modules/module_17230.c @@ -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]); } }