Get rid of hash_mode in user_options.c

This commit is contained in:
jsteube
2018-12-19 10:13:51 +01:00
parent e56c5035aa
commit ea22065b9c
7 changed files with 34 additions and 33 deletions
+9
View File
@@ -868,6 +868,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->esalt_size = default_esalt_size (hashconfig, user_options, user_options_extra);
hashconfig->forced_kernel_threads = default_forced_kernel_threads (hashconfig, user_options, user_options_extra);
hashconfig->forced_kernel_loops = default_forced_kernel_loops (hashconfig, user_options, user_options_extra);
hashconfig->forced_outfile_format = default_forced_outfile_format (hashconfig, user_options, user_options_extra);
hashconfig->hash_name = default_hash_name (hashconfig, user_options, user_options_extra);
hashconfig->hash_mode = default_hash_mode (hashconfig, user_options, user_options_extra);
hashconfig->hash_type = default_hash_type (hashconfig, user_options, user_options_extra);
@@ -899,6 +900,7 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
if (module_ctx->module_esalt_size) hashconfig->esalt_size = module_ctx->module_esalt_size (hashconfig, user_options, user_options_extra);
if (module_ctx->module_forced_kernel_threads) hashconfig->forced_kernel_threads = module_ctx->module_forced_kernel_threads (hashconfig, user_options, user_options_extra);
if (module_ctx->module_forced_kernel_loops) hashconfig->forced_kernel_loops = module_ctx->module_forced_kernel_loops (hashconfig, user_options, user_options_extra);
if (module_ctx->module_forced_outfile_format) hashconfig->forced_outfile_format = module_ctx->module_forced_outfile_format (hashconfig, user_options, user_options_extra);
if (module_ctx->module_hash_name) hashconfig->hash_name = module_ctx->module_hash_name (hashconfig, user_options, user_options_extra);
if (module_ctx->module_hash_mode) hashconfig->hash_mode = module_ctx->module_hash_mode (hashconfig, user_options, user_options_extra);
if (module_ctx->module_hash_type) hashconfig->hash_type = module_ctx->module_hash_type (hashconfig, user_options, user_options_extra);
@@ -1862,6 +1864,13 @@ u32 default_forced_kernel_loops (MAYBE_UNUSED const hashconfig_t *hashconfig, MA
return forced_kernel_loops;
}
u32 default_forced_outfile_format (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 u32 forced_outfile_format = user_options->outfile_format;
return forced_outfile_format;
}
u32 default_salt_type (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 u32 salt_type = SALT_TYPE_NONE;
+20
View File
@@ -28167,3 +28167,23 @@ bool default_hlfmt_disable (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_U
}
u32 default_forced_outfile_format
{
if (user_options->hash_mode == 9710)
{
user_options->outfile_format = 5;
}
if (user_options->hash_mode == 9810)
{
user_options->outfile_format = 5;
}
if (user_options->hash_mode == 10410)
{
user_options->outfile_format = 5;
}
}
-33
View File
@@ -621,21 +621,6 @@ int user_options_sanity (hashcat_ctx_t *hashcat_ctx)
return -1;
}
if (user_options->username == true)
{
if ((user_options->hash_mode == 2500)
|| (user_options->hash_mode == 2501)
|| (user_options->hash_mode == 5200)
|| ((user_options->hash_mode >= 6200) && (user_options->hash_mode <= 6299))
|| ((user_options->hash_mode >= 13700) && (user_options->hash_mode <= 13799))
|| (user_options->hash_mode == 9000))
{
event_log_error (hashcat_ctx, "Combining --username with targets of hash-mode %u is not supported.", user_options->hash_mode);
return -1;
}
}
if (user_options->outfile_format > 16)
{
event_log_error (hashcat_ctx, "Invalid --outfile-format value specified.");
@@ -1591,24 +1576,6 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
user_options->limit += user_options->skip;
}
if (user_options->hash_mode == 9710)
{
user_options->outfile_format = 5;
user_options->outfile_format_chgd = 1;
}
if (user_options->hash_mode == 9810)
{
user_options->outfile_format = 5;
user_options->outfile_format_chgd = 1;
}
if (user_options->hash_mode == 10410)
{
user_options->outfile_format = 5;
user_options->outfile_format_chgd = 1;
}
if (user_options->markov_threshold == 0)
{
user_options->markov_threshold = 0x100;