diff --git a/OpenCL/inc_hash_base58.cl b/OpenCL/inc_hash_base58.cl index a6733ed68..f47f48d25 100644 --- a/OpenCL/inc_hash_base58.cl +++ b/OpenCL/inc_hash_base58.cl @@ -69,8 +69,8 @@ DECLSPEC bool b58dec (PRIVATE_AS u8 *bin, PRIVATE_AS u32 *binszp, PRIVATE_AS con { u32 binsz = *binszp; - PRIVATE_AS const u8 *b58u = (PRIVATE_AS const u8*) b58; - PRIVATE_AS u8 *binu = (PRIVATE_AS u8*) bin; + PRIVATE_AS const u8 *b58u = b58; + PRIVATE_AS u8 *binu = bin; u32 outisz = (binsz + sizeof (u32) - 1) / sizeof (u32); @@ -144,7 +144,7 @@ DECLSPEC bool b58dec (PRIVATE_AS u8 *bin, PRIVATE_AS u32 *binszp, PRIVATE_AS con // Count canonical base58 byte count - binu = (PRIVATE_AS u8*) bin; + binu = bin; for (u32 i = 0; i < binsz; i++) { @@ -255,7 +255,7 @@ DECLSPEC bool b58check (PRIVATE_AS const u8 *bin, PRIVATE_AS const u32 binsz) u32 data[64] = { 0 }; // 64 * 4 = 256 bytes (should be enough) PRIVATE_AS u8 *datac = (PRIVATE_AS u8*) data; - PRIVATE_AS const u8 *binc = (PRIVATE_AS const u8*) bin; + PRIVATE_AS const u8 *binc = bin; if (binsz < 4) return false; if (binsz > 256) return false; @@ -288,7 +288,7 @@ DECLSPEC bool b58check (PRIVATE_AS const u8 *bin, PRIVATE_AS const u32 binsz) ctx.h[0] = hc_swap32_S (ctx.h[0]); PRIVATE_AS u8 *ph4 = (PRIVATE_AS u8*) ctx.h; - PRIVATE_AS const u8 *sum = (PRIVATE_AS const u8*) (binc + (binsz - 4)); // offset: binsz - 4, last 4 bytes + PRIVATE_AS const u8 *sum = (binc + (binsz - 4)); // offset: binsz - 4, last 4 bytes if (ph4[0] != sum[0]) return false; if (ph4[1] != sum[1]) return false; @@ -547,7 +547,7 @@ DECLSPEC bool b58check_38 (PRIVATE_AS const u32 *bin) DECLSPEC bool b58enc (PRIVATE_AS u8 *b58, PRIVATE_AS u32 *b58sz, PRIVATE_AS const u8 *data, PRIVATE_AS const u32 binsz) { - PRIVATE_AS const u8 *bin = (PRIVATE_AS const u8 *) data; + PRIVATE_AS const u8 *bin = data; int carry; u32 j = 0; @@ -609,7 +609,7 @@ DECLSPEC bool b58check_enc (PRIVATE_AS u8 *b58c, PRIVATE_AS u32 *b58c_sz, PRIVAT u8 buf[128] = { 0 }; PRIVATE_AS u32 *buf32 = (PRIVATE_AS u32*) buf; - PRIVATE_AS const u8 *data8 = (PRIVATE_AS const u8 *) data; + PRIVATE_AS const u8 *data8 = data; PRIVATE_AS u8 *hash = &buf[1 + datasz]; @@ -641,7 +641,7 @@ DECLSPEC bool b58check_enc (PRIVATE_AS u8 *b58c, PRIVATE_AS u32 *b58c_sz, PRIVAT for (u32 i = 0; i < 4; i++) { - ((PRIVATE_AS u8 *) hash)[i] = ((PRIVATE_AS u8 *) ctx.h)[i]; + (hash)[i] = ((PRIVATE_AS u8 *) ctx.h)[i]; } return b58enc (b58c, b58c_sz, buf, 1 + datasz + 4); diff --git a/src/backend.c b/src/backend.c index 91f425fcb..384bb0d17 100644 --- a/src/backend.c +++ b/src/backend.c @@ -15083,7 +15083,7 @@ int backend_session_begin (hashcat_ctx_t *hashcat_ctx) // size_pws_idx - size_pws_idx = (u64) (kernel_power_max + 1) * sizeof (pw_idx_t); + size_pws_idx = (kernel_power_max + 1) * sizeof (pw_idx_t); // size_tmps diff --git a/src/dispatch.c b/src/dispatch.c index db830e015..fdb0b441d 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -247,12 +247,12 @@ static int calc_stdin (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_par char rule_buf_out[RP_PASSWORD_SIZE]; int rule_jk_len = (int) user_options_extra->rule_len_l; - const char *rule_jk_buf = (const char *) user_options->rule_buf_l; + const char *rule_jk_buf = user_options->rule_buf_l; if (attack_mode == ATTACK_MODE_HYBRID2) { rule_jk_len = (int) user_options_extra->rule_len_r; - rule_jk_buf = (const char *) user_options->rule_buf_r; + rule_jk_buf = user_options->rule_buf_r; } if (run_rule_engine (rule_jk_len, rule_jk_buf)) @@ -1426,12 +1426,12 @@ static int calc (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param) // post-process rule engine int rule_jk_len = (int) user_options_extra->rule_len_l; - const char *rule_jk_buf = (const char *) user_options->rule_buf_l; + const char *rule_jk_buf = user_options->rule_buf_l; if (attack_mode == ATTACK_MODE_HYBRID2) { rule_jk_len = (int) user_options_extra->rule_len_r; - rule_jk_buf = (const char *) user_options->rule_buf_r; + rule_jk_buf = user_options->rule_buf_r; } if (run_rule_engine (rule_jk_len, rule_jk_buf)) diff --git a/src/filehandling.c b/src/filehandling.c index 4d56a2f2c..9a2d0ea39 100644 --- a/src/filehandling.c +++ b/src/filehandling.c @@ -477,7 +477,7 @@ size_t hc_fread (void *ptr, size_t size, size_t nmemb, HCFILE *fp) if (inLeft == 0 && outLeft == 0) { /* partial read */ - n = (size_t) (outPos / size); + n = (outPos / size); break; } outPos += outLeft; diff --git a/src/interface.c b/src/interface.c index a4a13fd03..14faddd89 100644 --- a/src/interface.c +++ b/src/interface.c @@ -469,18 +469,18 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) { const int hook_threads = (int) user_options->hook_threads; - module_ctx->hook_extra_params = (void *) hccalloc (hook_threads, sizeof (void *)); + module_ctx->hook_extra_params = hccalloc (hook_threads, sizeof (void *)); for (int i = 0; i < hook_threads; i++) { - module_ctx->hook_extra_params[i] = (void *) hcmalloc (hashconfig->hook_extra_param_size); + module_ctx->hook_extra_params[i] = hcmalloc (hashconfig->hook_extra_param_size); } } else { - module_ctx->hook_extra_params = (void *) hccalloc (1, sizeof (void *)); + module_ctx->hook_extra_params = hccalloc (1, sizeof (void *)); - module_ctx->hook_extra_params[0] = (void *) hcmalloc (1); + module_ctx->hook_extra_params[0] = hcmalloc (1); } if (module_ctx->module_hook_extra_param_init != MODULE_DEFAULT) diff --git a/src/modules/module_00501.c b/src/modules/module_00501.c index 76980adaa..f31985406 100644 --- a/src/modules/module_00501.c +++ b/src/modules/module_00501.c @@ -107,7 +107,7 @@ static void juniper_decrypt_hash (const u8 *in, const int in_len, u8 *out) u8 base64_buf[100] = { 0 }; - base64_decode (base64_to_int, (const u8 *) in, in_len, base64_buf); + base64_decode (base64_to_int, in, in_len, base64_buf); // iv stuff diff --git a/src/modules/module_03200.c b/src/modules/module_03200.c index c3706ffa8..bd38d8aec 100644 --- a/src/modules/module_03200.c +++ b/src/modules/module_03200.c @@ -227,7 +227,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - base64_decode (bf64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + base64_decode (bf64_to_int, salt_pos, salt_len, tmp_buf); memcpy (salt_buf_ptr, tmp_buf, 16); @@ -238,7 +238,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - base64_decode (bf64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (bf64_to_int, hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, 24); diff --git a/src/modules/module_03730.c b/src/modules/module_03730.c index eb37c234f..c5959ad06 100644 --- a/src/modules/module_03730.c +++ b/src/modules/module_03730.c @@ -122,11 +122,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE digest[3] -= MD5M_D; } - const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_double_salt->salt1_buf, (int *) &md5_double_salt->salt1_len); + const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_double_salt->salt1_buf, &md5_double_salt->salt1_len); if (parse_rc1 == false) return (PARSER_SALT_LENGTH); - const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_double_salt->salt2_buf, (int *) &md5_double_salt->salt2_len); + const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_double_salt->salt2_buf, &md5_double_salt->salt2_len); if (parse_rc2 == false) return (PARSER_SALT_LENGTH); @@ -186,13 +186,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt1_buf, (const int) md5_double_salt->salt1_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt1_buf, md5_double_salt->salt1_len, out_buf + out_len); out_buf[out_len] = hashconfig->separator; out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt2_buf, (const int) md5_double_salt->salt2_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt2_buf, md5_double_salt->salt2_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_04510.c b/src/modules/module_04510.c index 51d0a686a..6659b478d 100644 --- a/src/modules/module_04510.c +++ b/src/modules/module_04510.c @@ -166,7 +166,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_04710.c b/src/modules/module_04710.c index 48d0e0a9b..6a04380c0 100644 --- a/src/modules/module_04710.c +++ b/src/modules/module_04710.c @@ -166,7 +166,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_04711.c b/src/modules/module_04711.c index 5020a5d18..1e1bfdcc0 100644 --- a/src/modules/module_04711.c +++ b/src/modules/module_04711.c @@ -167,7 +167,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_05200.c b/src/modules/module_05200.c index 66eb5fd8d..47fb863cb 100644 --- a/src/modules/module_05200.c +++ b/src/modules/module_05200.c @@ -133,7 +133,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE HCFILE fp; - if (hc_fopen (&fp, (const char *) line_buf, "rb") == false) return (PARSER_HASH_FILE); + if (hc_fopen (&fp, line_buf, "rb") == false) return (PARSER_HASH_FILE); psafe3_t in; diff --git a/src/modules/module_05700.c b/src/modules/module_05700.c index dab3dc8c5..e981eeea1 100644 --- a/src/modules/module_05700.c +++ b/src/modules/module_05700.c @@ -71,7 +71,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[100] = { 0 }; - base64_decode (itoa64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (itoa64_to_int, hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, 32); diff --git a/src/modules/module_06800.c b/src/modules/module_06800.c index 35eebf6b4..6439f98f3 100644 --- a/src/modules/module_06800.c +++ b/src/modules/module_06800.c @@ -175,7 +175,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE lastpass_t *lastpass = (lastpass_t *) esalt_buf; - const int iv_size = hex_decode ((const u8 *) token.buf[3], token.len[3], (u8 *) lastpass->iv); + const int iv_size = hex_decode (token.buf[3], token.len[3], (u8 *) lastpass->iv); if (iv_size != sizeof (lastpass->iv)) return (PARSER_IV_LENGTH); diff --git a/src/modules/module_07401.c b/src/modules/module_07401.c index b19aefaaa..ae5fdd434 100644 --- a/src/modules/module_07401.c +++ b/src/modules/module_07401.c @@ -358,7 +358,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_dgst[100] = { 0 }; - const int dgst_len = hex_decode ((const u8 *) hash_pos, hash_len, (u8 *) tmp_dgst); + const int dgst_len = hex_decode (hash_pos, hash_len, (u8 *) tmp_dgst); if (dgst_len != 43) return (PARSER_HASH_ENCODING); diff --git a/src/modules/module_07800.c b/src/modules/module_07800.c index 080a26252..8aa784460 100644 --- a/src/modules/module_07800.c +++ b/src/modules/module_07800.c @@ -109,11 +109,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[1]; - digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]); - digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]); - digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]); - digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]); - digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]); + digest[0] = hex_to_u32 (&hash_pos[ 0]); + digest[1] = hex_to_u32 (&hash_pos[ 8]); + digest[2] = hex_to_u32 (&hash_pos[16]); + digest[3] = hex_to_u32 (&hash_pos[24]); + digest[4] = hex_to_u32 (&hash_pos[32]); digest[0] = byte_swap_32 (digest[0]); digest[1] = byte_swap_32 (digest[1]); diff --git a/src/modules/module_07801.c b/src/modules/module_07801.c index 0e390d259..4caf03e84 100644 --- a/src/modules/module_07801.c +++ b/src/modules/module_07801.c @@ -109,11 +109,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[1]; - digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]); - digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]); - digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]); - digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]); - digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]); + digest[0] = hex_to_u32 (&hash_pos[ 0]); + digest[1] = hex_to_u32 (&hash_pos[ 8]); + digest[2] = hex_to_u32 (&hash_pos[16]); + digest[3] = hex_to_u32 (&hash_pos[24]); + digest[4] = hex_to_u32 (&hash_pos[32]); digest[0] = byte_swap_32 (digest[0]); digest[1] = byte_swap_32 (digest[1]); diff --git a/src/modules/module_08900.c b/src/modules/module_08900.c index d7b7a9a62..6f996a3b0 100644 --- a/src/modules/module_08900.c +++ b/src/modules/module_08900.c @@ -336,7 +336,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[128] = { 0 }; - const int tmp_len = base64_decode (base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + const int tmp_len = base64_decode (base64_to_int, salt_pos, salt_len, tmp_buf); memcpy (salt->salt_buf, tmp_buf, tmp_len); @@ -349,7 +349,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - const int digest_len = base64_decode (base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + const int digest_len = base64_decode (base64_to_int, hash_pos, hash_len, tmp_buf); // digest_len should be safe because of 88 limit diff --git a/src/modules/module_09000.c b/src/modules/module_09000.c index 8ea86ae32..4ed3b41ff 100644 --- a/src/modules/module_09000.c +++ b/src/modules/module_09000.c @@ -188,7 +188,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE HCFILE fp; - if (hc_fopen (&fp, (const char *) line_buf, "rb") == false) return (PARSER_HASH_FILE); + if (hc_fopen (&fp, line_buf, "rb") == false) return (PARSER_HASH_FILE); psafe2_hdr buf; diff --git a/src/modules/module_10000.c b/src/modules/module_10000.c index ce6518d3d..47901e03c 100644 --- a/src/modules/module_10000.c +++ b/src/modules/module_10000.c @@ -164,7 +164,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[100] = { 0 }; - base64_decode (base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (base64_to_int, hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, 32); diff --git a/src/modules/module_10200.c b/src/modules/module_10200.c index cad5a4888..8c743a518 100644 --- a/src/modules/module_10200.c +++ b/src/modules/module_10200.c @@ -111,7 +111,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[256] = { 0 }; - const int tmp_len = base64_decode (base64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + const int tmp_len = base64_decode (base64_to_int, hash_pos, hash_len, tmp_buf); if (tmp_len < 32 + 1) return (PARSER_HASH_LENGTH); diff --git a/src/modules/module_10300.c b/src/modules/module_10300.c index 0768b6029..85937d115 100644 --- a/src/modules/module_10300.c +++ b/src/modules/module_10300.c @@ -117,7 +117,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[100] = { 0 }; - const u32 decoded_len = base64_decode (base64_to_int, (const u8 *) base64_pos, base64_len, tmp_buf); + const u32 decoded_len = base64_decode (base64_to_int, base64_pos, base64_len, tmp_buf); if (decoded_len < 24) return (PARSER_SALT_LENGTH); diff --git a/src/modules/module_10600.c b/src/modules/module_10600.c index dc5422137..6cd76cbbd 100644 --- a/src/modules/module_10600.c +++ b/src/modules/module_10600.c @@ -236,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 0, j = 0; i < 8 + 2; i += 1, j += 8) { - pdf->u_buf[i] = hex_to_u32 ((const u8 *) &u_buf_pos[j]); + pdf->u_buf[i] = hex_to_u32 (&u_buf_pos[j]); } salt->salt_buf[0] = pdf->u_buf[8]; diff --git a/src/modules/module_10700.c b/src/modules/module_10700.c index 9b6fa97a3..05be37b65 100644 --- a/src/modules/module_10700.c +++ b/src/modules/module_10700.c @@ -315,7 +315,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 0, j = 0; i < 8 + 2; i += 1, j += 8) { - pdf->u_buf[i] = hex_to_u32 ((const u8 *) &u_buf_pos[j]); + pdf->u_buf[i] = hex_to_u32 (&u_buf_pos[j]); } salt->salt_buf[0] = pdf->u_buf[8]; diff --git a/src/modules/module_11300.c b/src/modules/module_11300.c index 7b81b3d26..6ece4048a 100644 --- a/src/modules/module_11300.c +++ b/src/modules/module_11300.c @@ -236,7 +236,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 0, j = 0; j < cry_master_len; i += 1, j += 8) { - bitcoin_wallet->cry_master_buf[i] = hex_to_u32 ((const u8 *) &cry_master_buf_pos[j]); + bitcoin_wallet->cry_master_buf[i] = hex_to_u32 (&cry_master_buf_pos[j]); } bitcoin_wallet->cry_master_len = cry_master_len / 2; diff --git a/src/modules/module_11400.c b/src/modules/module_11400.c index f6f656629..e5264d053 100644 --- a/src/modules/module_11400.c +++ b/src/modules/module_11400.c @@ -408,10 +408,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE * digest */ - digest[0] = hex_to_u32 ((const u8 *) &digest_pos[ 0]); - digest[1] = hex_to_u32 ((const u8 *) &digest_pos[ 8]); - digest[2] = hex_to_u32 ((const u8 *) &digest_pos[16]); - digest[3] = hex_to_u32 ((const u8 *) &digest_pos[24]); + digest[0] = hex_to_u32 (&digest_pos[ 0]); + digest[1] = hex_to_u32 (&digest_pos[ 8]); + digest[2] = hex_to_u32 (&digest_pos[16]); + digest[3] = hex_to_u32 (&digest_pos[24]); return (PARSER_OK); } diff --git a/src/modules/module_11600.c b/src/modules/module_11600.c index 43f5b3c3f..7205f6b7e 100644 --- a/src/modules/module_11600.c +++ b/src/modules/module_11600.c @@ -657,7 +657,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0, j = 0; j < coder_attributes_len; i += 1, j += 2) { - seven_zip->coder_attributes[i] = hex_to_u8 ((const u8 *) &coder_attributes_pos[j]); + seven_zip->coder_attributes[i] = hex_to_u8 (&coder_attributes_pos[j]); seven_zip->coder_attributes_len++; } diff --git a/src/modules/module_13100.c b/src/modules/module_13100.c index 536f16aa1..eb6288fb6 100644 --- a/src/modules/module_13100.c +++ b/src/modules/module_13100.c @@ -133,8 +133,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { if (line_buf[token.len[0] + 3] == '*') { - const char *account_info_start = (const char *) line_buf + 12; // we want the * char included - char *account_info_stop = strchr ((const char *) account_info_start + 1, '*'); + const char *account_info_start = line_buf + 12; // we want the * char included + char *account_info_stop = strchr (account_info_start + 1, '*'); if (account_info_stop == NULL) return (PARSER_SEPARATOR_UNMATCHED); diff --git a/src/modules/module_13400.c b/src/modules/module_13400.c index 6186e4632..8f019d859 100644 --- a/src/modules/module_13400.c +++ b/src/modules/module_13400.c @@ -282,10 +282,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *final_random_seed_pos = token.buf[4]; - keepass->final_random_seed[0] = hex_to_u32 ((const u8 *) &final_random_seed_pos[ 0]); - keepass->final_random_seed[1] = hex_to_u32 ((const u8 *) &final_random_seed_pos[ 8]); - keepass->final_random_seed[2] = hex_to_u32 ((const u8 *) &final_random_seed_pos[16]); - keepass->final_random_seed[3] = hex_to_u32 ((const u8 *) &final_random_seed_pos[24]); + keepass->final_random_seed[0] = hex_to_u32 (&final_random_seed_pos[ 0]); + keepass->final_random_seed[1] = hex_to_u32 (&final_random_seed_pos[ 8]); + keepass->final_random_seed[2] = hex_to_u32 (&final_random_seed_pos[16]); + keepass->final_random_seed[3] = hex_to_u32 (&final_random_seed_pos[24]); keepass->final_random_seed[0] = byte_swap_32 (keepass->final_random_seed[0]); keepass->final_random_seed[1] = byte_swap_32 (keepass->final_random_seed[1]); @@ -294,10 +294,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (keepass->version == 2) { - keepass->final_random_seed[4] = hex_to_u32 ((const u8 *) &final_random_seed_pos[32]); - keepass->final_random_seed[5] = hex_to_u32 ((const u8 *) &final_random_seed_pos[40]); - keepass->final_random_seed[6] = hex_to_u32 ((const u8 *) &final_random_seed_pos[48]); - keepass->final_random_seed[7] = hex_to_u32 ((const u8 *) &final_random_seed_pos[56]); + keepass->final_random_seed[4] = hex_to_u32 (&final_random_seed_pos[32]); + keepass->final_random_seed[5] = hex_to_u32 (&final_random_seed_pos[40]); + keepass->final_random_seed[6] = hex_to_u32 (&final_random_seed_pos[48]); + keepass->final_random_seed[7] = hex_to_u32 (&final_random_seed_pos[56]); keepass->final_random_seed[4] = byte_swap_32 (keepass->final_random_seed[4]); keepass->final_random_seed[5] = byte_swap_32 (keepass->final_random_seed[5]); @@ -309,14 +309,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *transf_random_seed_pos = token.buf[5]; - keepass->transf_random_seed[0] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[ 0]); - keepass->transf_random_seed[1] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[ 8]); - keepass->transf_random_seed[2] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[16]); - keepass->transf_random_seed[3] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[24]); - keepass->transf_random_seed[4] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[32]); - keepass->transf_random_seed[5] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[40]); - keepass->transf_random_seed[6] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[48]); - keepass->transf_random_seed[7] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[56]); + keepass->transf_random_seed[0] = hex_to_u32 (&transf_random_seed_pos[ 0]); + keepass->transf_random_seed[1] = hex_to_u32 (&transf_random_seed_pos[ 8]); + keepass->transf_random_seed[2] = hex_to_u32 (&transf_random_seed_pos[16]); + keepass->transf_random_seed[3] = hex_to_u32 (&transf_random_seed_pos[24]); + keepass->transf_random_seed[4] = hex_to_u32 (&transf_random_seed_pos[32]); + keepass->transf_random_seed[5] = hex_to_u32 (&transf_random_seed_pos[40]); + keepass->transf_random_seed[6] = hex_to_u32 (&transf_random_seed_pos[48]); + keepass->transf_random_seed[7] = hex_to_u32 (&transf_random_seed_pos[56]); keepass->transf_random_seed[0] = byte_swap_32 (keepass->transf_random_seed[0]); keepass->transf_random_seed[1] = byte_swap_32 (keepass->transf_random_seed[1]); @@ -331,10 +331,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *enc_iv_pos = token.buf[6]; - keepass->enc_iv[0] = hex_to_u32 ((const u8 *) &enc_iv_pos[ 0]); - keepass->enc_iv[1] = hex_to_u32 ((const u8 *) &enc_iv_pos[ 8]); - keepass->enc_iv[2] = hex_to_u32 ((const u8 *) &enc_iv_pos[16]); - keepass->enc_iv[3] = hex_to_u32 ((const u8 *) &enc_iv_pos[24]); + keepass->enc_iv[0] = hex_to_u32 (&enc_iv_pos[ 0]); + keepass->enc_iv[1] = hex_to_u32 (&enc_iv_pos[ 8]); + keepass->enc_iv[2] = hex_to_u32 (&enc_iv_pos[16]); + keepass->enc_iv[3] = hex_to_u32 (&enc_iv_pos[24]); keepass->enc_iv[0] = byte_swap_32 (keepass->enc_iv[0]); keepass->enc_iv[1] = byte_swap_32 (keepass->enc_iv[1]); @@ -349,14 +349,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *contents_hash_pos = token.buf[7]; - keepass->contents_hash[0] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 0]); - keepass->contents_hash[1] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 8]); - keepass->contents_hash[2] = hex_to_u32 ((const u8 *) &contents_hash_pos[16]); - keepass->contents_hash[3] = hex_to_u32 ((const u8 *) &contents_hash_pos[24]); - keepass->contents_hash[4] = hex_to_u32 ((const u8 *) &contents_hash_pos[32]); - keepass->contents_hash[5] = hex_to_u32 ((const u8 *) &contents_hash_pos[40]); - keepass->contents_hash[6] = hex_to_u32 ((const u8 *) &contents_hash_pos[48]); - keepass->contents_hash[7] = hex_to_u32 ((const u8 *) &contents_hash_pos[56]); + keepass->contents_hash[0] = hex_to_u32 (&contents_hash_pos[ 0]); + keepass->contents_hash[1] = hex_to_u32 (&contents_hash_pos[ 8]); + keepass->contents_hash[2] = hex_to_u32 (&contents_hash_pos[16]); + keepass->contents_hash[3] = hex_to_u32 (&contents_hash_pos[24]); + keepass->contents_hash[4] = hex_to_u32 (&contents_hash_pos[32]); + keepass->contents_hash[5] = hex_to_u32 (&contents_hash_pos[40]); + keepass->contents_hash[6] = hex_to_u32 (&contents_hash_pos[48]); + keepass->contents_hash[7] = hex_to_u32 (&contents_hash_pos[56]); keepass->contents_hash[0] = byte_swap_32 (keepass->contents_hash[0]); keepass->contents_hash[1] = byte_swap_32 (keepass->contents_hash[1]); @@ -376,7 +376,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 0, j = 0; j < contents_len; i += 1, j += 8) { - keepass->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[j]); + keepass->contents[i] = hex_to_u32 (&contents_pos[j]); keepass->contents[i] = byte_swap_32 (keepass->contents[i]); } @@ -392,14 +392,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *expected_bytes_pos = token.buf[7]; - keepass->expected_bytes[0] = hex_to_u32 ((const u8 *) &expected_bytes_pos[ 0]); - keepass->expected_bytes[1] = hex_to_u32 ((const u8 *) &expected_bytes_pos[ 8]); - keepass->expected_bytes[2] = hex_to_u32 ((const u8 *) &expected_bytes_pos[16]); - keepass->expected_bytes[3] = hex_to_u32 ((const u8 *) &expected_bytes_pos[24]); - keepass->expected_bytes[4] = hex_to_u32 ((const u8 *) &expected_bytes_pos[32]); - keepass->expected_bytes[5] = hex_to_u32 ((const u8 *) &expected_bytes_pos[40]); - keepass->expected_bytes[6] = hex_to_u32 ((const u8 *) &expected_bytes_pos[48]); - keepass->expected_bytes[7] = hex_to_u32 ((const u8 *) &expected_bytes_pos[56]); + keepass->expected_bytes[0] = hex_to_u32 (&expected_bytes_pos[ 0]); + keepass->expected_bytes[1] = hex_to_u32 (&expected_bytes_pos[ 8]); + keepass->expected_bytes[2] = hex_to_u32 (&expected_bytes_pos[16]); + keepass->expected_bytes[3] = hex_to_u32 (&expected_bytes_pos[24]); + keepass->expected_bytes[4] = hex_to_u32 (&expected_bytes_pos[32]); + keepass->expected_bytes[5] = hex_to_u32 (&expected_bytes_pos[40]); + keepass->expected_bytes[6] = hex_to_u32 (&expected_bytes_pos[48]); + keepass->expected_bytes[7] = hex_to_u32 (&expected_bytes_pos[56]); keepass->expected_bytes[0] = byte_swap_32 (keepass->expected_bytes[0]); keepass->expected_bytes[1] = byte_swap_32 (keepass->expected_bytes[1]); @@ -414,14 +414,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *contents_hash_pos = token.buf[8]; - keepass->contents_hash[0] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 0]); - keepass->contents_hash[1] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 8]); - keepass->contents_hash[2] = hex_to_u32 ((const u8 *) &contents_hash_pos[16]); - keepass->contents_hash[3] = hex_to_u32 ((const u8 *) &contents_hash_pos[24]); - keepass->contents_hash[4] = hex_to_u32 ((const u8 *) &contents_hash_pos[32]); - keepass->contents_hash[5] = hex_to_u32 ((const u8 *) &contents_hash_pos[40]); - keepass->contents_hash[6] = hex_to_u32 ((const u8 *) &contents_hash_pos[48]); - keepass->contents_hash[7] = hex_to_u32 ((const u8 *) &contents_hash_pos[56]); + keepass->contents_hash[0] = hex_to_u32 (&contents_hash_pos[ 0]); + keepass->contents_hash[1] = hex_to_u32 (&contents_hash_pos[ 8]); + keepass->contents_hash[2] = hex_to_u32 (&contents_hash_pos[16]); + keepass->contents_hash[3] = hex_to_u32 (&contents_hash_pos[24]); + keepass->contents_hash[4] = hex_to_u32 (&contents_hash_pos[32]); + keepass->contents_hash[5] = hex_to_u32 (&contents_hash_pos[40]); + keepass->contents_hash[6] = hex_to_u32 (&contents_hash_pos[48]); + keepass->contents_hash[7] = hex_to_u32 (&contents_hash_pos[56]); keepass->contents_hash[0] = byte_swap_32 (keepass->contents_hash[0]); keepass->contents_hash[1] = byte_swap_32 (keepass->contents_hash[1]); @@ -442,14 +442,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { keepass->keyfile_len = 32; - keepass->keyfile[0] = hex_to_u32 ((const u8 *) &keyfile_pos[ 0]); - keepass->keyfile[1] = hex_to_u32 ((const u8 *) &keyfile_pos[ 8]); - keepass->keyfile[2] = hex_to_u32 ((const u8 *) &keyfile_pos[16]); - keepass->keyfile[3] = hex_to_u32 ((const u8 *) &keyfile_pos[24]); - keepass->keyfile[4] = hex_to_u32 ((const u8 *) &keyfile_pos[32]); - keepass->keyfile[5] = hex_to_u32 ((const u8 *) &keyfile_pos[40]); - keepass->keyfile[6] = hex_to_u32 ((const u8 *) &keyfile_pos[48]); - keepass->keyfile[7] = hex_to_u32 ((const u8 *) &keyfile_pos[56]); + keepass->keyfile[0] = hex_to_u32 (&keyfile_pos[ 0]); + keepass->keyfile[1] = hex_to_u32 (&keyfile_pos[ 8]); + keepass->keyfile[2] = hex_to_u32 (&keyfile_pos[16]); + keepass->keyfile[3] = hex_to_u32 (&keyfile_pos[24]); + keepass->keyfile[4] = hex_to_u32 (&keyfile_pos[32]); + keepass->keyfile[5] = hex_to_u32 (&keyfile_pos[40]); + keepass->keyfile[6] = hex_to_u32 (&keyfile_pos[48]); + keepass->keyfile[7] = hex_to_u32 (&keyfile_pos[56]); keepass->keyfile[0] = byte_swap_32 (keepass->keyfile[0]); keepass->keyfile[1] = byte_swap_32 (keepass->keyfile[1]); diff --git a/src/modules/module_13600.c b/src/modules/module_13600.c index c6dd15498..f927d5761 100644 --- a/src/modules/module_13600.c +++ b/src/modules/module_13600.c @@ -245,8 +245,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { if (salt_len != 16) return (PARSER_SALT_VALUE); - zip2->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[ 0]); - zip2->salt_buf[1] = hex_to_u32 ((const u8 *) &salt_pos[ 8]); + zip2->salt_buf[0] = hex_to_u32 (&salt_pos[ 0]); + zip2->salt_buf[1] = hex_to_u32 (&salt_pos[ 8]); zip2->salt_buf[2] = 0; zip2->salt_buf[3] = 0; @@ -256,9 +256,9 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { if (salt_len != 24) return (PARSER_SALT_VALUE); - zip2->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[ 0]); - zip2->salt_buf[1] = hex_to_u32 ((const u8 *) &salt_pos[ 8]); - zip2->salt_buf[2] = hex_to_u32 ((const u8 *) &salt_pos[16]); + zip2->salt_buf[0] = hex_to_u32 (&salt_pos[ 0]); + zip2->salt_buf[1] = hex_to_u32 (&salt_pos[ 8]); + zip2->salt_buf[2] = hex_to_u32 (&salt_pos[16]); zip2->salt_buf[3] = 0; zip2->salt_len = 12; @@ -267,10 +267,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { if (salt_len != 32) return (PARSER_SALT_VALUE); - zip2->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[ 0]); - zip2->salt_buf[1] = hex_to_u32 ((const u8 *) &salt_pos[ 8]); - zip2->salt_buf[2] = hex_to_u32 ((const u8 *) &salt_pos[16]); - zip2->salt_buf[3] = hex_to_u32 ((const u8 *) &salt_pos[24]); + zip2->salt_buf[0] = hex_to_u32 (&salt_pos[ 0]); + zip2->salt_buf[1] = hex_to_u32 (&salt_pos[ 8]); + zip2->salt_buf[2] = hex_to_u32 (&salt_pos[16]); + zip2->salt_buf[3] = hex_to_u32 (&salt_pos[24]); zip2->salt_len = 16; } diff --git a/src/modules/module_14600.c b/src/modules/module_14600.c index 19421eabc..6848ca06a 100644 --- a/src/modules/module_14600.c +++ b/src/modules/module_14600.c @@ -380,7 +380,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE HCFILE fp; - if (hc_fopen (&fp, (const char *) line_buf, "rb") == false) return (PARSER_HAVE_ERRNO); + if (hc_fopen (&fp, line_buf, "rb") == false) return (PARSER_HAVE_ERRNO); struct luks_phdr hdr; diff --git a/src/modules/module_14700.c b/src/modules/module_14700.c index 601e07063..f71fd99a9 100644 --- a/src/modules/module_14700.c +++ b/src/modules/module_14700.c @@ -169,16 +169,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 *wpky_buf_ptr = (u32 *) itunes_backup->wpky; - wpky_buf_ptr[0] = hex_to_u32 ((const u8 *) &wpky_pos[ 0]); - wpky_buf_ptr[1] = hex_to_u32 ((const u8 *) &wpky_pos[ 8]); - wpky_buf_ptr[2] = hex_to_u32 ((const u8 *) &wpky_pos[16]); - wpky_buf_ptr[3] = hex_to_u32 ((const u8 *) &wpky_pos[24]); - wpky_buf_ptr[4] = hex_to_u32 ((const u8 *) &wpky_pos[32]); - wpky_buf_ptr[5] = hex_to_u32 ((const u8 *) &wpky_pos[40]); - wpky_buf_ptr[6] = hex_to_u32 ((const u8 *) &wpky_pos[48]); - wpky_buf_ptr[7] = hex_to_u32 ((const u8 *) &wpky_pos[56]); - wpky_buf_ptr[8] = hex_to_u32 ((const u8 *) &wpky_pos[64]); - wpky_buf_ptr[9] = hex_to_u32 ((const u8 *) &wpky_pos[72]); + wpky_buf_ptr[0] = hex_to_u32 (&wpky_pos[ 0]); + wpky_buf_ptr[1] = hex_to_u32 (&wpky_pos[ 8]); + wpky_buf_ptr[2] = hex_to_u32 (&wpky_pos[16]); + wpky_buf_ptr[3] = hex_to_u32 (&wpky_pos[24]); + wpky_buf_ptr[4] = hex_to_u32 (&wpky_pos[32]); + wpky_buf_ptr[5] = hex_to_u32 (&wpky_pos[40]); + wpky_buf_ptr[6] = hex_to_u32 (&wpky_pos[48]); + wpky_buf_ptr[7] = hex_to_u32 (&wpky_pos[56]); + wpky_buf_ptr[8] = hex_to_u32 (&wpky_pos[64]); + wpky_buf_ptr[9] = hex_to_u32 (&wpky_pos[72]); wpky_buf_ptr[0] = byte_swap_32 (wpky_buf_ptr[0]); wpky_buf_ptr[1] = byte_swap_32 (wpky_buf_ptr[1]); @@ -254,11 +254,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 *dpsl_buf_ptr = (u32 *) itunes_backup->dpsl; - dpsl_buf_ptr[0] = hex_to_u32 ((const u8 *) &dpsl_pos[ 0]); - dpsl_buf_ptr[1] = hex_to_u32 ((const u8 *) &dpsl_pos[ 8]); - dpsl_buf_ptr[2] = hex_to_u32 ((const u8 *) &dpsl_pos[16]); - dpsl_buf_ptr[3] = hex_to_u32 ((const u8 *) &dpsl_pos[24]); - dpsl_buf_ptr[4] = hex_to_u32 ((const u8 *) &dpsl_pos[32]); + dpsl_buf_ptr[0] = hex_to_u32 (&dpsl_pos[ 0]); + dpsl_buf_ptr[1] = hex_to_u32 (&dpsl_pos[ 8]); + dpsl_buf_ptr[2] = hex_to_u32 (&dpsl_pos[16]); + dpsl_buf_ptr[3] = hex_to_u32 (&dpsl_pos[24]); + dpsl_buf_ptr[4] = hex_to_u32 (&dpsl_pos[32]); dpsl_buf_ptr[0] = byte_swap_32 (dpsl_buf_ptr[ 0]); dpsl_buf_ptr[1] = byte_swap_32 (dpsl_buf_ptr[ 1]); diff --git a/src/modules/module_14800.c b/src/modules/module_14800.c index 2825b93ce..2a5f6b33c 100644 --- a/src/modules/module_14800.c +++ b/src/modules/module_14800.c @@ -185,16 +185,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 *wpky_buf_ptr = (u32 *) itunes_backup->wpky; - wpky_buf_ptr[0] = hex_to_u32 ((const u8 *) &wpky_pos[ 0]); - wpky_buf_ptr[1] = hex_to_u32 ((const u8 *) &wpky_pos[ 8]); - wpky_buf_ptr[2] = hex_to_u32 ((const u8 *) &wpky_pos[16]); - wpky_buf_ptr[3] = hex_to_u32 ((const u8 *) &wpky_pos[24]); - wpky_buf_ptr[4] = hex_to_u32 ((const u8 *) &wpky_pos[32]); - wpky_buf_ptr[5] = hex_to_u32 ((const u8 *) &wpky_pos[40]); - wpky_buf_ptr[6] = hex_to_u32 ((const u8 *) &wpky_pos[48]); - wpky_buf_ptr[7] = hex_to_u32 ((const u8 *) &wpky_pos[56]); - wpky_buf_ptr[8] = hex_to_u32 ((const u8 *) &wpky_pos[64]); - wpky_buf_ptr[9] = hex_to_u32 ((const u8 *) &wpky_pos[72]); + wpky_buf_ptr[0] = hex_to_u32 (&wpky_pos[ 0]); + wpky_buf_ptr[1] = hex_to_u32 (&wpky_pos[ 8]); + wpky_buf_ptr[2] = hex_to_u32 (&wpky_pos[16]); + wpky_buf_ptr[3] = hex_to_u32 (&wpky_pos[24]); + wpky_buf_ptr[4] = hex_to_u32 (&wpky_pos[32]); + wpky_buf_ptr[5] = hex_to_u32 (&wpky_pos[40]); + wpky_buf_ptr[6] = hex_to_u32 (&wpky_pos[48]); + wpky_buf_ptr[7] = hex_to_u32 (&wpky_pos[56]); + wpky_buf_ptr[8] = hex_to_u32 (&wpky_pos[64]); + wpky_buf_ptr[9] = hex_to_u32 (&wpky_pos[72]); wpky_buf_ptr[0] = byte_swap_32 (wpky_buf_ptr[0]); wpky_buf_ptr[1] = byte_swap_32 (wpky_buf_ptr[1]); @@ -270,11 +270,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 *dpsl_buf_ptr = (u32 *) itunes_backup->dpsl; - dpsl_buf_ptr[0] = hex_to_u32 ((const u8 *) &dpsl_pos[ 0]); - dpsl_buf_ptr[1] = hex_to_u32 ((const u8 *) &dpsl_pos[ 8]); - dpsl_buf_ptr[2] = hex_to_u32 ((const u8 *) &dpsl_pos[16]); - dpsl_buf_ptr[3] = hex_to_u32 ((const u8 *) &dpsl_pos[24]); - dpsl_buf_ptr[4] = hex_to_u32 ((const u8 *) &dpsl_pos[32]); + dpsl_buf_ptr[0] = hex_to_u32 (&dpsl_pos[ 0]); + dpsl_buf_ptr[1] = hex_to_u32 (&dpsl_pos[ 8]); + dpsl_buf_ptr[2] = hex_to_u32 (&dpsl_pos[16]); + dpsl_buf_ptr[3] = hex_to_u32 (&dpsl_pos[24]); + dpsl_buf_ptr[4] = hex_to_u32 (&dpsl_pos[32]); dpsl_buf_ptr[0] = byte_swap_32 (dpsl_buf_ptr[ 0]); dpsl_buf_ptr[1] = byte_swap_32 (dpsl_buf_ptr[ 1]); diff --git a/src/modules/module_14900.c b/src/modules/module_14900.c index 2bedb5553..62499126f 100644 --- a/src/modules/module_14900.c +++ b/src/modules/module_14900.c @@ -89,7 +89,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[0]; - digest[0] = hex_to_u32 ((const u8 *) &hash_pos[0]); + digest[0] = hex_to_u32 (&hash_pos[0]); digest[1] = 0; digest[2] = 0; digest[3] = 0; @@ -99,7 +99,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *salt_pos = token.buf[1]; const int salt_len = token.len[1]; - salt->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[0]); + salt->salt_buf[0] = hex_to_u32 (&salt_pos[0]); salt->salt_len = salt_len / 2; // 4 diff --git a/src/modules/module_15300.c b/src/modules/module_15300.c index 8bd81f94a..701e5d695 100644 --- a/src/modules/module_15300.c +++ b/src/modules/module_15300.c @@ -215,7 +215,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0; i < dpapimk->contents_len / 8; i++) { - dpapimk->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[i * 8]); + dpapimk->contents[i] = hex_to_u32 (&contents_pos[i * 8]); dpapimk->contents[i] = byte_swap_32 (dpapimk->contents[i]); } @@ -246,10 +246,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // iv - dpapimk->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]); - dpapimk->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]); - dpapimk->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]); - dpapimk->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]); + dpapimk->iv[0] = hex_to_u32 (&iv_pos[ 0]); + dpapimk->iv[1] = hex_to_u32 (&iv_pos[ 8]); + dpapimk->iv[2] = hex_to_u32 (&iv_pos[16]); + dpapimk->iv[3] = hex_to_u32 (&iv_pos[24]); dpapimk->iv[0] = byte_swap_32 (dpapimk->iv[0]); dpapimk->iv[1] = byte_swap_32 (dpapimk->iv[1]); diff --git a/src/modules/module_15310.c b/src/modules/module_15310.c index aec1b4539..b10b93792 100644 --- a/src/modules/module_15310.c +++ b/src/modules/module_15310.c @@ -231,7 +231,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0; i < dpapimk->contents_len / 8; i++) { - dpapimk->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[i * 8]); + dpapimk->contents[i] = hex_to_u32 (&contents_pos[i * 8]); dpapimk->contents[i] = byte_swap_32 (dpapimk->contents[i]); } @@ -258,10 +258,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // iv - dpapimk->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]); - dpapimk->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]); - dpapimk->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]); - dpapimk->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]); + dpapimk->iv[0] = hex_to_u32 (&iv_pos[ 0]); + dpapimk->iv[1] = hex_to_u32 (&iv_pos[ 8]); + dpapimk->iv[2] = hex_to_u32 (&iv_pos[16]); + dpapimk->iv[3] = hex_to_u32 (&iv_pos[24]); dpapimk->iv[0] = byte_swap_32 (dpapimk->iv[0]); dpapimk->iv[1] = byte_swap_32 (dpapimk->iv[1]); diff --git a/src/modules/module_15400.c b/src/modules/module_15400.c index a42b7ba67..ffcbc1b5a 100644 --- a/src/modules/module_15400.c +++ b/src/modules/module_15400.c @@ -145,22 +145,22 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *position_marker = token.buf[1]; - chacha20->position[0] = hex_to_u32 ((const u8 *) position_marker + 0); - chacha20->position[1] = hex_to_u32 ((const u8 *) position_marker + 8); + chacha20->position[0] = hex_to_u32 (position_marker + 0); + chacha20->position[1] = hex_to_u32 (position_marker + 8); // iv const u8 *iv_marker = token.buf[3]; - chacha20->iv[0] = hex_to_u32 ((const u8 *) iv_marker + 8); - chacha20->iv[1] = hex_to_u32 ((const u8 *) iv_marker + 0); + chacha20->iv[0] = hex_to_u32 (iv_marker + 8); + chacha20->iv[1] = hex_to_u32 (iv_marker + 0); // plain const u8 *plain_marker = token.buf[4]; - chacha20->plain[0] = hex_to_u32 ((const u8 *) plain_marker + 0); - chacha20->plain[1] = hex_to_u32 ((const u8 *) plain_marker + 8); + chacha20->plain[0] = hex_to_u32 (plain_marker + 0); + chacha20->plain[1] = hex_to_u32 (plain_marker + 8); /* some fake salt for the sorting mechanisms */ @@ -178,8 +178,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *cipher_marker = token.buf[5]; - digest[0] = hex_to_u32 ((const u8 *) cipher_marker + 8); - digest[1] = hex_to_u32 ((const u8 *) cipher_marker + 0); + digest[0] = hex_to_u32 (cipher_marker + 8); + digest[1] = hex_to_u32 (cipher_marker + 0); return (PARSER_OK); } diff --git a/src/modules/module_15500.c b/src/modules/module_15500.c index 19750aac3..b87390fb7 100644 --- a/src/modules/module_15500.c +++ b/src/modules/module_15500.c @@ -140,21 +140,21 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *checksum_pos = token.buf[1]; - jks_sha1->checksum[0] = hex_to_u32 ((const u8 *) &checksum_pos[ 0]); - jks_sha1->checksum[1] = hex_to_u32 ((const u8 *) &checksum_pos[ 8]); - jks_sha1->checksum[2] = hex_to_u32 ((const u8 *) &checksum_pos[16]); - jks_sha1->checksum[3] = hex_to_u32 ((const u8 *) &checksum_pos[24]); - jks_sha1->checksum[4] = hex_to_u32 ((const u8 *) &checksum_pos[32]); + jks_sha1->checksum[0] = hex_to_u32 (&checksum_pos[ 0]); + jks_sha1->checksum[1] = hex_to_u32 (&checksum_pos[ 8]); + jks_sha1->checksum[2] = hex_to_u32 (&checksum_pos[16]); + jks_sha1->checksum[3] = hex_to_u32 (&checksum_pos[24]); + jks_sha1->checksum[4] = hex_to_u32 (&checksum_pos[32]); // iv const u8 *iv_pos = token.buf[2]; - jks_sha1->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]); - jks_sha1->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]); - jks_sha1->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]); - jks_sha1->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]); - jks_sha1->iv[4] = hex_to_u32 ((const u8 *) &iv_pos[32]); + jks_sha1->iv[0] = hex_to_u32 (&iv_pos[ 0]); + jks_sha1->iv[1] = hex_to_u32 (&iv_pos[ 8]); + jks_sha1->iv[2] = hex_to_u32 (&iv_pos[16]); + jks_sha1->iv[3] = hex_to_u32 (&iv_pos[24]); + jks_sha1->iv[4] = hex_to_u32 (&iv_pos[32]); // enc_key @@ -165,7 +165,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 0, j = 0; j < enc_key_len; i += 1, j += 2) { - enc_key_buf[i] = hex_to_u8 ((const u8 *) &enc_key_pos[j]); + enc_key_buf[i] = hex_to_u8 (&enc_key_pos[j]); jks_sha1->enc_key_len++; } @@ -176,7 +176,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 *der = (u8 *) jks_sha1->der; - der[0] = hex_to_u8 ((const u8 *) &der1_pos[0]); + der[0] = hex_to_u8 (&der1_pos[0]); // der2 @@ -184,7 +184,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 6, j = 0; j < 28; i += 1, j += 2) { - der[i] = hex_to_u8 ((const u8 *) &der2_pos[j]); + der[i] = hex_to_u8 (&der2_pos[j]); } der[1] = 0; diff --git a/src/modules/module_15600.c b/src/modules/module_15600.c index a9605061f..c06af7f29 100644 --- a/src/modules/module_15600.c +++ b/src/modules/module_15600.c @@ -198,27 +198,27 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *ciphertext_pos = token.buf[3]; - ethereum_pbkdf2->ciphertext[0] = hex_to_u32 ((const u8 *) &ciphertext_pos[ 0]); - ethereum_pbkdf2->ciphertext[1] = hex_to_u32 ((const u8 *) &ciphertext_pos[ 8]); - ethereum_pbkdf2->ciphertext[2] = hex_to_u32 ((const u8 *) &ciphertext_pos[16]); - ethereum_pbkdf2->ciphertext[3] = hex_to_u32 ((const u8 *) &ciphertext_pos[24]); - ethereum_pbkdf2->ciphertext[4] = hex_to_u32 ((const u8 *) &ciphertext_pos[32]); - ethereum_pbkdf2->ciphertext[5] = hex_to_u32 ((const u8 *) &ciphertext_pos[40]); - ethereum_pbkdf2->ciphertext[6] = hex_to_u32 ((const u8 *) &ciphertext_pos[48]); - ethereum_pbkdf2->ciphertext[7] = hex_to_u32 ((const u8 *) &ciphertext_pos[56]); + ethereum_pbkdf2->ciphertext[0] = hex_to_u32 (&ciphertext_pos[ 0]); + ethereum_pbkdf2->ciphertext[1] = hex_to_u32 (&ciphertext_pos[ 8]); + ethereum_pbkdf2->ciphertext[2] = hex_to_u32 (&ciphertext_pos[16]); + ethereum_pbkdf2->ciphertext[3] = hex_to_u32 (&ciphertext_pos[24]); + ethereum_pbkdf2->ciphertext[4] = hex_to_u32 (&ciphertext_pos[32]); + ethereum_pbkdf2->ciphertext[5] = hex_to_u32 (&ciphertext_pos[40]); + ethereum_pbkdf2->ciphertext[6] = hex_to_u32 (&ciphertext_pos[48]); + ethereum_pbkdf2->ciphertext[7] = hex_to_u32 (&ciphertext_pos[56]); // hash const u8 *hash_pos = token.buf[4]; - digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]); - digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]); - digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]); - digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]); - digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]); - digest[5] = hex_to_u32 ((const u8 *) &hash_pos[40]); - digest[6] = hex_to_u32 ((const u8 *) &hash_pos[48]); - digest[7] = hex_to_u32 ((const u8 *) &hash_pos[56]); + digest[0] = hex_to_u32 (&hash_pos[ 0]); + digest[1] = hex_to_u32 (&hash_pos[ 8]); + digest[2] = hex_to_u32 (&hash_pos[16]); + digest[3] = hex_to_u32 (&hash_pos[24]); + digest[4] = hex_to_u32 (&hash_pos[32]); + digest[5] = hex_to_u32 (&hash_pos[40]); + digest[6] = hex_to_u32 (&hash_pos[48]); + digest[7] = hex_to_u32 (&hash_pos[56]); return (PARSER_OK); } diff --git a/src/modules/module_15700.c b/src/modules/module_15700.c index 02f55b653..6b8550095 100644 --- a/src/modules/module_15700.c +++ b/src/modules/module_15700.c @@ -377,27 +377,27 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *ciphertext_pos = token.buf[5]; - ethereum_scrypt->ciphertext[0] = hex_to_u32 ((const u8 *) &ciphertext_pos[ 0]); - ethereum_scrypt->ciphertext[1] = hex_to_u32 ((const u8 *) &ciphertext_pos[ 8]); - ethereum_scrypt->ciphertext[2] = hex_to_u32 ((const u8 *) &ciphertext_pos[16]); - ethereum_scrypt->ciphertext[3] = hex_to_u32 ((const u8 *) &ciphertext_pos[24]); - ethereum_scrypt->ciphertext[4] = hex_to_u32 ((const u8 *) &ciphertext_pos[32]); - ethereum_scrypt->ciphertext[5] = hex_to_u32 ((const u8 *) &ciphertext_pos[40]); - ethereum_scrypt->ciphertext[6] = hex_to_u32 ((const u8 *) &ciphertext_pos[48]); - ethereum_scrypt->ciphertext[7] = hex_to_u32 ((const u8 *) &ciphertext_pos[56]); + ethereum_scrypt->ciphertext[0] = hex_to_u32 (&ciphertext_pos[ 0]); + ethereum_scrypt->ciphertext[1] = hex_to_u32 (&ciphertext_pos[ 8]); + ethereum_scrypt->ciphertext[2] = hex_to_u32 (&ciphertext_pos[16]); + ethereum_scrypt->ciphertext[3] = hex_to_u32 (&ciphertext_pos[24]); + ethereum_scrypt->ciphertext[4] = hex_to_u32 (&ciphertext_pos[32]); + ethereum_scrypt->ciphertext[5] = hex_to_u32 (&ciphertext_pos[40]); + ethereum_scrypt->ciphertext[6] = hex_to_u32 (&ciphertext_pos[48]); + ethereum_scrypt->ciphertext[7] = hex_to_u32 (&ciphertext_pos[56]); // hash const u8 *hash_pos = token.buf[6]; - digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]); - digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]); - digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]); - digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]); - digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]); - digest[5] = hex_to_u32 ((const u8 *) &hash_pos[40]); - digest[6] = hex_to_u32 ((const u8 *) &hash_pos[48]); - digest[7] = hex_to_u32 ((const u8 *) &hash_pos[56]); + digest[0] = hex_to_u32 (&hash_pos[ 0]); + digest[1] = hex_to_u32 (&hash_pos[ 8]); + digest[2] = hex_to_u32 (&hash_pos[16]); + digest[3] = hex_to_u32 (&hash_pos[24]); + digest[4] = hex_to_u32 (&hash_pos[32]); + digest[5] = hex_to_u32 (&hash_pos[40]); + digest[6] = hex_to_u32 (&hash_pos[48]); + digest[7] = hex_to_u32 (&hash_pos[56]); return (PARSER_OK); } diff --git a/src/modules/module_15900.c b/src/modules/module_15900.c index 573f2c84a..d3d2df0b7 100644 --- a/src/modules/module_15900.c +++ b/src/modules/module_15900.c @@ -228,7 +228,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0; i < dpapimk->contents_len / 8; i++) { - dpapimk->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[i * 8]); + dpapimk->contents[i] = hex_to_u32 (&contents_pos[i * 8]); dpapimk->contents[i] = byte_swap_32 (dpapimk->contents[i]); } @@ -259,10 +259,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // iv - dpapimk->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]); - dpapimk->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]); - dpapimk->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]); - dpapimk->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]); + dpapimk->iv[0] = hex_to_u32 (&iv_pos[ 0]); + dpapimk->iv[1] = hex_to_u32 (&iv_pos[ 8]); + dpapimk->iv[2] = hex_to_u32 (&iv_pos[16]); + dpapimk->iv[3] = hex_to_u32 (&iv_pos[24]); dpapimk->iv[0] = byte_swap_32 (dpapimk->iv[0]); dpapimk->iv[1] = byte_swap_32 (dpapimk->iv[1]); diff --git a/src/modules/module_15910.c b/src/modules/module_15910.c index dcc98f9fb..8ca85a5fd 100644 --- a/src/modules/module_15910.c +++ b/src/modules/module_15910.c @@ -237,7 +237,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (u32 i = 0; i < dpapimk->contents_len / 8; i++) { - dpapimk->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[i * 8]); + dpapimk->contents[i] = hex_to_u32 (&contents_pos[i * 8]); dpapimk->contents[i] = byte_swap_32 (dpapimk->contents[i]); } @@ -264,10 +264,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // iv - dpapimk->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]); - dpapimk->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]); - dpapimk->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]); - dpapimk->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]); + dpapimk->iv[0] = hex_to_u32 (&iv_pos[ 0]); + dpapimk->iv[1] = hex_to_u32 (&iv_pos[ 8]); + dpapimk->iv[2] = hex_to_u32 (&iv_pos[16]); + dpapimk->iv[3] = hex_to_u32 (&iv_pos[24]); dpapimk->iv[0] = byte_swap_32 (dpapimk->iv[0]); dpapimk->iv[1] = byte_swap_32 (dpapimk->iv[1]); diff --git a/src/modules/module_16100.c b/src/modules/module_16100.c index 9e470f079..57b0d5a33 100644 --- a/src/modules/module_16100.c +++ b/src/modules/module_16100.c @@ -109,10 +109,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 *session_ptr = (u8 *) tacacs_plus->session_buf; - session_ptr[0] = hex_to_u8 ((const u8 *) session_pos + 0); - session_ptr[1] = hex_to_u8 ((const u8 *) session_pos + 2); - session_ptr[2] = hex_to_u8 ((const u8 *) session_pos + 4); - session_ptr[3] = hex_to_u8 ((const u8 *) session_pos + 6); + session_ptr[0] = hex_to_u8 (session_pos + 0); + session_ptr[1] = hex_to_u8 (session_pos + 2); + session_ptr[2] = hex_to_u8 (session_pos + 4); + session_ptr[3] = hex_to_u8 (session_pos + 6); // ct_buf @@ -123,7 +123,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 0, j = 0; j < ct_buf_len; i += 1, j += 2) { - ct_data_ptr[i] = hex_to_u8 ((const u8 *) &ct_buf_pos[j]); + ct_data_ptr[i] = hex_to_u8 (&ct_buf_pos[j]); tacacs_plus->ct_data_len++; } @@ -134,8 +134,8 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 *sequence_ptr = (u8 *) tacacs_plus->sequence_buf; - sequence_ptr[0] = hex_to_u8 ((const u8 *) sequence_pos + 0); - sequence_ptr[1] = hex_to_u8 ((const u8 *) sequence_pos + 2); + sequence_ptr[0] = hex_to_u8 (sequence_pos + 0); + sequence_ptr[1] = hex_to_u8 (sequence_pos + 2); // fake salt diff --git a/src/modules/module_16200.c b/src/modules/module_16200.c index 36e14358e..f3d65d007 100644 --- a/src/modules/module_16200.c +++ b/src/modules/module_16200.c @@ -178,10 +178,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *ZCRYPTOSALT_pos = token.buf[3]; - apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 0]); - apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 8]); - apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[16]); - apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[24]); + apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 (&ZCRYPTOSALT_pos[ 0]); + apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 (&ZCRYPTOSALT_pos[ 8]); + apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 (&ZCRYPTOSALT_pos[16]); + apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 (&ZCRYPTOSALT_pos[24]); apple_secure_notes->ZCRYPTOSALT[ 4] = 0; apple_secure_notes->ZCRYPTOSALT[ 5] = 0; apple_secure_notes->ZCRYPTOSALT[ 6] = 0; @@ -199,12 +199,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *ZCRYPTOWRAPPEDKEY_pos = token.buf[4]; - apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 0]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 8]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[16]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[24]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[32]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[40]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 0]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 8]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[16]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[24]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[32]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[40]); // fake salt diff --git a/src/modules/module_16300.c b/src/modules/module_16300.c index 1efe11c73..9c2fa883d 100644 --- a/src/modules/module_16300.c +++ b/src/modules/module_16300.c @@ -165,10 +165,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *encseed_pos = token.buf[1]; const int encseed_len = token.len[1]; - ethereum_presale->iv[0] = hex_to_u32 ((const u8 *) &encseed_pos[ 0]); - ethereum_presale->iv[1] = hex_to_u32 ((const u8 *) &encseed_pos[ 8]); - ethereum_presale->iv[2] = hex_to_u32 ((const u8 *) &encseed_pos[16]); - ethereum_presale->iv[3] = hex_to_u32 ((const u8 *) &encseed_pos[24]); + ethereum_presale->iv[0] = hex_to_u32 (&encseed_pos[ 0]); + ethereum_presale->iv[1] = hex_to_u32 (&encseed_pos[ 8]); + ethereum_presale->iv[2] = hex_to_u32 (&encseed_pos[16]); + ethereum_presale->iv[3] = hex_to_u32 (&encseed_pos[24]); ethereum_presale->iv[0] = byte_swap_32 (ethereum_presale->iv[0]); ethereum_presale->iv[1] = byte_swap_32 (ethereum_presale->iv[1]); @@ -179,7 +179,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 32, j = 0; i < encseed_len; i += 8, j++) { - esalt_buf_ptr[j] = hex_to_u32 ((const u8 *) &encseed_pos[i]); + esalt_buf_ptr[j] = hex_to_u32 (&encseed_pos[i]); esalt_buf_ptr[j] = byte_swap_32 (esalt_buf_ptr[j]); } @@ -201,10 +201,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *bkp_pos = token.buf[3]; - digest[0] = hex_to_u32 ((const u8 *) &bkp_pos[ 0]); - digest[1] = hex_to_u32 ((const u8 *) &bkp_pos[ 8]); - digest[2] = hex_to_u32 ((const u8 *) &bkp_pos[16]); - digest[3] = hex_to_u32 ((const u8 *) &bkp_pos[24]); + digest[0] = hex_to_u32 (&bkp_pos[ 0]); + digest[1] = hex_to_u32 (&bkp_pos[ 8]); + digest[2] = hex_to_u32 (&bkp_pos[16]); + digest[3] = hex_to_u32 (&bkp_pos[24]); return (PARSER_OK); } diff --git a/src/modules/module_16400.c b/src/modules/module_16400.c index 009d82ad2..eecd9fe3d 100644 --- a/src/modules/module_16400.c +++ b/src/modules/module_16400.c @@ -91,10 +91,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = (const u8 *) line_buf + 10; - digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]); - digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]); - digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]); - digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]); + digest[0] = hex_to_u32 (&hash_pos[ 0]); + digest[1] = hex_to_u32 (&hash_pos[ 8]); + digest[2] = hex_to_u32 (&hash_pos[16]); + digest[3] = hex_to_u32 (&hash_pos[24]); if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) { diff --git a/src/modules/module_16600.c b/src/modules/module_16600.c index 0571028f7..47ed037d7 100644 --- a/src/modules/module_16600.c +++ b/src/modules/module_16600.c @@ -121,19 +121,19 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *iv_pos = token.buf[2]; - electrum_wallet->iv[0] = hex_to_u32 ((const u8 *) &iv_pos[ 0]); - electrum_wallet->iv[1] = hex_to_u32 ((const u8 *) &iv_pos[ 8]); - electrum_wallet->iv[2] = hex_to_u32 ((const u8 *) &iv_pos[16]); - electrum_wallet->iv[3] = hex_to_u32 ((const u8 *) &iv_pos[24]); + electrum_wallet->iv[0] = hex_to_u32 (&iv_pos[ 0]); + electrum_wallet->iv[1] = hex_to_u32 (&iv_pos[ 8]); + electrum_wallet->iv[2] = hex_to_u32 (&iv_pos[16]); + electrum_wallet->iv[3] = hex_to_u32 (&iv_pos[24]); // encrypted const u8 *encrypted_pos = token.buf[3]; - electrum_wallet->encrypted[0] = hex_to_u32 ((const u8 *) &encrypted_pos[ 0]); - electrum_wallet->encrypted[1] = hex_to_u32 ((const u8 *) &encrypted_pos[ 8]); - electrum_wallet->encrypted[2] = hex_to_u32 ((const u8 *) &encrypted_pos[16]); - electrum_wallet->encrypted[3] = hex_to_u32 ((const u8 *) &encrypted_pos[24]); + electrum_wallet->encrypted[0] = hex_to_u32 (&encrypted_pos[ 0]); + electrum_wallet->encrypted[1] = hex_to_u32 (&encrypted_pos[ 8]); + electrum_wallet->encrypted[2] = hex_to_u32 (&encrypted_pos[16]); + electrum_wallet->encrypted[3] = hex_to_u32 (&encrypted_pos[24]); // salt fake diff --git a/src/modules/module_16700.c b/src/modules/module_16700.c index 50314c20d..3066b8f0b 100644 --- a/src/modules/module_16700.c +++ b/src/modules/module_16700.c @@ -142,10 +142,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *ZCRYPTOSALT_pos = token.buf[3]; - apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 0]); - apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 8]); - apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[16]); - apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[24]); + apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 (&ZCRYPTOSALT_pos[ 0]); + apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 (&ZCRYPTOSALT_pos[ 8]); + apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 (&ZCRYPTOSALT_pos[16]); + apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 (&ZCRYPTOSALT_pos[24]); apple_secure_notes->ZCRYPTOSALT[ 4] = 0; apple_secure_notes->ZCRYPTOSALT[ 5] = 0; apple_secure_notes->ZCRYPTOSALT[ 6] = 0; @@ -171,12 +171,12 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *ZCRYPTOWRAPPEDKEY_pos = token.buf[5]; - apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 0]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 8]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[16]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[24]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[32]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[40]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 0]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 8]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[16]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[24]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[32]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[40]); // fake salt diff --git a/src/modules/module_16900.c b/src/modules/module_16900.c index 213b5940e..3fd5a3d40 100644 --- a/src/modules/module_16900.c +++ b/src/modules/module_16900.c @@ -214,7 +214,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 0, j = 0; j < ct_buf_len; i += 1, j += 2) { - ct_data_ptr[i] = hex_to_u8 ((const u8 *) &ct_buf_pos[j]); + ct_data_ptr[i] = hex_to_u8 (&ct_buf_pos[j]); ansible_vault->ct_data_len++; } @@ -223,14 +223,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[5]; - digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]); - digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]); - digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]); - digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]); - digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]); - digest[5] = hex_to_u32 ((const u8 *) &hash_pos[40]); - digest[6] = hex_to_u32 ((const u8 *) &hash_pos[48]); - digest[7] = hex_to_u32 ((const u8 *) &hash_pos[56]); + digest[0] = hex_to_u32 (&hash_pos[ 0]); + digest[1] = hex_to_u32 (&hash_pos[ 8]); + digest[2] = hex_to_u32 (&hash_pos[16]); + digest[3] = hex_to_u32 (&hash_pos[24]); + digest[4] = hex_to_u32 (&hash_pos[32]); + digest[5] = hex_to_u32 (&hash_pos[40]); + digest[6] = hex_to_u32 (&hash_pos[48]); + digest[7] = hex_to_u32 (&hash_pos[56]); digest[0] = byte_swap_32 (digest[0]); digest[1] = byte_swap_32 (digest[1]); diff --git a/src/modules/module_17010.c b/src/modules/module_17010.c index 865a6f8eb..c5b4280b0 100644 --- a/src/modules/module_17010.c +++ b/src/modules/module_17010.c @@ -242,7 +242,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const int enc_data_size = hc_strtoul ((const char *) token.buf[2], NULL, 10); - const int encrypted_data_size = hex_decode ((const u8 *) token.buf[4], token.len[4], (u8 *) gpg->encrypted_data); + const int encrypted_data_size = hex_decode (token.buf[4], token.len[4], (u8 *) gpg->encrypted_data); if (enc_data_size != encrypted_data_size) return (PARSER_CT_LENGTH); @@ -266,7 +266,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (hc_strtoul ((const char *) token.buf[9], NULL, 10) != sizeof (gpg->iv)) return (PARSER_IV_LENGTH); - const int iv_size = hex_decode ((const u8 *) token.buf[10], token.len[10], (u8 *) gpg->iv); + const int iv_size = hex_decode (token.buf[10], token.len[10], (u8 *) gpg->iv); if (iv_size != sizeof (gpg->iv)) return (PARSER_IV_LENGTH); @@ -282,7 +282,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE salt->salt_repeats = gpg->cipher_algo == 7 ? 0 : 1; // "minus one" - salt->salt_len = hex_decode ((const u8 *) token.buf[12], token.len[12], (u8 *) salt->salt_buf); + salt->salt_len = hex_decode (token.buf[12], token.len[12], (u8 *) salt->salt_buf); if (salt->salt_len != 8) return (PARSER_SALT_LENGTH); diff --git a/src/modules/module_17020.c b/src/modules/module_17020.c index c4c9c7bef..a877ab82d 100644 --- a/src/modules/module_17020.c +++ b/src/modules/module_17020.c @@ -246,7 +246,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const int enc_data_size = hc_strtoul ((const char *) token.buf[2], NULL, 10); - const int encrypted_data_size = hex_decode ((const u8 *) token.buf[4], token.len[4], (u8 *) gpg->encrypted_data); + const int encrypted_data_size = hex_decode (token.buf[4], token.len[4], (u8 *) gpg->encrypted_data); if (enc_data_size != encrypted_data_size) return (PARSER_CT_LENGTH); @@ -270,7 +270,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (hc_strtoul ((const char *) token.buf[9], NULL, 10) != sizeof (gpg->iv)) return (PARSER_IV_LENGTH); - const int iv_size = hex_decode ((const u8 *) token.buf[10], token.len[10], (u8 *) gpg->iv); + const int iv_size = hex_decode (token.buf[10], token.len[10], (u8 *) gpg->iv); if (iv_size != sizeof (gpg->iv)) return (PARSER_IV_LENGTH); @@ -284,7 +284,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // Salt Value - salt->salt_len = hex_decode ((const u8 *) token.buf[12], token.len[12], (u8 *) salt->salt_buf); + salt->salt_len = hex_decode (token.buf[12], token.len[12], (u8 *) salt->salt_buf); if (salt->salt_len != 8) return (PARSER_SALT_LENGTH); diff --git a/src/modules/module_17030.c b/src/modules/module_17030.c index 05867755c..52fa74c92 100644 --- a/src/modules/module_17030.c +++ b/src/modules/module_17030.c @@ -242,7 +242,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const int enc_data_size = hc_strtoul ((const char *) token.buf[2], NULL, 10); - const int encrypted_data_size = hex_decode ((const u8 *) token.buf[4], token.len[4], (u8 *) gpg->encrypted_data); + const int encrypted_data_size = hex_decode (token.buf[4], token.len[4], (u8 *) gpg->encrypted_data); if (enc_data_size != encrypted_data_size) return (PARSER_CT_LENGTH); @@ -266,7 +266,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (hc_strtoul ((const char *) token.buf[9], NULL, 10) != sizeof (gpg->iv)) return (PARSER_IV_LENGTH); - const int iv_size = hex_decode ((const u8 *) token.buf[10], token.len[10], (u8 *) gpg->iv); + const int iv_size = hex_decode (token.buf[10], token.len[10], (u8 *) gpg->iv); if (iv_size != sizeof (gpg->iv)) return (PARSER_IV_LENGTH); @@ -280,7 +280,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // Salt Value - salt->salt_len = hex_decode ((const u8 *) token.buf[12], token.len[12], (u8 *) salt->salt_buf); + salt->salt_len = hex_decode (token.buf[12], token.len[12], (u8 *) salt->salt_buf); if (salt->salt_len != 8) return (PARSER_SALT_LENGTH); diff --git a/src/modules/module_17040.c b/src/modules/module_17040.c index 36c94c897..dd3661136 100644 --- a/src/modules/module_17040.c +++ b/src/modules/module_17040.c @@ -257,7 +257,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const int enc_data_size = hc_strtoul ((const char *) token.buf[2], NULL, 10); - const int encrypted_data_size = hex_decode ((const u8 *) token.buf[4], token.len[4], (u8 *) gpg->encrypted_data); + const int encrypted_data_size = hex_decode (token.buf[4], token.len[4], (u8 *) gpg->encrypted_data); if (enc_data_size != encrypted_data_size) return (PARSER_CT_LENGTH); @@ -312,7 +312,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE salt->salt_repeats = gpg->cipher_algo == 7 ? 0 : 1; // "minus one" // TODO check this? - salt->salt_len = hex_decode ((const u8 *) token.buf[12], token.len[12], (u8 *) salt->salt_buf); + salt->salt_len = hex_decode (token.buf[12], token.len[12], (u8 *) salt->salt_buf); if (salt->salt_len != 8) return (PARSER_SALT_LENGTH); diff --git a/src/modules/module_18100.c b/src/modules/module_18100.c index d7b1f62a9..37a8ef2e7 100644 --- a/src/modules/module_18100.c +++ b/src/modules/module_18100.c @@ -83,7 +83,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); // now we need to reduce our hash into a token - int otp_code = hc_strtoul ((const char *) line_buf, NULL, 10); + int otp_code = hc_strtoul (line_buf, NULL, 10); digest[0] = otp_code; diff --git a/src/modules/module_18200.c b/src/modules/module_18200.c index 85ec16d91..b99d4978d 100644 --- a/src/modules/module_18200.c +++ b/src/modules/module_18200.c @@ -142,7 +142,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE krb5asrep->format = 2; } - const char *account_info_start = (const char *) line_buf + strlen (SIGNATURE_KRB5ASREP) + parse_off; + const char *account_info_start = line_buf + strlen (SIGNATURE_KRB5ASREP) + parse_off; char *account_info_stop = strchr (account_info_start, ':'); if (account_info_stop == NULL) return (PARSER_SEPARATOR_UNMATCHED); diff --git a/src/modules/module_18300.c b/src/modules/module_18300.c index fa0c66199..adc98432a 100644 --- a/src/modules/module_18300.c +++ b/src/modules/module_18300.c @@ -173,10 +173,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *ZCRYPTOSALT_pos = token.buf[3]; - apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 0]); - apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[ 8]); - apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[16]); - apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 ((const u8 *) &ZCRYPTOSALT_pos[24]); + apple_secure_notes->ZCRYPTOSALT[ 0] = hex_to_u32 (&ZCRYPTOSALT_pos[ 0]); + apple_secure_notes->ZCRYPTOSALT[ 1] = hex_to_u32 (&ZCRYPTOSALT_pos[ 8]); + apple_secure_notes->ZCRYPTOSALT[ 2] = hex_to_u32 (&ZCRYPTOSALT_pos[16]); + apple_secure_notes->ZCRYPTOSALT[ 3] = hex_to_u32 (&ZCRYPTOSALT_pos[24]); apple_secure_notes->ZCRYPTOSALT[ 4] = 0; apple_secure_notes->ZCRYPTOSALT[ 5] = 0; apple_secure_notes->ZCRYPTOSALT[ 6] = 0; @@ -202,16 +202,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *ZCRYPTOWRAPPEDKEY_pos = token.buf[5]; - apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 0]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[ 8]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[16]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[24]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[32]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[40]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[6] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[48]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[7] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[56]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[8] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[64]); - apple_secure_notes->ZCRYPTOWRAPPEDKEY[9] = hex_to_u32 ((const u8 *) &ZCRYPTOWRAPPEDKEY_pos[72]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[0] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 0]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[1] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[ 8]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[2] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[16]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[3] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[24]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[4] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[32]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[5] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[40]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[6] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[48]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[7] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[56]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[8] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[64]); + apple_secure_notes->ZCRYPTOWRAPPEDKEY[9] = hex_to_u32 (&ZCRYPTOWRAPPEDKEY_pos[72]); // fake salt diff --git a/src/modules/module_18900.c b/src/modules/module_18900.c index 2141796f2..0d07400f8 100644 --- a/src/modules/module_18900.c +++ b/src/modules/module_18900.c @@ -185,28 +185,28 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 0, j = 0; j < 128; i += 1, j += 8) { - android_backup->user_salt[i] = hex_to_u32 ((const u8 *) user_salt_pos + j); + android_backup->user_salt[i] = hex_to_u32 (user_salt_pos + j); } // ck_salt for (int i = 0, j = 0; j < 128; i += 1, j += 8) { - android_backup->ck_salt[i] = hex_to_u32 ((const u8 *) ck_salt_pos + j); + android_backup->ck_salt[i] = hex_to_u32 (ck_salt_pos + j); } // user_iv for (int i = 0, j = 0; j < 32; i += 1, j += 8) { - android_backup->user_iv[i] = hex_to_u32 ((const u8 *) user_iv_pos + j); + android_backup->user_iv[i] = hex_to_u32 (user_iv_pos + j); } // masterkey_blob for (int i = 0, j = 0; j < 192; i += 1, j += 8) { - android_backup->masterkey_blob[i] = hex_to_u32 ((const u8 *) masterkey_blob_pos + j); + android_backup->masterkey_blob[i] = hex_to_u32 (masterkey_blob_pos + j); } // make the entry unique in our databases diff --git a/src/modules/module_19000.c b/src/modules/module_19000.c index b9875463e..286635726 100644 --- a/src/modules/module_19000.c +++ b/src/modules/module_19000.c @@ -123,10 +123,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (token.len[2] != 32) return (PARSER_HASH_LENGTH); - digest[0] = hex_to_u32 ((const u8 *) token.buf[2] + 0); - digest[1] = hex_to_u32 ((const u8 *) token.buf[2] + 8); - digest[2] = hex_to_u32 ((const u8 *) token.buf[2] + 16); - digest[3] = hex_to_u32 ((const u8 *) token.buf[2] + 24); + digest[0] = hex_to_u32 (token.buf[2] + 0); + digest[1] = hex_to_u32 (token.buf[2] + 8); + digest[2] = hex_to_u32 (token.buf[2] + 16); + digest[3] = hex_to_u32 (token.buf[2] + 24); // salt diff --git a/src/modules/module_19100.c b/src/modules/module_19100.c index 74222b883..50b89ecec 100644 --- a/src/modules/module_19100.c +++ b/src/modules/module_19100.c @@ -115,14 +115,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (token.len[2] != 64) return (PARSER_HASH_LENGTH); - digest[0] = hex_to_u32 ((const u8 *) token.buf[2] + 0); - digest[1] = hex_to_u32 ((const u8 *) token.buf[2] + 8); - digest[2] = hex_to_u32 ((const u8 *) token.buf[2] + 16); - digest[3] = hex_to_u32 ((const u8 *) token.buf[2] + 24); - digest[4] = hex_to_u32 ((const u8 *) token.buf[2] + 32); - digest[5] = hex_to_u32 ((const u8 *) token.buf[2] + 40); - digest[6] = hex_to_u32 ((const u8 *) token.buf[2] + 48); - digest[7] = hex_to_u32 ((const u8 *) token.buf[2] + 56); + digest[0] = hex_to_u32 (token.buf[2] + 0); + digest[1] = hex_to_u32 (token.buf[2] + 8); + digest[2] = hex_to_u32 (token.buf[2] + 16); + digest[3] = hex_to_u32 (token.buf[2] + 24); + digest[4] = hex_to_u32 (token.buf[2] + 32); + digest[5] = hex_to_u32 (token.buf[2] + 40); + digest[6] = hex_to_u32 (token.buf[2] + 48); + digest[7] = hex_to_u32 (token.buf[2] + 56); // salt diff --git a/src/modules/module_19200.c b/src/modules/module_19200.c index 4fa1c8daa..9e4467b40 100644 --- a/src/modules/module_19200.c +++ b/src/modules/module_19200.c @@ -118,14 +118,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (token.len[2] != 128) return (PARSER_HASH_LENGTH); - digest[0] = hex_to_u64 ((const u8 *) token.buf[2] + 0); - digest[1] = hex_to_u64 ((const u8 *) token.buf[2] + 16); - digest[2] = hex_to_u64 ((const u8 *) token.buf[2] + 32); - digest[3] = hex_to_u64 ((const u8 *) token.buf[2] + 48); - digest[4] = hex_to_u64 ((const u8 *) token.buf[2] + 64); - digest[5] = hex_to_u64 ((const u8 *) token.buf[2] + 80); - digest[6] = hex_to_u64 ((const u8 *) token.buf[2] + 96); - digest[7] = hex_to_u64 ((const u8 *) token.buf[2] + 112); + digest[0] = hex_to_u64 (token.buf[2] + 0); + digest[1] = hex_to_u64 (token.buf[2] + 16); + digest[2] = hex_to_u64 (token.buf[2] + 32); + digest[3] = hex_to_u64 (token.buf[2] + 48); + digest[4] = hex_to_u64 (token.buf[2] + 64); + digest[5] = hex_to_u64 (token.buf[2] + 80); + digest[6] = hex_to_u64 (token.buf[2] + 96); + digest[7] = hex_to_u64 (token.buf[2] + 112); // salt diff --git a/src/modules/module_19300.c b/src/modules/module_19300.c index 2e9bb17d9..ad1d7cefc 100644 --- a/src/modules/module_19300.c +++ b/src/modules/module_19300.c @@ -140,11 +140,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE digest[3] = byte_swap_32 (digest[3]); digest[4] = byte_swap_32 (digest[4]); - const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) sha1_double_salt->salt1_buf, (int *) &sha1_double_salt->salt1_len); + const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) sha1_double_salt->salt1_buf, &sha1_double_salt->salt1_len); if (parse_rc1 == false) return (PARSER_SALT_LENGTH); - const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) sha1_double_salt->salt2_buf, (int *) &sha1_double_salt->salt2_len); + const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) sha1_double_salt->salt2_buf, &sha1_double_salt->salt2_len); if (parse_rc2 == false) return (PARSER_SALT_LENGTH); @@ -204,13 +204,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt1_buf, (const int) sha1_double_salt->salt1_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt1_buf, sha1_double_salt->salt1_len, out_buf + out_len); out_buf[out_len] = hashconfig->separator; out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt2_buf, (const int) sha1_double_salt->salt2_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt2_buf, sha1_double_salt->salt2_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_19500.c b/src/modules/module_19500.c index 3e6748efa..afaa3c7cd 100644 --- a/src/modules/module_19500.c +++ b/src/modules/module_19500.c @@ -132,11 +132,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE digest[3] = byte_swap_32 (digest[3]); digest[4] = byte_swap_32 (digest[4]); - const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) devise_double_salt->salt_buf, (int *) &devise_double_salt->salt_len); + const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) devise_double_salt->salt_buf, &devise_double_salt->salt_len); if (parse_rc1 == false) return (PARSER_SALT_LENGTH); - const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) devise_double_salt->site_key_buf, (int *) &devise_double_salt->site_key_len); + const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) devise_double_salt->site_key_buf, &devise_double_salt->site_key_len); if (parse_rc2 == false) return (PARSER_SALT_LENGTH); @@ -196,13 +196,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) devise_double_salt->salt_buf, (const int) devise_double_salt->salt_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) devise_double_salt->salt_buf, devise_double_salt->salt_len, out_buf + out_len); out_buf[out_len] = hashconfig->separator; out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) devise_double_salt->site_key_buf, (const int) devise_double_salt->site_key_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) devise_double_salt->site_key_buf, devise_double_salt->site_key_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_19600.c b/src/modules/module_19600.c index 5a4d85796..296a1dca1 100644 --- a/src/modules/module_19600.c +++ b/src/modules/module_19600.c @@ -106,7 +106,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // assume no signature found if (line_len < 12) return (PARSER_SALT_LENGTH); - char *spn_info_start = strchr ((const char *) line_buf + 12 + 1, '*'); + char *spn_info_start = strchr (line_buf + 12 + 1, '*'); int is_spn_provided = 0; diff --git a/src/modules/module_19700.c b/src/modules/module_19700.c index 9c449308e..8a09915b0 100644 --- a/src/modules/module_19700.c +++ b/src/modules/module_19700.c @@ -106,7 +106,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // assume no signature found if (line_len < 12) return (PARSER_SALT_LENGTH); - char *spn_info_start = strchr ((const char *) line_buf + 12 + 1, '*'); + char *spn_info_start = strchr (line_buf + 12 + 1, '*'); int is_spn_provided = 0; diff --git a/src/modules/module_20200.c b/src/modules/module_20200.c index 351810ae1..ff63ea7c6 100644 --- a/src/modules/module_20200.c +++ b/src/modules/module_20200.c @@ -145,7 +145,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[256] = { 0 }; - const size_t salt_len_decoded = base64_decode (ab64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + const size_t salt_len_decoded = base64_decode (ab64_to_int, salt_pos, salt_len, tmp_buf); u8 *salt_buf_ptr = (u8 *) pbkdf2_sha512->salt_buf; memcpy (salt_buf_ptr, tmp_buf, salt_len_decoded); @@ -158,7 +158,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[4]; const int hash_len = token.len[4]; - base64_decode (ab64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (ab64_to_int, hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, HASH_LEN_RAW); digest[0] = byte_swap_64 (digest[0]); diff --git a/src/modules/module_20300.c b/src/modules/module_20300.c index 1a65498e2..2d6ac1fd6 100644 --- a/src/modules/module_20300.c +++ b/src/modules/module_20300.c @@ -144,7 +144,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[256] = { 0 }; - const size_t salt_len_decoded = base64_decode (ab64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + const size_t salt_len_decoded = base64_decode (ab64_to_int, salt_pos, salt_len, tmp_buf); u8 *salt_buf_ptr = (u8 *) pbkdf2_sha256->salt_buf; memcpy (salt_buf_ptr, tmp_buf, salt_len_decoded); @@ -157,7 +157,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[4]; const int hash_len = token.len[4]; - base64_decode (ab64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (ab64_to_int, hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, HASH_LEN_RAW); digest[0] = byte_swap_32 (digest[0]); diff --git a/src/modules/module_20400.c b/src/modules/module_20400.c index d099fb360..2fd8a7dcd 100644 --- a/src/modules/module_20400.c +++ b/src/modules/module_20400.c @@ -144,7 +144,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[256] = { 0 }; - const size_t salt_len_decoded = base64_decode (ab64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + const size_t salt_len_decoded = base64_decode (ab64_to_int, salt_pos, salt_len, tmp_buf); u8 *salt_buf_ptr = (u8 *) pbkdf2_sha1->salt_buf; memcpy (salt_buf_ptr, tmp_buf, salt_len_decoded); @@ -156,7 +156,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[4]; const int hash_len = token.len[4]; - base64_decode (ab64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (ab64_to_int, hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, HASH_LEN_RAW); digest[0] = byte_swap_32 (digest[0]); diff --git a/src/modules/module_21310.c b/src/modules/module_21310.c index 5210ff325..9bd5e991c 100644 --- a/src/modules/module_21310.c +++ b/src/modules/module_21310.c @@ -126,13 +126,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (md5_double_salt->salt1_buf, 0, sizeof (md5_double_salt->salt1_buf)); - const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_double_salt->salt1_buf, (int *) &md5_double_salt->salt1_len); + const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_double_salt->salt1_buf, &md5_double_salt->salt1_len); if (parse_rc1 == false) return (PARSER_SALT_LENGTH); memset (md5_double_salt->salt2_buf, 0, sizeof (md5_double_salt->salt2_buf)); - const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_double_salt->salt2_buf, (int *) &md5_double_salt->salt2_len); + const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_double_salt->salt2_buf, &md5_double_salt->salt2_len); if (parse_rc2 == false) return (PARSER_SALT_LENGTH); @@ -197,7 +197,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt1_buf, (const int) md5_double_salt->salt1_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt1_buf, md5_double_salt->salt1_len, out_buf + out_len); out_buf[out_len] = hashconfig->separator; @@ -210,7 +210,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE salt2_buf[i] = byte_swap_32 (md5_double_salt->salt2_buf[i]); } - out_len += generic_salt_encode (hashconfig, (const u8 *) salt2_buf, (const int) md5_double_salt->salt2_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) salt2_buf, md5_double_salt->salt2_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_21600.c b/src/modules/module_21600.c index 1342e697c..47cf4ce40 100644 --- a/src/modules/module_21600.c +++ b/src/modules/module_21600.c @@ -140,7 +140,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // hash - hex_decode ((const u8 *) token.buf[4], 40, (u8 *) digest); + hex_decode (token.buf[4], 40, (u8 *) digest); return (PARSER_OK); } @@ -159,7 +159,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += hex_encode ((const u8 *) digest, 20, (u8 *) out_buf + out_len); + out_len += hex_encode ((const u8 *) digest, 20, out_buf + out_len); return out_len; } diff --git a/src/modules/module_22000.c b/src/modules/module_22000.c index dcd91d926..ebacaab95 100644 --- a/src/modules/module_22000.c +++ b/src/modules/module_22000.c @@ -625,7 +625,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE wpa_t *wpa = (wpa_t *) esalt_buf; - const char *input_buf = (const char *) line_buf; + const char *input_buf = line_buf; int input_len = line_len; // start old pmkid/hccapx compatibility parsing @@ -683,7 +683,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_len++; - tmp_len += hex_encode ((const u8 *) &hccapx->message_pair, 1, (u8 *) tmp_buf + tmp_len); + tmp_len += hex_encode (&hccapx->message_pair, 1, (u8 *) tmp_buf + tmp_len); tmp_buf[tmp_len] = 0; @@ -942,7 +942,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 *eapol_ptr = (u8 *) wpa->eapol; - wpa->eapol_len = hex_decode ((const u8 *) eapol_pos, token.len[7], eapol_ptr); + wpa->eapol_len = hex_decode (eapol_pos, token.len[7], eapol_ptr); memset (eapol_ptr + wpa->eapol_len, 0, (256 + 64) - wpa->eapol_len); diff --git a/src/modules/module_22001.c b/src/modules/module_22001.c index beed898ed..b0fb51dd9 100644 --- a/src/modules/module_22001.c +++ b/src/modules/module_22001.c @@ -627,7 +627,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE wpa_t *wpa = (wpa_t *) esalt_buf; - const char *input_buf = (const char *) line_buf; + const char *input_buf = line_buf; int input_len = line_len; // start old pmkid/hccapx compatibility parsing @@ -685,7 +685,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE tmp_len++; - tmp_len += hex_encode ((const u8 *) &hccapx->message_pair, 1, (u8 *) tmp_buf + tmp_len); + tmp_len += hex_encode (&hccapx->message_pair, 1, (u8 *) tmp_buf + tmp_len); tmp_buf[tmp_len] = 0; @@ -943,7 +943,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 *eapol_ptr = (u8 *) wpa->eapol; - wpa->eapol_len = hex_decode ((const u8 *) eapol_pos, token.len[7], eapol_ptr); + wpa->eapol_len = hex_decode (eapol_pos, token.len[7], eapol_ptr); memset (eapol_ptr + wpa->eapol_len, 0, (256 + 64) - wpa->eapol_len); diff --git a/src/modules/module_22911.c b/src/modules/module_22911.c index 8715d6992..25b90e94a 100644 --- a/src/modules/module_22911.c +++ b/src/modules/module_22911.c @@ -184,7 +184,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE byte_swap_32 (salt->salt_buf[1]), pem->data_len); - out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, (u8 *) out_buf + out_len); + out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_22921.c b/src/modules/module_22921.c index 3b68fe18f..c71aad254 100644 --- a/src/modules/module_22921.c +++ b/src/modules/module_22921.c @@ -185,7 +185,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE byte_swap_32 (salt->salt_buf[1]), pem->data_len); - out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, (u8 *) out_buf + out_len); + out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_22931.c b/src/modules/module_22931.c index e61e4f72a..ea673b633 100644 --- a/src/modules/module_22931.c +++ b/src/modules/module_22931.c @@ -188,7 +188,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE byte_swap_32 (salt->salt_buf[3]), pem->data_len); - out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, (u8 *) out_buf + out_len); + out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_22941.c b/src/modules/module_22941.c index b1c9261e0..05f0d57e5 100644 --- a/src/modules/module_22941.c +++ b/src/modules/module_22941.c @@ -188,7 +188,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE byte_swap_32 (salt->salt_buf[3]), pem->data_len); - out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, (u8 *) out_buf + out_len); + out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_22951.c b/src/modules/module_22951.c index 83094ea86..abf2fb6dd 100644 --- a/src/modules/module_22951.c +++ b/src/modules/module_22951.c @@ -188,7 +188,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE byte_swap_32 (salt->salt_buf[3]), pem->data_len); - out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, (u8 *) out_buf + out_len); + out_len += hex_encode ((const u8 *) pem->data_buf, pem->data_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_23200.c b/src/modules/module_23200.c index bcea54bce..5ec94c72d 100644 --- a/src/modules/module_23200.c +++ b/src/modules/module_23200.c @@ -142,7 +142,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *salt_pos = token.buf[5]; const int salt_len = token.len[5]; - salt->salt_len = hex_decode ((const u8 *) salt_pos, salt_len, (u8 *) salt->salt_buf); + salt->salt_len = hex_decode (salt_pos, salt_len, (u8 *) salt->salt_buf); // salt length @@ -179,7 +179,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += hex_encode ((const u8 *) digest, 20, (u8 *) out_buf + out_len); + out_len += hex_encode ((const u8 *) digest, 20, out_buf + out_len); return out_len; } diff --git a/src/modules/module_24410.c b/src/modules/module_24410.c index 75cf634ee..44e3202f9 100644 --- a/src/modules/module_24410.c +++ b/src/modules/module_24410.c @@ -295,7 +295,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE iv, pkcs->data_len); - out_len += hex_encode ((const u8 *) pkcs->data_buf, pkcs->data_len, (u8 *) out_buf + out_len); + out_len += hex_encode ((const u8 *) pkcs->data_buf, pkcs->data_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_24420.c b/src/modules/module_24420.c index edb657d89..7bd0e1e05 100644 --- a/src/modules/module_24420.c +++ b/src/modules/module_24420.c @@ -295,7 +295,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE iv, pkcs->data_len); - out_len += hex_encode ((const u8 *) pkcs->data_buf, pkcs->data_len, (u8 *) out_buf + out_len); + out_len += hex_encode ((const u8 *) pkcs->data_buf, pkcs->data_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_25400.c b/src/modules/module_25400.c index ccfcaa547..8dc70b479 100644 --- a/src/modules/module_25400.c +++ b/src/modules/module_25400.c @@ -155,7 +155,7 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len) { - const char *input_buf = (const char *) line_buf; + const char *input_buf = line_buf; int input_len = line_len; // based on m22000 module_hash_decode() we detect both the hashformat with and without user-password diff --git a/src/modules/module_25600.c b/src/modules/module_25600.c index d673b29ee..dc6ec869c 100644 --- a/src/modules/module_25600.c +++ b/src/modules/module_25600.c @@ -220,7 +220,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - base64_decode (bf64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + base64_decode (bf64_to_int, salt_pos, salt_len, tmp_buf); memcpy (salt_buf_ptr, tmp_buf, 16); @@ -231,7 +231,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - base64_decode (bf64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (bf64_to_int, hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, 24); diff --git a/src/modules/module_25700.c b/src/modules/module_25700.c index c6a805dcc..30b0df8d5 100644 --- a/src/modules/module_25700.c +++ b/src/modules/module_25700.c @@ -84,7 +84,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[0]; - digest[0] = hex_to_u32 ((const u8 *) &hash_pos[0]); + digest[0] = hex_to_u32 (&hash_pos[0]); digest[1] = 0; digest[2] = 0; digest[3] = 0; @@ -96,7 +96,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *salt_pos = token.buf[1]; const int salt_len = token.len[1]; - salt->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[0]); + salt->salt_buf[0] = hex_to_u32 (&salt_pos[0]); salt->salt_buf[0] = byte_swap_32 (salt->salt_buf[0]); diff --git a/src/modules/module_25800.c b/src/modules/module_25800.c index 116af2fa5..89c4251b6 100644 --- a/src/modules/module_25800.c +++ b/src/modules/module_25800.c @@ -220,7 +220,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - base64_decode (bf64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + base64_decode (bf64_to_int, salt_pos, salt_len, tmp_buf); memcpy (salt_buf_ptr, tmp_buf, 16); @@ -231,7 +231,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - base64_decode (bf64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (bf64_to_int, hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, 24); diff --git a/src/modules/module_25900.c b/src/modules/module_25900.c index ba5e8423b..898fc5b52 100644 --- a/src/modules/module_25900.c +++ b/src/modules/module_25900.c @@ -179,13 +179,13 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 secure_session_identifier[2]; u8 public_value_xor[32]; - hex_decode (secure_session_identifier_pos, secure_session_identifier_len, (u8 *) &secure_session_identifier); - hex_decode (public_value_xor_pos, public_value_xor_len, (u8 *) &public_value_xor); + hex_decode (secure_session_identifier_pos, secure_session_identifier_len, secure_session_identifier); + hex_decode (public_value_xor_pos, public_value_xor_len, public_value_xor); - digest[0] = hex_to_u32 ((const u8 *) &mac_pos[0]); - digest[1] = hex_to_u32 ((const u8 *) &mac_pos[8]); - digest[2] = hex_to_u32 ((const u8 *) &mac_pos[16]); - digest[3] = hex_to_u32 ((const u8 *) &mac_pos[24]); + digest[0] = hex_to_u32 (&mac_pos[0]); + digest[1] = hex_to_u32 (&mac_pos[8]); + digest[2] = hex_to_u32 (&mac_pos[16]); + digest[3] = hex_to_u32 (&mac_pos[24]); u8 b1[16] = { 0x00, //-x Length of the associated data 0x28, //_| diff --git a/src/modules/module_26200.c b/src/modules/module_26200.c index 90223e1bf..bed7b39c5 100644 --- a/src/modules/module_26200.c +++ b/src/modules/module_26200.c @@ -92,7 +92,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (rc_tokenizer != PARSER_OK) return (rc_tokenizer); - const u8 *hash_pos = (const u8 *) token.buf[0]; + const u8 *hash_pos = token.buf[0]; const u32 hash_len = token.len[0]; /* diff --git a/src/modules/module_27400.c b/src/modules/module_27400.c index 72ba72cdb..f0368c6b5 100644 --- a/src/modules/module_27400.c +++ b/src/modules/module_27400.c @@ -136,7 +136,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt - const u8 *salt_pos = (const u8 *) token.buf[2]; + const u8 *salt_pos = token.buf[2]; int salt_len = token.len[2]; salt->salt_buf[0] = hex_to_u32 (salt_pos + 0); diff --git a/src/modules/module_27500.c b/src/modules/module_27500.c index 12d576bff..24ea388fd 100644 --- a/src/modules/module_27500.c +++ b/src/modules/module_27500.c @@ -184,14 +184,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 *salt1_buf_ptr = (u32 *) vbox->salt1_buf; - salt1_buf_ptr[0] = hex_to_u32 ((const u8 *) &salt1_pos[ 0]); - salt1_buf_ptr[1] = hex_to_u32 ((const u8 *) &salt1_pos[ 8]); - salt1_buf_ptr[2] = hex_to_u32 ((const u8 *) &salt1_pos[16]); - salt1_buf_ptr[3] = hex_to_u32 ((const u8 *) &salt1_pos[24]); - salt1_buf_ptr[4] = hex_to_u32 ((const u8 *) &salt1_pos[32]); - salt1_buf_ptr[5] = hex_to_u32 ((const u8 *) &salt1_pos[40]); - salt1_buf_ptr[6] = hex_to_u32 ((const u8 *) &salt1_pos[48]); - salt1_buf_ptr[7] = hex_to_u32 ((const u8 *) &salt1_pos[56]); + salt1_buf_ptr[0] = hex_to_u32 (&salt1_pos[ 0]); + salt1_buf_ptr[1] = hex_to_u32 (&salt1_pos[ 8]); + salt1_buf_ptr[2] = hex_to_u32 (&salt1_pos[16]); + salt1_buf_ptr[3] = hex_to_u32 (&salt1_pos[24]); + salt1_buf_ptr[4] = hex_to_u32 (&salt1_pos[32]); + salt1_buf_ptr[5] = hex_to_u32 (&salt1_pos[40]); + salt1_buf_ptr[6] = hex_to_u32 (&salt1_pos[48]); + salt1_buf_ptr[7] = hex_to_u32 (&salt1_pos[56]); vbox->salt1_len = salt1_len / 2; @@ -228,14 +228,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 *enc_pass_buf_ptr = (u32 *) vbox->enc_pass_buf; - enc_pass_buf_ptr[ 0] = hex_to_u32 ((const u8 *) &enc_pass_pos[ 0]); - enc_pass_buf_ptr[ 1] = hex_to_u32 ((const u8 *) &enc_pass_pos[ 8]); - enc_pass_buf_ptr[ 2] = hex_to_u32 ((const u8 *) &enc_pass_pos[16]); - enc_pass_buf_ptr[ 3] = hex_to_u32 ((const u8 *) &enc_pass_pos[24]); - enc_pass_buf_ptr[ 4] = hex_to_u32 ((const u8 *) &enc_pass_pos[32]); - enc_pass_buf_ptr[ 5] = hex_to_u32 ((const u8 *) &enc_pass_pos[40]); - enc_pass_buf_ptr[ 6] = hex_to_u32 ((const u8 *) &enc_pass_pos[48]); - enc_pass_buf_ptr[ 7] = hex_to_u32 ((const u8 *) &enc_pass_pos[56]); + enc_pass_buf_ptr[ 0] = hex_to_u32 (&enc_pass_pos[ 0]); + enc_pass_buf_ptr[ 1] = hex_to_u32 (&enc_pass_pos[ 8]); + enc_pass_buf_ptr[ 2] = hex_to_u32 (&enc_pass_pos[16]); + enc_pass_buf_ptr[ 3] = hex_to_u32 (&enc_pass_pos[24]); + enc_pass_buf_ptr[ 4] = hex_to_u32 (&enc_pass_pos[32]); + enc_pass_buf_ptr[ 5] = hex_to_u32 (&enc_pass_pos[40]); + enc_pass_buf_ptr[ 6] = hex_to_u32 (&enc_pass_pos[48]); + enc_pass_buf_ptr[ 7] = hex_to_u32 (&enc_pass_pos[56]); // iter 2 @@ -254,14 +254,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 *salt2_buf_ptr = (u32 *) vbox->salt2_buf; - salt2_buf_ptr[0] = hex_to_u32 ((const u8 *) &salt2_pos[ 0]); - salt2_buf_ptr[1] = hex_to_u32 ((const u8 *) &salt2_pos[ 8]); - salt2_buf_ptr[2] = hex_to_u32 ((const u8 *) &salt2_pos[16]); - salt2_buf_ptr[3] = hex_to_u32 ((const u8 *) &salt2_pos[24]); - salt2_buf_ptr[4] = hex_to_u32 ((const u8 *) &salt2_pos[32]); - salt2_buf_ptr[5] = hex_to_u32 ((const u8 *) &salt2_pos[40]); - salt2_buf_ptr[6] = hex_to_u32 ((const u8 *) &salt2_pos[48]); - salt2_buf_ptr[7] = hex_to_u32 ((const u8 *) &salt2_pos[56]); + salt2_buf_ptr[0] = hex_to_u32 (&salt2_pos[ 0]); + salt2_buf_ptr[1] = hex_to_u32 (&salt2_pos[ 8]); + salt2_buf_ptr[2] = hex_to_u32 (&salt2_pos[16]); + salt2_buf_ptr[3] = hex_to_u32 (&salt2_pos[24]); + salt2_buf_ptr[4] = hex_to_u32 (&salt2_pos[32]); + salt2_buf_ptr[5] = hex_to_u32 (&salt2_pos[40]); + salt2_buf_ptr[6] = hex_to_u32 (&salt2_pos[48]); + salt2_buf_ptr[7] = hex_to_u32 (&salt2_pos[56]); vbox->salt2_len = salt2_len / 2; @@ -269,14 +269,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[7]; - digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]); - digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]); - digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]); - digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]); - digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]); - digest[5] = hex_to_u32 ((const u8 *) &hash_pos[40]); - digest[6] = hex_to_u32 ((const u8 *) &hash_pos[48]); - digest[7] = hex_to_u32 ((const u8 *) &hash_pos[56]); + digest[0] = hex_to_u32 (&hash_pos[ 0]); + digest[1] = hex_to_u32 (&hash_pos[ 8]); + digest[2] = hex_to_u32 (&hash_pos[16]); + digest[3] = hex_to_u32 (&hash_pos[24]); + digest[4] = hex_to_u32 (&hash_pos[32]); + digest[5] = hex_to_u32 (&hash_pos[40]); + digest[6] = hex_to_u32 (&hash_pos[48]); + digest[7] = hex_to_u32 (&hash_pos[56]); digest[0] = byte_swap_32 (digest[0]); digest[1] = byte_swap_32 (digest[1]); diff --git a/src/modules/module_27600.c b/src/modules/module_27600.c index d458cbd8a..4f2feccd7 100644 --- a/src/modules/module_27600.c +++ b/src/modules/module_27600.c @@ -184,14 +184,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 *salt1_buf_ptr = (u32 *) vbox->salt1_buf; - salt1_buf_ptr[0] = hex_to_u32 ((const u8 *) &salt1_pos[ 0]); - salt1_buf_ptr[1] = hex_to_u32 ((const u8 *) &salt1_pos[ 8]); - salt1_buf_ptr[2] = hex_to_u32 ((const u8 *) &salt1_pos[16]); - salt1_buf_ptr[3] = hex_to_u32 ((const u8 *) &salt1_pos[24]); - salt1_buf_ptr[4] = hex_to_u32 ((const u8 *) &salt1_pos[32]); - salt1_buf_ptr[5] = hex_to_u32 ((const u8 *) &salt1_pos[40]); - salt1_buf_ptr[6] = hex_to_u32 ((const u8 *) &salt1_pos[48]); - salt1_buf_ptr[7] = hex_to_u32 ((const u8 *) &salt1_pos[56]); + salt1_buf_ptr[0] = hex_to_u32 (&salt1_pos[ 0]); + salt1_buf_ptr[1] = hex_to_u32 (&salt1_pos[ 8]); + salt1_buf_ptr[2] = hex_to_u32 (&salt1_pos[16]); + salt1_buf_ptr[3] = hex_to_u32 (&salt1_pos[24]); + salt1_buf_ptr[4] = hex_to_u32 (&salt1_pos[32]); + salt1_buf_ptr[5] = hex_to_u32 (&salt1_pos[40]); + salt1_buf_ptr[6] = hex_to_u32 (&salt1_pos[48]); + salt1_buf_ptr[7] = hex_to_u32 (&salt1_pos[56]); vbox->salt1_len = salt1_len / 2; @@ -228,22 +228,22 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 *enc_pass_buf_ptr = (u32 *) vbox->enc_pass_buf; - enc_pass_buf_ptr[ 0] = hex_to_u32 ((const u8 *) &enc_pass_pos[ 0]); - enc_pass_buf_ptr[ 1] = hex_to_u32 ((const u8 *) &enc_pass_pos[ 8]); - enc_pass_buf_ptr[ 2] = hex_to_u32 ((const u8 *) &enc_pass_pos[16]); - enc_pass_buf_ptr[ 3] = hex_to_u32 ((const u8 *) &enc_pass_pos[24]); - enc_pass_buf_ptr[ 4] = hex_to_u32 ((const u8 *) &enc_pass_pos[32]); - enc_pass_buf_ptr[ 5] = hex_to_u32 ((const u8 *) &enc_pass_pos[40]); - enc_pass_buf_ptr[ 6] = hex_to_u32 ((const u8 *) &enc_pass_pos[48]); - enc_pass_buf_ptr[ 7] = hex_to_u32 ((const u8 *) &enc_pass_pos[56]); - enc_pass_buf_ptr[ 8] = hex_to_u32 ((const u8 *) &enc_pass_pos[64]); - enc_pass_buf_ptr[ 9] = hex_to_u32 ((const u8 *) &enc_pass_pos[72]); - enc_pass_buf_ptr[10] = hex_to_u32 ((const u8 *) &enc_pass_pos[80]); - enc_pass_buf_ptr[11] = hex_to_u32 ((const u8 *) &enc_pass_pos[88]); - enc_pass_buf_ptr[12] = hex_to_u32 ((const u8 *) &enc_pass_pos[96]); - enc_pass_buf_ptr[13] = hex_to_u32 ((const u8 *) &enc_pass_pos[104]); - enc_pass_buf_ptr[14] = hex_to_u32 ((const u8 *) &enc_pass_pos[112]); - enc_pass_buf_ptr[15] = hex_to_u32 ((const u8 *) &enc_pass_pos[120]); + enc_pass_buf_ptr[ 0] = hex_to_u32 (&enc_pass_pos[ 0]); + enc_pass_buf_ptr[ 1] = hex_to_u32 (&enc_pass_pos[ 8]); + enc_pass_buf_ptr[ 2] = hex_to_u32 (&enc_pass_pos[16]); + enc_pass_buf_ptr[ 3] = hex_to_u32 (&enc_pass_pos[24]); + enc_pass_buf_ptr[ 4] = hex_to_u32 (&enc_pass_pos[32]); + enc_pass_buf_ptr[ 5] = hex_to_u32 (&enc_pass_pos[40]); + enc_pass_buf_ptr[ 6] = hex_to_u32 (&enc_pass_pos[48]); + enc_pass_buf_ptr[ 7] = hex_to_u32 (&enc_pass_pos[56]); + enc_pass_buf_ptr[ 8] = hex_to_u32 (&enc_pass_pos[64]); + enc_pass_buf_ptr[ 9] = hex_to_u32 (&enc_pass_pos[72]); + enc_pass_buf_ptr[10] = hex_to_u32 (&enc_pass_pos[80]); + enc_pass_buf_ptr[11] = hex_to_u32 (&enc_pass_pos[88]); + enc_pass_buf_ptr[12] = hex_to_u32 (&enc_pass_pos[96]); + enc_pass_buf_ptr[13] = hex_to_u32 (&enc_pass_pos[104]); + enc_pass_buf_ptr[14] = hex_to_u32 (&enc_pass_pos[112]); + enc_pass_buf_ptr[15] = hex_to_u32 (&enc_pass_pos[120]); // iter 2 @@ -262,14 +262,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u32 *salt2_buf_ptr = (u32 *) vbox->salt2_buf; - salt2_buf_ptr[0] = hex_to_u32 ((const u8 *) &salt2_pos[ 0]); - salt2_buf_ptr[1] = hex_to_u32 ((const u8 *) &salt2_pos[ 8]); - salt2_buf_ptr[2] = hex_to_u32 ((const u8 *) &salt2_pos[16]); - salt2_buf_ptr[3] = hex_to_u32 ((const u8 *) &salt2_pos[24]); - salt2_buf_ptr[4] = hex_to_u32 ((const u8 *) &salt2_pos[32]); - salt2_buf_ptr[5] = hex_to_u32 ((const u8 *) &salt2_pos[40]); - salt2_buf_ptr[6] = hex_to_u32 ((const u8 *) &salt2_pos[48]); - salt2_buf_ptr[7] = hex_to_u32 ((const u8 *) &salt2_pos[56]); + salt2_buf_ptr[0] = hex_to_u32 (&salt2_pos[ 0]); + salt2_buf_ptr[1] = hex_to_u32 (&salt2_pos[ 8]); + salt2_buf_ptr[2] = hex_to_u32 (&salt2_pos[16]); + salt2_buf_ptr[3] = hex_to_u32 (&salt2_pos[24]); + salt2_buf_ptr[4] = hex_to_u32 (&salt2_pos[32]); + salt2_buf_ptr[5] = hex_to_u32 (&salt2_pos[40]); + salt2_buf_ptr[6] = hex_to_u32 (&salt2_pos[48]); + salt2_buf_ptr[7] = hex_to_u32 (&salt2_pos[56]); vbox->salt2_len = salt2_len / 2; @@ -277,14 +277,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[7]; - digest[0] = hex_to_u32 ((const u8 *) &hash_pos[ 0]); - digest[1] = hex_to_u32 ((const u8 *) &hash_pos[ 8]); - digest[2] = hex_to_u32 ((const u8 *) &hash_pos[16]); - digest[3] = hex_to_u32 ((const u8 *) &hash_pos[24]); - digest[4] = hex_to_u32 ((const u8 *) &hash_pos[32]); - digest[5] = hex_to_u32 ((const u8 *) &hash_pos[40]); - digest[6] = hex_to_u32 ((const u8 *) &hash_pos[48]); - digest[7] = hex_to_u32 ((const u8 *) &hash_pos[56]); + digest[0] = hex_to_u32 (&hash_pos[ 0]); + digest[1] = hex_to_u32 (&hash_pos[ 8]); + digest[2] = hex_to_u32 (&hash_pos[16]); + digest[3] = hex_to_u32 (&hash_pos[24]); + digest[4] = hex_to_u32 (&hash_pos[32]); + digest[5] = hex_to_u32 (&hash_pos[40]); + digest[6] = hex_to_u32 (&hash_pos[48]); + digest[7] = hex_to_u32 (&hash_pos[56]); digest[0] = byte_swap_32 (digest[0]); digest[1] = byte_swap_32 (digest[1]); diff --git a/src/modules/module_27800.c b/src/modules/module_27800.c index 4aefff85a..f5bf82a46 100644 --- a/src/modules/module_27800.c +++ b/src/modules/module_27800.c @@ -84,7 +84,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *hash_pos = token.buf[0]; - digest[0] = hex_to_u32 ((const u8 *) &hash_pos[0]); + digest[0] = hex_to_u32 (&hash_pos[0]); digest[1] = 0; digest[2] = 0; digest[3] = 0; @@ -96,7 +96,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *salt_pos = token.buf[1]; const int salt_len = token.len[1]; - salt->salt_buf[0] = hex_to_u32 ((const u8 *) &salt_pos[0]); + salt->salt_buf[0] = hex_to_u32 (&salt_pos[0]); salt->salt_buf[0] = byte_swap_32 (salt->salt_buf[0]); diff --git a/src/modules/module_28200.c b/src/modules/module_28200.c index 4eaf61bc6..dd3ce7998 100644 --- a/src/modules/module_28200.c +++ b/src/modules/module_28200.c @@ -362,7 +362,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - tmp_len = base64_decode (base64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + tmp_len = base64_decode (base64_to_int, salt_pos, salt_len, tmp_buf); memcpy (salt->salt_buf, tmp_buf, tmp_len); @@ -377,7 +377,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - tmp_len = base64_decode (base64_to_int, (const u8 *) iv_pos, iv_len, tmp_buf); + tmp_len = base64_decode (base64_to_int, iv_pos, iv_len, tmp_buf); memcpy (exodus->iv, tmp_buf, tmp_len); @@ -390,7 +390,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - tmp_len = base64_decode (base64_to_int, (const u8 *) data_pos, data_len, tmp_buf); + tmp_len = base64_decode (base64_to_int, data_pos, data_len, tmp_buf); memcpy (exodus->data, tmp_buf, tmp_len); @@ -403,7 +403,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - tmp_len = base64_decode (base64_to_int, (const u8 *) tag_pos, tag_len, tmp_buf); + tmp_len = base64_decode (base64_to_int, tag_pos, tag_len, tmp_buf); memcpy (exodus->tag, tmp_buf, tmp_len); diff --git a/src/modules/module_28400.c b/src/modules/module_28400.c index d2bc7e2bc..fdb164cee 100644 --- a/src/modules/module_28400.c +++ b/src/modules/module_28400.c @@ -220,7 +220,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - base64_decode (bf64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + base64_decode (bf64_to_int, salt_pos, salt_len, tmp_buf); memcpy (salt_buf_ptr, tmp_buf, 16); @@ -231,7 +231,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - base64_decode (bf64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (bf64_to_int, hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, 24); diff --git a/src/modules/module_28700.c b/src/modules/module_28700.c index cd35d2ccf..7e053b6ee 100644 --- a/src/modules/module_28700.c +++ b/src/modules/module_28700.c @@ -155,7 +155,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // date - parse_rc = generic_salt_decode (hashconfig, (const u8 *) longdate_pos, 8, (u8 *) esalt->date, (int *) &esalt->date_len); + parse_rc = generic_salt_decode (hashconfig, longdate_pos, 8, (u8 *) esalt->date, (int *) &esalt->date_len); if (parse_rc == false) return (PARSER_SALT_LENGTH); diff --git a/src/modules/module_28800.c b/src/modules/module_28800.c index d5a972765..a1fe7825d 100644 --- a/src/modules/module_28800.c +++ b/src/modules/module_28800.c @@ -116,7 +116,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // assume no signature found if (line_len < 11) return (PARSER_SALT_LENGTH); - char *spn_info_start = strchr ((const char *) line_buf + 11 + 1, '*'); + char *spn_info_start = strchr (line_buf + 11 + 1, '*'); int is_spn_provided = 0; diff --git a/src/modules/module_28900.c b/src/modules/module_28900.c index d706e5a3e..d0805d085 100644 --- a/src/modules/module_28900.c +++ b/src/modules/module_28900.c @@ -116,7 +116,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // assume no signature found if (line_len < 11) return (PARSER_SALT_LENGTH); - char *spn_info_start = strchr ((const char *) line_buf + 11 + 1, '*'); + char *spn_info_start = strchr (line_buf + 11 + 1, '*'); int is_spn_provided = 0; diff --git a/src/modules/module_29000.c b/src/modules/module_29000.c index 4204020d8..7e9682cf4 100644 --- a/src/modules/module_29000.c +++ b/src/modules/module_29000.c @@ -122,11 +122,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE digest[4] -= SHA1M_E; } - const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) sha1_double_salt->salt1_buf, (int *) &sha1_double_salt->salt1_len); + const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) sha1_double_salt->salt1_buf, &sha1_double_salt->salt1_len); if (parse_rc1 == false) return (PARSER_SALT_LENGTH); - const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) sha1_double_salt->salt2_buf, (int *) &sha1_double_salt->salt2_len); + const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) sha1_double_salt->salt2_buf, &sha1_double_salt->salt2_len); if (parse_rc2 == false) return (PARSER_SALT_LENGTH); @@ -195,13 +195,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt1_buf, (const int) sha1_double_salt->salt1_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt1_buf, sha1_double_salt->salt1_len, out_buf + out_len); out_buf[out_len] = hashconfig->separator; out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt2_buf, (const int) sha1_double_salt->salt2_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) sha1_double_salt->salt2_buf, sha1_double_salt->salt2_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_29700.c b/src/modules/module_29700.c index 2337f0e29..4a2ca92ac 100644 --- a/src/modules/module_29700.c +++ b/src/modules/module_29700.c @@ -292,10 +292,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *final_random_seed_pos = token.buf[4]; - keepass->final_random_seed[0] = hex_to_u32 ((const u8 *) &final_random_seed_pos[ 0]); - keepass->final_random_seed[1] = hex_to_u32 ((const u8 *) &final_random_seed_pos[ 8]); - keepass->final_random_seed[2] = hex_to_u32 ((const u8 *) &final_random_seed_pos[16]); - keepass->final_random_seed[3] = hex_to_u32 ((const u8 *) &final_random_seed_pos[24]); + keepass->final_random_seed[0] = hex_to_u32 (&final_random_seed_pos[ 0]); + keepass->final_random_seed[1] = hex_to_u32 (&final_random_seed_pos[ 8]); + keepass->final_random_seed[2] = hex_to_u32 (&final_random_seed_pos[16]); + keepass->final_random_seed[3] = hex_to_u32 (&final_random_seed_pos[24]); keepass->final_random_seed[0] = byte_swap_32 (keepass->final_random_seed[0]); keepass->final_random_seed[1] = byte_swap_32 (keepass->final_random_seed[1]); @@ -304,10 +304,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE if (keepass->version == 2) { - keepass->final_random_seed[4] = hex_to_u32 ((const u8 *) &final_random_seed_pos[32]); - keepass->final_random_seed[5] = hex_to_u32 ((const u8 *) &final_random_seed_pos[40]); - keepass->final_random_seed[6] = hex_to_u32 ((const u8 *) &final_random_seed_pos[48]); - keepass->final_random_seed[7] = hex_to_u32 ((const u8 *) &final_random_seed_pos[56]); + keepass->final_random_seed[4] = hex_to_u32 (&final_random_seed_pos[32]); + keepass->final_random_seed[5] = hex_to_u32 (&final_random_seed_pos[40]); + keepass->final_random_seed[6] = hex_to_u32 (&final_random_seed_pos[48]); + keepass->final_random_seed[7] = hex_to_u32 (&final_random_seed_pos[56]); keepass->final_random_seed[4] = byte_swap_32 (keepass->final_random_seed[4]); keepass->final_random_seed[5] = byte_swap_32 (keepass->final_random_seed[5]); @@ -319,14 +319,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *transf_random_seed_pos = token.buf[5]; - keepass->transf_random_seed[0] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[ 0]); - keepass->transf_random_seed[1] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[ 8]); - keepass->transf_random_seed[2] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[16]); - keepass->transf_random_seed[3] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[24]); - keepass->transf_random_seed[4] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[32]); - keepass->transf_random_seed[5] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[40]); - keepass->transf_random_seed[6] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[48]); - keepass->transf_random_seed[7] = hex_to_u32 ((const u8 *) &transf_random_seed_pos[56]); + keepass->transf_random_seed[0] = hex_to_u32 (&transf_random_seed_pos[ 0]); + keepass->transf_random_seed[1] = hex_to_u32 (&transf_random_seed_pos[ 8]); + keepass->transf_random_seed[2] = hex_to_u32 (&transf_random_seed_pos[16]); + keepass->transf_random_seed[3] = hex_to_u32 (&transf_random_seed_pos[24]); + keepass->transf_random_seed[4] = hex_to_u32 (&transf_random_seed_pos[32]); + keepass->transf_random_seed[5] = hex_to_u32 (&transf_random_seed_pos[40]); + keepass->transf_random_seed[6] = hex_to_u32 (&transf_random_seed_pos[48]); + keepass->transf_random_seed[7] = hex_to_u32 (&transf_random_seed_pos[56]); keepass->transf_random_seed[0] = byte_swap_32 (keepass->transf_random_seed[0]); keepass->transf_random_seed[1] = byte_swap_32 (keepass->transf_random_seed[1]); @@ -341,10 +341,10 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *enc_iv_pos = token.buf[6]; - keepass->enc_iv[0] = hex_to_u32 ((const u8 *) &enc_iv_pos[ 0]); - keepass->enc_iv[1] = hex_to_u32 ((const u8 *) &enc_iv_pos[ 8]); - keepass->enc_iv[2] = hex_to_u32 ((const u8 *) &enc_iv_pos[16]); - keepass->enc_iv[3] = hex_to_u32 ((const u8 *) &enc_iv_pos[24]); + keepass->enc_iv[0] = hex_to_u32 (&enc_iv_pos[ 0]); + keepass->enc_iv[1] = hex_to_u32 (&enc_iv_pos[ 8]); + keepass->enc_iv[2] = hex_to_u32 (&enc_iv_pos[16]); + keepass->enc_iv[3] = hex_to_u32 (&enc_iv_pos[24]); keepass->enc_iv[0] = byte_swap_32 (keepass->enc_iv[0]); keepass->enc_iv[1] = byte_swap_32 (keepass->enc_iv[1]); @@ -359,14 +359,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *contents_hash_pos = token.buf[7]; - keepass->contents_hash[0] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 0]); - keepass->contents_hash[1] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 8]); - keepass->contents_hash[2] = hex_to_u32 ((const u8 *) &contents_hash_pos[16]); - keepass->contents_hash[3] = hex_to_u32 ((const u8 *) &contents_hash_pos[24]); - keepass->contents_hash[4] = hex_to_u32 ((const u8 *) &contents_hash_pos[32]); - keepass->contents_hash[5] = hex_to_u32 ((const u8 *) &contents_hash_pos[40]); - keepass->contents_hash[6] = hex_to_u32 ((const u8 *) &contents_hash_pos[48]); - keepass->contents_hash[7] = hex_to_u32 ((const u8 *) &contents_hash_pos[56]); + keepass->contents_hash[0] = hex_to_u32 (&contents_hash_pos[ 0]); + keepass->contents_hash[1] = hex_to_u32 (&contents_hash_pos[ 8]); + keepass->contents_hash[2] = hex_to_u32 (&contents_hash_pos[16]); + keepass->contents_hash[3] = hex_to_u32 (&contents_hash_pos[24]); + keepass->contents_hash[4] = hex_to_u32 (&contents_hash_pos[32]); + keepass->contents_hash[5] = hex_to_u32 (&contents_hash_pos[40]); + keepass->contents_hash[6] = hex_to_u32 (&contents_hash_pos[48]); + keepass->contents_hash[7] = hex_to_u32 (&contents_hash_pos[56]); keepass->contents_hash[0] = byte_swap_32 (keepass->contents_hash[0]); keepass->contents_hash[1] = byte_swap_32 (keepass->contents_hash[1]); @@ -386,7 +386,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 0, j = 0; j < contents_len; i += 1, j += 8) { - keepass->contents[i] = hex_to_u32 ((const u8 *) &contents_pos[j]); + keepass->contents[i] = hex_to_u32 (&contents_pos[j]); keepass->contents[i] = byte_swap_32 (keepass->contents[i]); } @@ -402,14 +402,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *expected_bytes_pos = token.buf[7]; - keepass->expected_bytes[0] = hex_to_u32 ((const u8 *) &expected_bytes_pos[ 0]); - keepass->expected_bytes[1] = hex_to_u32 ((const u8 *) &expected_bytes_pos[ 8]); - keepass->expected_bytes[2] = hex_to_u32 ((const u8 *) &expected_bytes_pos[16]); - keepass->expected_bytes[3] = hex_to_u32 ((const u8 *) &expected_bytes_pos[24]); - keepass->expected_bytes[4] = hex_to_u32 ((const u8 *) &expected_bytes_pos[32]); - keepass->expected_bytes[5] = hex_to_u32 ((const u8 *) &expected_bytes_pos[40]); - keepass->expected_bytes[6] = hex_to_u32 ((const u8 *) &expected_bytes_pos[48]); - keepass->expected_bytes[7] = hex_to_u32 ((const u8 *) &expected_bytes_pos[56]); + keepass->expected_bytes[0] = hex_to_u32 (&expected_bytes_pos[ 0]); + keepass->expected_bytes[1] = hex_to_u32 (&expected_bytes_pos[ 8]); + keepass->expected_bytes[2] = hex_to_u32 (&expected_bytes_pos[16]); + keepass->expected_bytes[3] = hex_to_u32 (&expected_bytes_pos[24]); + keepass->expected_bytes[4] = hex_to_u32 (&expected_bytes_pos[32]); + keepass->expected_bytes[5] = hex_to_u32 (&expected_bytes_pos[40]); + keepass->expected_bytes[6] = hex_to_u32 (&expected_bytes_pos[48]); + keepass->expected_bytes[7] = hex_to_u32 (&expected_bytes_pos[56]); keepass->expected_bytes[0] = byte_swap_32 (keepass->expected_bytes[0]); keepass->expected_bytes[1] = byte_swap_32 (keepass->expected_bytes[1]); @@ -424,14 +424,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *contents_hash_pos = token.buf[8]; - keepass->contents_hash[0] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 0]); - keepass->contents_hash[1] = hex_to_u32 ((const u8 *) &contents_hash_pos[ 8]); - keepass->contents_hash[2] = hex_to_u32 ((const u8 *) &contents_hash_pos[16]); - keepass->contents_hash[3] = hex_to_u32 ((const u8 *) &contents_hash_pos[24]); - keepass->contents_hash[4] = hex_to_u32 ((const u8 *) &contents_hash_pos[32]); - keepass->contents_hash[5] = hex_to_u32 ((const u8 *) &contents_hash_pos[40]); - keepass->contents_hash[6] = hex_to_u32 ((const u8 *) &contents_hash_pos[48]); - keepass->contents_hash[7] = hex_to_u32 ((const u8 *) &contents_hash_pos[56]); + keepass->contents_hash[0] = hex_to_u32 (&contents_hash_pos[ 0]); + keepass->contents_hash[1] = hex_to_u32 (&contents_hash_pos[ 8]); + keepass->contents_hash[2] = hex_to_u32 (&contents_hash_pos[16]); + keepass->contents_hash[3] = hex_to_u32 (&contents_hash_pos[24]); + keepass->contents_hash[4] = hex_to_u32 (&contents_hash_pos[32]); + keepass->contents_hash[5] = hex_to_u32 (&contents_hash_pos[40]); + keepass->contents_hash[6] = hex_to_u32 (&contents_hash_pos[48]); + keepass->contents_hash[7] = hex_to_u32 (&contents_hash_pos[56]); keepass->contents_hash[0] = byte_swap_32 (keepass->contents_hash[0]); keepass->contents_hash[1] = byte_swap_32 (keepass->contents_hash[1]); @@ -452,14 +452,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { keepass->keyfile_len = 32; - keepass->keyfile[0] = hex_to_u32 ((const u8 *) &keyfile_pos[ 0]); - keepass->keyfile[1] = hex_to_u32 ((const u8 *) &keyfile_pos[ 8]); - keepass->keyfile[2] = hex_to_u32 ((const u8 *) &keyfile_pos[16]); - keepass->keyfile[3] = hex_to_u32 ((const u8 *) &keyfile_pos[24]); - keepass->keyfile[4] = hex_to_u32 ((const u8 *) &keyfile_pos[32]); - keepass->keyfile[5] = hex_to_u32 ((const u8 *) &keyfile_pos[40]); - keepass->keyfile[6] = hex_to_u32 ((const u8 *) &keyfile_pos[48]); - keepass->keyfile[7] = hex_to_u32 ((const u8 *) &keyfile_pos[56]); + keepass->keyfile[0] = hex_to_u32 (&keyfile_pos[ 0]); + keepass->keyfile[1] = hex_to_u32 (&keyfile_pos[ 8]); + keepass->keyfile[2] = hex_to_u32 (&keyfile_pos[16]); + keepass->keyfile[3] = hex_to_u32 (&keyfile_pos[24]); + keepass->keyfile[4] = hex_to_u32 (&keyfile_pos[32]); + keepass->keyfile[5] = hex_to_u32 (&keyfile_pos[40]); + keepass->keyfile[6] = hex_to_u32 (&keyfile_pos[48]); + keepass->keyfile[7] = hex_to_u32 (&keyfile_pos[56]); keepass->keyfile[0] = byte_swap_32 (keepass->keyfile[0]); keepass->keyfile[1] = byte_swap_32 (keepass->keyfile[1]); diff --git a/src/modules/module_29910.c b/src/modules/module_29910.c index 23ed260c7..bb76e8da4 100644 --- a/src/modules/module_29910.c +++ b/src/modules/module_29910.c @@ -170,15 +170,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *iv_pos = token.buf[3]; - encdatavault->iv[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[0])); - encdatavault->iv[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[8])); + encdatavault->iv[0] = byte_swap_32 (hex_to_u32 (&iv_pos[0])); + encdatavault->iv[1] = byte_swap_32 (hex_to_u32 (&iv_pos[8])); // ct const u8 *ct_pos = token.buf[4]; - encdatavault->ct[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[0])); - encdatavault->ct[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[8])); + encdatavault->ct[0] = byte_swap_32 (hex_to_u32 (&ct_pos[0])); + encdatavault->ct[1] = byte_swap_32 (hex_to_u32 (&ct_pos[8])); // salt length @@ -192,14 +192,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *salt_pos = token.buf[6]; - salt->salt_buf[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[ 0])); - salt->salt_buf[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[ 8])); - salt->salt_buf[2] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[16])); - salt->salt_buf[3] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[24])); - salt->salt_buf[4] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[32])); - salt->salt_buf[5] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[40])); - salt->salt_buf[6] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[48])); - salt->salt_buf[7] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[56])); + salt->salt_buf[0] = byte_swap_32 (hex_to_u32 (&salt_pos[ 0])); + salt->salt_buf[1] = byte_swap_32 (hex_to_u32 (&salt_pos[ 8])); + salt->salt_buf[2] = byte_swap_32 (hex_to_u32 (&salt_pos[16])); + salt->salt_buf[3] = byte_swap_32 (hex_to_u32 (&salt_pos[24])); + salt->salt_buf[4] = byte_swap_32 (hex_to_u32 (&salt_pos[32])); + salt->salt_buf[5] = byte_swap_32 (hex_to_u32 (&salt_pos[40])); + salt->salt_buf[6] = byte_swap_32 (hex_to_u32 (&salt_pos[48])); + salt->salt_buf[7] = byte_swap_32 (hex_to_u32 (&salt_pos[56])); salt->salt_len = 32; diff --git a/src/modules/module_29920.c b/src/modules/module_29920.c index bb433b090..259e0f620 100644 --- a/src/modules/module_29920.c +++ b/src/modules/module_29920.c @@ -176,15 +176,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *iv_pos = token.buf[3]; - encdatavault->iv[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[0])); - encdatavault->iv[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[8])); + encdatavault->iv[0] = byte_swap_32 (hex_to_u32 (&iv_pos[0])); + encdatavault->iv[1] = byte_swap_32 (hex_to_u32 (&iv_pos[8])); // ct const u8 *ct_pos = token.buf[4]; - encdatavault->ct[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[0])); - encdatavault->ct[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[8])); + encdatavault->ct[0] = byte_swap_32 (hex_to_u32 (&ct_pos[0])); + encdatavault->ct[1] = byte_swap_32 (hex_to_u32 (&ct_pos[8])); // salt length @@ -198,14 +198,14 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *salt_pos = token.buf[6]; - salt->salt_buf[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[ 0])); - salt->salt_buf[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[ 8])); - salt->salt_buf[2] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[16])); - salt->salt_buf[3] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[24])); - salt->salt_buf[4] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[32])); - salt->salt_buf[5] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[40])); - salt->salt_buf[6] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[48])); - salt->salt_buf[7] = byte_swap_32 (hex_to_u32 ((const u8 *) &salt_pos[56])); + salt->salt_buf[0] = byte_swap_32 (hex_to_u32 (&salt_pos[ 0])); + salt->salt_buf[1] = byte_swap_32 (hex_to_u32 (&salt_pos[ 8])); + salt->salt_buf[2] = byte_swap_32 (hex_to_u32 (&salt_pos[16])); + salt->salt_buf[3] = byte_swap_32 (hex_to_u32 (&salt_pos[24])); + salt->salt_buf[4] = byte_swap_32 (hex_to_u32 (&salt_pos[32])); + salt->salt_buf[5] = byte_swap_32 (hex_to_u32 (&salt_pos[40])); + salt->salt_buf[6] = byte_swap_32 (hex_to_u32 (&salt_pos[48])); + salt->salt_buf[7] = byte_swap_32 (hex_to_u32 (&salt_pos[56])); salt->salt_len = 32; @@ -221,7 +221,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 0, j = 0; i < 32; i += 1, j+= 8) { - encdatavault->keychain[i] = byte_swap_32 (hex_to_u32 ((const u8 *) &keychain_pos[j])); + encdatavault->keychain[i] = byte_swap_32 (hex_to_u32 (&keychain_pos[j])); } // hash diff --git a/src/modules/module_29930.c b/src/modules/module_29930.c index bf467b029..d29e9bcfe 100644 --- a/src/modules/module_29930.c +++ b/src/modules/module_29930.c @@ -149,15 +149,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *iv_pos = token.buf[3]; - encdatavault->iv[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[0])); - encdatavault->iv[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[8])); + encdatavault->iv[0] = byte_swap_32 (hex_to_u32 (&iv_pos[0])); + encdatavault->iv[1] = byte_swap_32 (hex_to_u32 (&iv_pos[8])); // ct const u8 *ct_pos = token.buf[4]; - encdatavault->ct[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[0])); - encdatavault->ct[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[8])); + encdatavault->ct[0] = byte_swap_32 (hex_to_u32 (&ct_pos[0])); + encdatavault->ct[1] = byte_swap_32 (hex_to_u32 (&ct_pos[8])); // salt fixed diff --git a/src/modules/module_29940.c b/src/modules/module_29940.c index 5cdca974e..be5522352 100644 --- a/src/modules/module_29940.c +++ b/src/modules/module_29940.c @@ -154,15 +154,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *iv_pos = token.buf[3]; - encdatavault->iv[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[0])); - encdatavault->iv[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &iv_pos[8])); + encdatavault->iv[0] = byte_swap_32 (hex_to_u32 (&iv_pos[0])); + encdatavault->iv[1] = byte_swap_32 (hex_to_u32 (&iv_pos[8])); // ct const u8 *ct_pos = token.buf[4]; - encdatavault->ct[0] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[0])); - encdatavault->ct[1] = byte_swap_32 (hex_to_u32 ((const u8 *) &ct_pos[8])); + encdatavault->ct[0] = byte_swap_32 (hex_to_u32 (&ct_pos[0])); + encdatavault->ct[1] = byte_swap_32 (hex_to_u32 (&ct_pos[8])); // keychain @@ -170,7 +170,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE for (int i = 0, j = 0; i < 32; i += 1, j+= 8) { - encdatavault->keychain[i] = byte_swap_32 (hex_to_u32 ((const u8 *) &keychain_pos[j])); + encdatavault->keychain[i] = byte_swap_32 (hex_to_u32 (&keychain_pos[j])); } // salt fixed diff --git a/src/modules/module_30600.c b/src/modules/module_30600.c index 6ce51b72d..2af2eecd4 100644 --- a/src/modules/module_30600.c +++ b/src/modules/module_30600.c @@ -220,7 +220,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - base64_decode (bf64_to_int, (const u8 *) salt_pos, salt_len, tmp_buf); + base64_decode (bf64_to_int, salt_pos, salt_len, tmp_buf); memcpy (salt_buf_ptr, tmp_buf, 16); @@ -231,7 +231,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (tmp_buf, 0, sizeof (tmp_buf)); - base64_decode (bf64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); + base64_decode (bf64_to_int, hash_pos, hash_len, tmp_buf); memcpy (digest, tmp_buf, 24); diff --git a/src/modules/module_31700.c b/src/modules/module_31700.c index a99bdc663..1bdb6161a 100644 --- a/src/modules/module_31700.c +++ b/src/modules/module_31700.c @@ -120,11 +120,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE digest[3] -= MD5M_D; } - const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_double_salt->salt1_buf, (int *) &md5_double_salt->salt1_len); + const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_double_salt->salt1_buf, &md5_double_salt->salt1_len); if (parse_rc1 == false) return (PARSER_SALT_LENGTH); - const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_double_salt->salt2_buf, (int *) &md5_double_salt->salt2_len); + const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_double_salt->salt2_buf, &md5_double_salt->salt2_len); if (parse_rc2 == false) return (PARSER_SALT_LENGTH); @@ -184,13 +184,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt1_buf, (const int) md5_double_salt->salt1_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt1_buf, md5_double_salt->salt1_len, out_buf + out_len); out_buf[out_len] = hashconfig->separator; out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt2_buf, (const int) md5_double_salt->salt2_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) md5_double_salt->salt2_buf, md5_double_salt->salt2_len, out_buf + out_len); return out_len; } diff --git a/src/modules/module_31800.c b/src/modules/module_31800.c index 459b0d9b2..8a91a90e7 100644 --- a/src/modules/module_31800.c +++ b/src/modules/module_31800.c @@ -341,7 +341,7 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // final - int out_len = snprintf ((char *) line_buf, line_size, "%s%s$%08x%08x%08x%08x%08x%08x%08x%08x$%08x%08x%08x%08x%08x%08x%08x%08x$%u$%s$%s$%08x%08x%08x%08x", + int out_len = snprintf (line_buf, line_size, "%s%s$%08x%08x%08x%08x%08x%08x%08x%08x$%08x%08x%08x%08x%08x%08x%08x%08x$%u$%s$%s$%08x%08x%08x%08x", SIGNATURE_1PASSWORD8, (const char *) onepassword8->email_buf, onepassword8->hkdf_salt_buf[0], diff --git a/src/modules/module_32300.c b/src/modules/module_32300.c index b78ce31bf..3c0462e72 100644 --- a/src/modules/module_32300.c +++ b/src/modules/module_32300.c @@ -129,11 +129,11 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE memset (md5_triple_salt, 0, sizeof (md5_triple_salt_t)); - const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_triple_salt->salt1_buf, (int *) &md5_triple_salt->salt1_len); + const bool parse_rc1 = generic_salt_decode (hashconfig, token.buf[1], token.len[1], (u8 *) md5_triple_salt->salt1_buf, &md5_triple_salt->salt1_len); if (parse_rc1 == false) return (PARSER_SALT_LENGTH); - const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_triple_salt->salt2_buf, (int *) &md5_triple_salt->salt2_len); + const bool parse_rc2 = generic_salt_decode (hashconfig, token.buf[2], token.len[2], (u8 *) md5_triple_salt->salt2_buf, &md5_triple_salt->salt2_len); if (parse_rc2 == false) return (PARSER_SALT_LENGTH); @@ -206,13 +206,13 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) md5_triple_salt->salt1_buf, (const int) md5_triple_salt->salt1_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) md5_triple_salt->salt1_buf, md5_triple_salt->salt1_len, out_buf + out_len); out_buf[out_len] = hashconfig->separator; out_len += 1; - out_len += generic_salt_encode (hashconfig, (const u8 *) md5_triple_salt->salt2_buf, (const int) md5_triple_salt->salt2_len, out_buf + out_len); + out_len += generic_salt_encode (hashconfig, (const u8 *) md5_triple_salt->salt2_buf, md5_triple_salt->salt2_len, out_buf + out_len); out_len -= 17; // remove empire_salt1 diff --git a/src/modules/module_32500.c b/src/modules/module_32500.c index f99791b28..74ae3b144 100644 --- a/src/modules/module_32500.c +++ b/src/modules/module_32500.c @@ -131,7 +131,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE u8 tmp_buf[256] = { 0 }; - int tmp_len = base64_decode (base64_to_int, (const u8 *) data_pos, data_len, tmp_buf); + int tmp_len = base64_decode (base64_to_int, data_pos, data_len, tmp_buf); memcpy (payload->pl_buf, tmp_buf, tmp_len);