From 08a3fc2bb30e9cd662d13eac70c10f0a596b5df0 Mon Sep 17 00:00:00 2001 From: jsteube Date: Tue, 18 Jul 2017 20:32:56 +0200 Subject: [PATCH] Enable automatic fallback to optimized kernel if pure kernel is not found --- src/interface.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/interface.c b/src/interface.c index 24fa038ba..10bb228f9 100644 --- a/src/interface.c +++ b/src/interface.c @@ -24302,7 +24302,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) { char source_file[256] = { 0 }; - generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, user_options->optimized_kernel_enable, folder_config->shared_dir, source_file); + generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, true, folder_config->shared_dir, source_file); if (hc_path_read (source_file) == false) { @@ -24313,6 +24313,23 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx) hashconfig->opti_type |= OPTI_TYPE_OPTIMIZED_KERNEL; } } + else + { + char source_file[256] = { 0 }; + + generate_source_kernel_filename (hashconfig->attack_exec, user_options_extra->attack_kern, hashconfig->kern_type, false, folder_config->shared_dir, source_file); + + if (hc_path_read (source_file) == false) + { + if (user_options->quiet == false) event_log_warning (hashcat_ctx, "%s: Pure kernel not found, falling back to optimized kernel", source_file); + + hashconfig->opti_type |= OPTI_TYPE_OPTIMIZED_KERNEL; + } + else + { + // nothing to do + } + } if ((hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL) == 0) {