diff --git a/.gitignore b/.gitignore index cf5366dd1..054a2fe17 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ lib/*.a modules/*.dll modules/*.so obj/*.o +obj/*.a include/CL diff --git a/OpenCL/m02500-pure.cl b/OpenCL/m02500-pure.cl index 9c8781142..30609d31a 100644 --- a/OpenCL/m02500-pure.cl +++ b/OpenCL/m02500-pure.cl @@ -291,7 +291,6 @@ KERNEL_FQ void m02500_comp (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t) KERNEL_FQ void m02500_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)) { const u64 gid = get_global_id (0); - const u64 lid = get_local_id (0); if (gid >= gid_max) return; @@ -602,7 +601,6 @@ KERNEL_FQ void m02500_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t) KERNEL_FQ void m02500_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)) { const u64 gid = get_global_id (0); - const u64 lid = get_local_id (0); if (gid >= gid_max) return; @@ -912,21 +910,14 @@ KERNEL_FQ void m02500_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t) KERNEL_FQ void m02500_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t)) { - const u64 gid = get_global_id (0); - const u64 lid = get_local_id (0); - const u64 lsz = get_local_size (0); - /** * aes shared */ #ifdef REAL_SHM - LOCAL_AS u32 s_td0[256]; - LOCAL_AS u32 s_td1[256]; - LOCAL_AS u32 s_td2[256]; - LOCAL_AS u32 s_td3[256]; - LOCAL_AS u32 s_td4[256]; + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); LOCAL_AS u32 s_te0[256]; LOCAL_AS u32 s_te1[256]; @@ -936,12 +927,6 @@ KERNEL_FQ void m02500_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t) for (u32 i = lid; i < 256; i += lsz) { - s_td0[i] = td0[i]; - s_td1[i] = td1[i]; - s_td2[i] = td2[i]; - s_td3[i] = td3[i]; - s_td4[i] = td4[i]; - s_te0[i] = te0[i]; s_te1[i] = te1[i]; s_te2[i] = te2[i]; @@ -953,12 +938,6 @@ KERNEL_FQ void m02500_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t) #else - CONSTANT_AS u32a *s_td0 = td0; - CONSTANT_AS u32a *s_td1 = td1; - CONSTANT_AS u32a *s_td2 = td2; - CONSTANT_AS u32a *s_td3 = td3; - CONSTANT_AS u32a *s_td4 = td4; - CONSTANT_AS u32a *s_te0 = te0; CONSTANT_AS u32a *s_te1 = te1; CONSTANT_AS u32a *s_te2 = te2; @@ -967,6 +946,8 @@ KERNEL_FQ void m02500_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_eapol_t) #endif + const u64 gid = get_global_id (0); + if (gid >= gid_max) return; u32 out[8]; diff --git a/OpenCL/m02501-pure.cl b/OpenCL/m02501-pure.cl index 59230ee8e..8a774d0da 100644 --- a/OpenCL/m02501-pure.cl +++ b/OpenCL/m02501-pure.cl @@ -161,7 +161,6 @@ KERNEL_FQ void m02501_comp (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)) KERNEL_FQ void m02501_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)) { const u64 gid = get_global_id (0); - const u64 lid = get_local_id (0); if (gid >= gid_max) return; @@ -472,7 +471,6 @@ KERNEL_FQ void m02501_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)) KERNEL_FQ void m02501_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)) { const u64 gid = get_global_id (0); - const u64 lid = get_local_id (0); if (gid >= gid_max) return; @@ -782,21 +780,14 @@ KERNEL_FQ void m02501_aux2 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)) KERNEL_FQ void m02501_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)) { - const u64 gid = get_global_id (0); - const u64 lid = get_local_id (0); - const u64 lsz = get_local_size (0); - /** * aes shared */ #ifdef REAL_SHM - LOCAL_AS u32 s_td0[256]; - LOCAL_AS u32 s_td1[256]; - LOCAL_AS u32 s_td2[256]; - LOCAL_AS u32 s_td3[256]; - LOCAL_AS u32 s_td4[256]; + const u64 lid = get_local_id (0); + const u64 lsz = get_local_size (0); LOCAL_AS u32 s_te0[256]; LOCAL_AS u32 s_te1[256]; @@ -806,12 +797,6 @@ KERNEL_FQ void m02501_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)) for (u32 i = lid; i < 256; i += lsz) { - s_td0[i] = td0[i]; - s_td1[i] = td1[i]; - s_td2[i] = td2[i]; - s_td3[i] = td3[i]; - s_td4[i] = td4[i]; - s_te0[i] = te0[i]; s_te1[i] = te1[i]; s_te2[i] = te2[i]; @@ -823,12 +808,6 @@ KERNEL_FQ void m02501_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)) #else - CONSTANT_AS u32a *s_td0 = td0; - CONSTANT_AS u32a *s_td1 = td1; - CONSTANT_AS u32a *s_td2 = td2; - CONSTANT_AS u32a *s_td3 = td3; - CONSTANT_AS u32a *s_td4 = td4; - CONSTANT_AS u32a *s_te0 = te0; CONSTANT_AS u32a *s_te1 = te1; CONSTANT_AS u32a *s_te2 = te2; @@ -837,6 +816,8 @@ KERNEL_FQ void m02501_aux3 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_eapol_t)) #endif + const u64 gid = get_global_id (0); + if (gid >= gid_max) return; u32 out[8]; diff --git a/OpenCL/m16800-pure.cl b/OpenCL/m16800-pure.cl index 7b75da591..0d476ccd6 100644 --- a/OpenCL/m16800-pure.cl +++ b/OpenCL/m16800-pure.cl @@ -244,7 +244,6 @@ KERNEL_FQ void m16800_comp (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_pmkid_t) KERNEL_FQ void m16800_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pbkdf2_tmp_t, wpa_pmkid_t)) { const u64 gid = get_global_id (0); - const u64 lid = get_local_id (0); if (gid >= gid_max) return; diff --git a/OpenCL/m16801-pure.cl b/OpenCL/m16801-pure.cl index 71278311e..ee8349adf 100644 --- a/OpenCL/m16801-pure.cl +++ b/OpenCL/m16801-pure.cl @@ -117,7 +117,6 @@ KERNEL_FQ void m16801_comp (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_pmkid_t)) KERNEL_FQ void m16801_aux1 (KERN_ATTR_TMPS_ESALT (wpa_pmk_tmp_t, wpa_pmkid_t)) { const u64 gid = get_global_id (0); - const u64 lid = get_local_id (0); if (gid >= gid_max) return; diff --git a/src/benchmark.c b/src/benchmark.c index bc11706da..92b0fcd44 100644 --- a/src/benchmark.c +++ b/src/benchmark.c @@ -43,7 +43,6 @@ static const int DEFAULT_BENCHMARK_ALGORITHMS_BUF[] = int benchmark_next (hashcat_ctx_t *hashcat_ctx) { const folder_config_t *folder_config = hashcat_ctx->folder_config; - const module_ctx_t *module_ctx = hashcat_ctx->module_ctx; const user_options_t *user_options = hashcat_ctx->user_options; static int cur = 0; diff --git a/src/hashes.c b/src/hashes.c index c1d3afaf8..3b1aeb50a 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -1319,10 +1319,9 @@ int hashes_init_stage1 (hashcat_ctx_t *hashcat_ctx) int hashes_init_stage2 (hashcat_ctx_t *hashcat_ctx) { - hashconfig_t *hashconfig = hashcat_ctx->hashconfig; - hashes_t *hashes = hashcat_ctx->hashes; - user_options_t *user_options = hashcat_ctx->user_options; - potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx; + const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + hashes_t *hashes = hashcat_ctx->hashes; + const user_options_t *user_options = hashcat_ctx->user_options; hash_t *hashes_buf = hashes->hashes_buf; u32 hashes_cnt = hashes->hashes_cnt; @@ -1838,8 +1837,6 @@ int hashes_init_benchmark (hashcat_ctx_t *hashcat_ctx) if (hashconfig->is_salted == false) return 0; - hash_t *hashes_buf = hashes->hashes_buf; - if (module_ctx->module_benchmark_salt != MODULE_DEFAULT) { salt_t *ptr = module_ctx->module_benchmark_salt (hashconfig, user_options, user_options_extra); diff --git a/src/interface.c b/src/interface.c index 34e0b3923..e8d396cd4 100644 --- a/src/interface.c +++ b/src/interface.c @@ -680,8 +680,6 @@ u32 default_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED co u32 default_salt_min (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { - const bool optimized_kernel = (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL); - // salt_min : this limit is only interessting for generic hash types that support a salt u32 salt_min = SALT_MIN; diff --git a/src/modules/module_00501.c b/src/modules/module_00501.c index bb6f19ff2..1e5935523 100644 --- a/src/modules/module_00501.c +++ b/src/modules/module_00501.c @@ -189,6 +189,7 @@ static void md5crypt_decode (u8 digest[16], const u8 buf[22]) digest[11] = (l >> 0) & 0xff; } +/* uses OPTS_TYPE_HASH_COPY static void md5crypt_encode (const u8 digest[16], u8 buf[22]) { int l; @@ -233,6 +234,7 @@ static void md5crypt_encode (const u8 digest[16], u8 buf[22]) buf[20] = int_to_itoa64 (l & 0x3f); l >>= 6; buf[21] = int_to_itoa64 (l & 0x3f); //l >>= 6; } +*/ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { diff --git a/src/modules/module_02100.c b/src/modules/module_02100.c index ebfe8431d..8c7a40a2f 100644 --- a/src/modules/module_02100.c +++ b/src/modules/module_02100.c @@ -142,8 +142,6 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE line_len += snprintf (line_buf + line_len, line_size - line_len, "%s%u#", SIGNATURE_DCC2, salt->salt_iter + 1); - char *salt_ptr = (char *) salt->salt_buf; - line_len += generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) line_buf + line_len); line_len += snprintf (line_buf + line_len, line_size - line_len, "#%08x%08x%08x%08x", diff --git a/src/modules/module_02500.c b/src/modules/module_02500.c index f1d2d8c9c..98771acc9 100644 --- a/src/modules/module_02500.c +++ b/src/modules/module_02500.c @@ -194,6 +194,7 @@ static void to_hccapx_t (const hashes_t *hashes, hccapx_t *hccapx, const u32 sal } } +/* static int check_old_hccap (const char *hashfile) { FILE *fp = fopen (hashfile, "rb"); @@ -212,6 +213,7 @@ static int check_old_hccap (const char *hashfile) return 1; } +*/ const char *module_benchmark_mask (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { diff --git a/src/modules/module_02501.c b/src/modules/module_02501.c index 3f806f8dc..badc70562 100644 --- a/src/modules/module_02501.c +++ b/src/modules/module_02501.c @@ -191,6 +191,7 @@ static void to_hccapx_t (const hashes_t *hashes, hccapx_t *hccapx, const u32 sal } } +/* static int check_old_hccap (const char *hashfile) { FILE *fp = fopen (hashfile, "rb"); @@ -209,6 +210,7 @@ static int check_old_hccap (const char *hashfile) return 1; } +*/ const char *module_benchmark_mask (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { diff --git a/src/modules/module_07500.c b/src/modules/module_07500.c index 6d0946785..cbc49cacf 100644 --- a/src/modules/module_07500.c +++ b/src/modules/module_07500.c @@ -206,8 +206,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const krb5pa_t *krb5pa = (const krb5pa_t *) esalt_buf; u8 *ptr_timestamp = (u8 *) krb5pa->timestamp; diff --git a/src/modules/module_08900.c b/src/modules/module_08900.c index 80fb34959..2ddf639f5 100644 --- a/src/modules/module_08900.c +++ b/src/modules/module_08900.c @@ -364,8 +364,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - char base64_salt[32] = { 0 }; base64_encode (int_to_base64, (const u8 *) salt->salt_buf, salt->salt_len, (u8 *) base64_salt); diff --git a/src/modules/module_09100.c b/src/modules/module_09100.c index 7b47a6676..52cc23b34 100644 --- a/src/modules/module_09100.c +++ b/src/modules/module_09100.c @@ -60,8 +60,6 @@ u64 module_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED c u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { - const bool optimized_kernel = (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL); - u32 pw_max = 64; // https://www.ibm.com/support/knowledgecenter/en/SSKTWP_8.5.3/com.ibm.notes85.client.doc/fram_limits_of_notes_r.html return pw_max; diff --git a/src/modules/module_09820.c b/src/modules/module_09820.c index fed419d76..ef7b547a3 100644 --- a/src/modules/module_09820.c +++ b/src/modules/module_09820.c @@ -56,7 +56,7 @@ typedef struct oldoffice34 static const char *SIGNATURE_OLDOFFICE = "$oldoffice$"; static const char *SIGNATURE_OLDOFFICE3 = "$oldoffice$3"; -static const char *SIGNATURE_OLDOFFICE4 = "$oldoffice$4"; +//static const char *SIGNATURE_OLDOFFICE4 = "$oldoffice$4"; u64 module_esalt_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { diff --git a/src/modules/module_11300.c b/src/modules/module_11300.c index f3a1945f1..2754d7596 100644 --- a/src/modules/module_11300.c +++ b/src/modules/module_11300.c @@ -194,9 +194,7 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE const u8 *cry_salt_buf_pos = token.buf[4]; const u8 *cry_rounds_pos = token.buf[5]; const u8 *ckey_len_pos = token.buf[6]; - const u8 *ckey_buf_pos = token.buf[7]; const u8 *public_key_len_pos = token.buf[8]; - const u8 *public_key_buf_pos = token.buf[9]; const int cry_master_buf_len = token.len[2]; const int cry_salt_buf_len = token.len[4]; diff --git a/src/modules/module_13100.c b/src/modules/module_13100.c index aaad85098..526d73d1a 100644 --- a/src/modules/module_13100.c +++ b/src/modules/module_13100.c @@ -221,8 +221,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const krb5tgs_t *krb5tgs = (const krb5tgs_t *) esalt_buf; char data[5120 * 4 * 2] = { 0 }; diff --git a/src/modules/module_13200.c b/src/modules/module_13200.c index 825b552de..ae56ceb7f 100644 --- a/src/modules/module_13200.c +++ b/src/modules/module_13200.c @@ -162,8 +162,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const int line_len = snprintf (line_buf, line_size, "%s*1*%u*%08x%08x%08x%08x*%08x%08x%08x%08x%08x%08x", SIGNATURE_AXCRYPT, salt->salt_iter, diff --git a/src/modules/module_13600.c b/src/modules/module_13600.c index 60528e366..2133a40b4 100644 --- a/src/modules/module_13600.c +++ b/src/modules/module_13600.c @@ -336,8 +336,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const zip2_t *zip2 = (const zip2_t *) esalt_buf; const u32 salt_len = zip2->salt_len; diff --git a/src/modules/module_14000.c b/src/modules/module_14000.c index 240c9f10f..918d89b2b 100644 --- a/src/modules/module_14000.c +++ b/src/modules/module_14000.c @@ -134,7 +134,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt const u8 *salt_pos = token.buf[1]; - const int salt_len = token.len[1]; salt->salt_buf[0] = hex_to_u32 (salt_pos + 0); salt->salt_buf[1] = hex_to_u32 (salt_pos + 8); diff --git a/src/modules/module_14100.c b/src/modules/module_14100.c index 2d21cac0c..86b56ba6f 100644 --- a/src/modules/module_14100.c +++ b/src/modules/module_14100.c @@ -145,7 +145,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE // salt const u8 *salt_pos = token.buf[1]; - const int salt_len = token.len[1]; salt->salt_buf[0] = hex_to_u32 (salt_pos + 0); salt->salt_buf[1] = hex_to_u32 (salt_pos + 8); diff --git a/src/modules/module_14700.c b/src/modules/module_14700.c index 4ac72076f..76dbeaacc 100644 --- a/src/modules/module_14700.c +++ b/src/modules/module_14700.c @@ -267,13 +267,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE dpsl_buf_ptr[4] = byte_swap_32 (dpsl_buf_ptr[ 4]); } + digest[0] = itunes_backup->dpsl[0] ^ itunes_backup->wpky[0]; + digest[1] = itunes_backup->dpsl[1] ^ itunes_backup->wpky[1]; + digest[2] = itunes_backup->dpsl[2] ^ itunes_backup->wpky[2]; + digest[3] = itunes_backup->dpsl[3] ^ itunes_backup->wpky[3]; + return (PARSER_OK); } int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const itunes_backup_t *itunes_backup = (const itunes_backup_t *) esalt_buf; // WPKY diff --git a/src/modules/module_14800.c b/src/modules/module_14800.c index 172930a16..56e48cd3d 100644 --- a/src/modules/module_14800.c +++ b/src/modules/module_14800.c @@ -281,13 +281,16 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE dpsl_buf_ptr[4] = byte_swap_32 (dpsl_buf_ptr[ 4]); } + digest[0] = itunes_backup->dpsl[0] ^ itunes_backup->wpky[0]; + digest[1] = itunes_backup->dpsl[1] ^ itunes_backup->wpky[1]; + digest[2] = itunes_backup->dpsl[2] ^ itunes_backup->wpky[2]; + digest[3] = itunes_backup->dpsl[3] ^ itunes_backup->wpky[3]; + return (PARSER_OK); } int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const itunes_backup_t *itunes_backup = (const itunes_backup_t *) esalt_buf; // WPKY diff --git a/src/modules/module_15300.c b/src/modules/module_15300.c index 71fe58ebc..6aafd33e4 100644 --- a/src/modules/module_15300.c +++ b/src/modules/module_15300.c @@ -278,8 +278,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const dpapimk_t *dpapimk = (const dpapimk_t *) esalt_buf; u32 version = 1; diff --git a/src/modules/module_15700.c b/src/modules/module_15700.c index 753e2995d..643689fde 100644 --- a/src/modules/module_15700.c +++ b/src/modules/module_15700.c @@ -424,8 +424,6 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE { const u32 *digest = (const u32 *) digest_buf; - char *salt_ptr = (char *) salt->salt_buf; - char tmp_salt[SALT_MAX * 2]; const int salt_len = generic_salt_encode (hashconfig, (const u8 *) salt->salt_buf, (const int) salt->salt_len, (u8 *) tmp_salt); diff --git a/src/modules/module_15900.c b/src/modules/module_15900.c index 10ab07809..8c53f405a 100644 --- a/src/modules/module_15900.c +++ b/src/modules/module_15900.c @@ -290,8 +290,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const dpapimk_t *dpapimk = (const dpapimk_t *) esalt_buf; u32 version = 2; diff --git a/src/modules/module_18200.c b/src/modules/module_18200.c index 779c55e2f..1b8ac97a5 100644 --- a/src/modules/module_18200.c +++ b/src/modules/module_18200.c @@ -185,8 +185,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const krb5asrep_t *krb5asrep = (const krb5asrep_t *) esalt_buf; char data[5120 * 4 * 2] = { 0 }; diff --git a/src/modules/module_18900.c b/src/modules/module_18900.c index 5a813fdf0..25ab4f7cb 100644 --- a/src/modules/module_18900.c +++ b/src/modules/module_18900.c @@ -245,8 +245,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const android_backup_t *android_backup = (const android_backup_t *) esalt_buf; int line_len = 0; diff --git a/src/modules/module_19300.c b/src/modules/module_19300.c index 7ce665392..96afd99ba 100644 --- a/src/modules/module_19300.c +++ b/src/modules/module_19300.c @@ -115,9 +115,6 @@ 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 u8 *salt_pos = token.buf[1]; - const int salt_len = token.len[1]; - 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); if (parse_rc1 == false) return (PARSER_SALT_LENGTH); diff --git a/src/modules/module_19500.c b/src/modules/module_19500.c index f26628b9e..376dcd28e 100644 --- a/src/modules/module_19500.c +++ b/src/modules/module_19500.c @@ -126,9 +126,6 @@ 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 u8 *salt_pos = token.buf[1]; - const int salt_len = token.len[1]; - 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); if (parse_rc1 == false) return (PARSER_SALT_LENGTH); diff --git a/src/modules/module_19600.c b/src/modules/module_19600.c index 232a3bc4b..f1d91a1db 100644 --- a/src/modules/module_19600.c +++ b/src/modules/module_19600.c @@ -254,8 +254,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const krb5tgs_17_t *krb5tgs = (const krb5tgs_17_t *) esalt_buf; char data[5120 * 4 * 2] = { 0 }; diff --git a/src/modules/module_19700.c b/src/modules/module_19700.c index fabdefbdd..cb1ff902e 100644 --- a/src/modules/module_19700.c +++ b/src/modules/module_19700.c @@ -254,8 +254,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const u32 *digest = (const u32 *) digest_buf; - const krb5tgs_18_t *krb5tgs = (const krb5tgs_18_t *) esalt_buf; char data[5120 * 4 * 2] = { 0 }; diff --git a/src/modules/module_99999.c b/src/modules/module_99999.c index 5cbb35dfe..77787a13e 100644 --- a/src/modules/module_99999.c +++ b/src/modules/module_99999.c @@ -87,8 +87,6 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE md4_update (&ctx, w, pw_len); md4_final (&ctx); - u32 dgst[4]; - digest[0] = ctx.h[0]; digest[1] = ctx.h[1]; digest[2] = ctx.h[2]; diff --git a/src/outfile.c b/src/outfile.c index 9ee259fb1..a7abbce00 100644 --- a/src/outfile.c +++ b/src/outfile.c @@ -18,13 +18,12 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, plain_t *plain, u32 *plain_buf, int *out_len) { - const combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx; - const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; - const hashes_t *hashes = hashcat_ctx->hashes; - const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx; - const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx; - const user_options_t *user_options = hashcat_ctx->user_options; - const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra; + const combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx; + const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + const hashes_t *hashes = hashcat_ctx->hashes; + const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx; + const straight_ctx_t *straight_ctx = hashcat_ctx->straight_ctx; + const user_options_t *user_options = hashcat_ctx->user_options; const u64 gidvid = plain->gidvid; const u32 il_pos = plain->il_pos; diff --git a/src/outfile_check.c b/src/outfile_check.c index d0a4b55e0..8a4ec38c7 100644 --- a/src/outfile_check.c +++ b/src/outfile_check.c @@ -30,11 +30,9 @@ static int outfile_remove (hashcat_ctx_t *hashcat_ctx) status_ctx_t *status_ctx = hashcat_ctx->status_ctx; user_options_t *user_options = hashcat_ctx->user_options; - size_t dgst_size = hashconfig->dgst_size; - bool is_salted = hashconfig->is_salted; - size_t esalt_size = hashconfig->esalt_size; - size_t hook_salt_size = hashconfig->hook_salt_size; - char separator = hashconfig->separator; + const size_t dgst_size = hashconfig->dgst_size; + const bool is_salted = hashconfig->is_salted; + const char separator = hashconfig->separator; salt_t *salts_buf = hashes->salts_buf; const u32 salts_cnt = hashes->salts_cnt; @@ -203,10 +201,6 @@ static int outfile_remove (hashcat_ctx_t *hashcat_ctx) if (last_separator == NULL) break; - char *line_pw_buf = last_separator + 1; - - size_t line_pw_len = line_buf + line_len - line_pw_buf; - char *line_hash_buf = line_buf; int line_hash_len = last_separator - line_buf; diff --git a/src/potfile.c b/src/potfile.c index ec8351450..c6ff47273 100644 --- a/src/potfile.c +++ b/src/potfile.c @@ -25,6 +25,7 @@ int sort_by_hash_no_salt (const void *v1, const void *v2, void *v3); // this function is for potfile comparison where the potfile does not contain all the // information requires to do a true sort_by_hash() bsearch +/* static int sort_by_hash_t_salt (const void *v1, const void *v2) { const hash_t *h1 = (const hash_t *) v1; @@ -55,6 +56,7 @@ static int sort_by_hash_t_salt (const void *v1, const void *v2) return 0; } +*/ // this function is special and only used whenever --username and --show are used together: // it will sort all tree entries according to the settings stored in hashconfig @@ -372,7 +374,6 @@ int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx) const hashes_t *hashes = hashcat_ctx->hashes; const module_ctx_t *module_ctx = hashcat_ctx->module_ctx; const potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx; - const user_options_t *user_options = hashcat_ctx->user_options; if (potfile_ctx->enabled == false) return 0; diff --git a/src/shared.c b/src/shared.c index b06992862..d034d87dc 100644 --- a/src/shared.c +++ b/src/shared.c @@ -54,8 +54,6 @@ static const char *PA_255 = "Unknown error"; static const char *OPTI_STR_OPTIMIZED_KERNEL = "Optimized-Kernel"; static const char *OPTI_STR_ZERO_BYTE = "Zero-Byte"; static const char *OPTI_STR_PRECOMPUTE_INIT = "Precompute-Init"; -static const char *OPTI_STR_PRECOMPUTE_MERKLE = "Precompute-Merkle-Demgard"; -static const char *OPTI_STR_PRECOMPUTE_PERMUT = "Precompute-Final-Permutation"; static const char *OPTI_STR_MEET_IN_MIDDLE = "Meet-In-The-Middle"; static const char *OPTI_STR_EARLY_SKIP = "Early-Skip"; static const char *OPTI_STR_NOT_SALTED = "Not-Salted"; @@ -1229,8 +1227,6 @@ int generic_salt_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, const u8 * { for (int i = 0, j = 0; i < in_len; i += 1, j += 2) { - const u8 p = in_buf[i]; - u8_to_hex (in_buf[i], tmp_u8 + j); } diff --git a/src/usage.c b/src/usage.c index 1e92f2bc6..51e764819 100644 --- a/src/usage.c +++ b/src/usage.c @@ -276,10 +276,9 @@ void usage_mini_print (const char *progname) void usage_big_print (hashcat_ctx_t *hashcat_ctx) { - folder_config_t *folder_config = hashcat_ctx->folder_config; - hashconfig_t *hashconfig = hashcat_ctx->hashconfig; - module_ctx_t *module_ctx = hashcat_ctx->module_ctx; - user_options_t *user_options = hashcat_ctx->user_options; + const folder_config_t *folder_config = hashcat_ctx->folder_config; + const hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + user_options_t *user_options = hashcat_ctx->user_options; char *modulefile = (char *) hcmalloc (HCBUFSIZ_TINY);