mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-23 07:08:19 +00:00
Merge pull request #2353 from s3inlc/patch-separator
Patch all inconsistent separators in modules
This commit is contained in:
commit
2c94c003ce
@ -242,7 +242,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
tmp_salt[salt_len] = 0;
|
||||
|
||||
const int line_len = snprintf (line_buf, line_size, "%s:%s", tmp_buf, tmp_salt);
|
||||
const int line_len = snprintf (line_buf, line_size, "%s%c%s", tmp_buf, hashconfig->separator, tmp_salt);
|
||||
|
||||
return line_len;
|
||||
}
|
||||
|
@ -138,11 +138,12 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
tmp_salt[salt_len] = 0;
|
||||
|
||||
const int out_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x:%s",
|
||||
const int out_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x%c%s",
|
||||
byte_swap_32 (tmp[0]),
|
||||
byte_swap_32 (tmp[1]),
|
||||
byte_swap_32 (tmp[2]),
|
||||
byte_swap_32 (tmp[3]),
|
||||
hashconfig->separator,
|
||||
tmp_salt);
|
||||
|
||||
return out_len;
|
||||
|
@ -51,7 +51,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
token.token_cnt = 2;
|
||||
|
||||
token.sep[0] = ':';
|
||||
token.sep[0] = hashconfig->separator;
|
||||
token.len_min[0] = 16;
|
||||
token.len_max[0] = 16;
|
||||
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
|
@ -97,7 +97,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
tmp_salt[salt_len] = 0;
|
||||
|
||||
const int line_len = snprintf (line_buf, line_size, "%08x:%s", digest[0], tmp_salt);
|
||||
const int line_len = snprintf (line_buf, line_size, "%08x%c%s", digest[0], hashconfig->separator, tmp_salt);
|
||||
|
||||
return line_len;
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
token.token_cnt = 2;
|
||||
|
||||
token.sep[0] = ':';
|
||||
token.sep[0] = hashconfig->separator;
|
||||
token.len_min[0] = 64;
|
||||
token.len_max[0] = 64;
|
||||
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
|
@ -60,7 +60,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
token.token_cnt = 2;
|
||||
|
||||
token.sep[0] = ':';
|
||||
token.sep[0] = hashconfig->separator;
|
||||
token.len_min[0] = 64;
|
||||
token.len_max[0] = 64;
|
||||
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
|
@ -60,7 +60,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
token.token_cnt = 2;
|
||||
|
||||
token.sep[0] = ':';
|
||||
token.sep[0] = hashconfig->separator;
|
||||
token.len_min[0] = 128;
|
||||
token.len_max[0] = 128;
|
||||
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
|
@ -60,7 +60,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
token.token_cnt = 2;
|
||||
|
||||
token.sep[0] = ':';
|
||||
token.sep[0] = hashconfig->separator;
|
||||
token.len_min[0] = 128;
|
||||
token.len_max[0] = 128;
|
||||
token.attr[0] = TOKEN_ATTR_VERIFY_LENGTH
|
||||
|
@ -185,12 +185,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
sprintf (pstoken_tmp + j, "%02x", ptr[i]);
|
||||
}
|
||||
|
||||
const int line_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x%08x:%s",
|
||||
const int line_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x%08x%c%s",
|
||||
digest[0],
|
||||
digest[1],
|
||||
digest[2],
|
||||
digest[3],
|
||||
digest[4],
|
||||
hashconfig->separator,
|
||||
pstoken_tmp);
|
||||
|
||||
return line_len;
|
||||
|
@ -165,7 +165,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
sprintf (buf + j, "%08x", esalt->salt_buf[i]);
|
||||
}
|
||||
|
||||
const int line_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x%08x%08x%08x%08x:%s",
|
||||
const int line_len = snprintf (line_buf, line_size, "%08x%08x%08x%08x%08x%08x%08x%08x%c%s",
|
||||
digest[0],
|
||||
digest[1],
|
||||
digest[2],
|
||||
@ -174,6 +174,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
digest[5],
|
||||
digest[6],
|
||||
digest[7],
|
||||
hashconfig->separator,
|
||||
buf);
|
||||
|
||||
return line_len;
|
||||
|
@ -109,7 +109,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
{
|
||||
const u32 *digest = (const u32 *) digest_buf;
|
||||
|
||||
const int line_len = snprintf (line_buf, line_size, "%08x:%08x", byte_swap_32 (digest[0]), byte_swap_32 (salt->salt_buf[0]));
|
||||
const int line_len = snprintf (line_buf, line_size, "%08x%c%08x", byte_swap_32 (digest[0]), hashconfig->separator, byte_swap_32 (salt->salt_buf[0]));
|
||||
|
||||
return line_len;
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
|
||||
|
||||
const u64 tmp_salt_buf = (((u64) (salt->salt_buf[2])) << 32) | ((u64) (salt->salt_buf[3]));
|
||||
|
||||
const int line_len = snprintf (line_buf, line_size, "%06d:%" PRIu64, digest[0], tmp_salt_buf);
|
||||
const int line_len = snprintf (line_buf, line_size, "%06d%c%" PRIu64, digest[0], hashconfig->separator, tmp_salt_buf);
|
||||
|
||||
return line_len;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user