1
mirror of https://github.com/hashcat/hashcat synced 2024-11-20 23:27:31 +01:00

Simplify use of default functions

This commit is contained in:
jsteube 2018-12-16 19:01:05 +01:00
parent ca169a890c
commit e79fa9c22f
5 changed files with 130 additions and 236 deletions

View File

@ -1731,6 +1731,7 @@ u32 default_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashco
u32 default_dgst_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);
u64 default_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);
const char *default_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 default_hash_mode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 default_hash_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);
u64 default_hook_salt_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);
u64 default_hook_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);
@ -1742,6 +1743,7 @@ u32 default_pw_max (MAYBE_UNUSED const hashconfig_t *hashco
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);
u32 default_salt_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);
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);
char default_separator (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 char *default_st_hash (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 char *default_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u64 default_tmp_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);

View File

@ -2,31 +2,33 @@
#ifndef _MODULES_H
#define _MODULES_H
u32 module_attack_exec (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 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);
u32 module_benchmark_salt_len (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_benchmark_salt_iter (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_dgst_pos1 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_dgst_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);
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);
const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_hash_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);
u64 module_hook_salt_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);
u64 module_hook_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);
u64 module_kern_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);
u32 module_opti_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);
u64 module_opts_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);
u32 module_pw_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);
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);
u32 module_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);
u32 module_salt_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);
u32 module_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 char *module_st_hash (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 char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u64 module_tmp_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);
u32 module_attack_exec (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 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);
u32 module_benchmark_salt_len (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_benchmark_salt_iter (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_dgst_pos1 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_dgst_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);
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);
const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_hash_mode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u32 module_hash_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);
u64 module_hook_salt_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);
u64 module_hook_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);
u64 module_kern_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);
u32 module_opti_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);
u64 module_opts_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);
u32 module_pw_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);
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);
u32 module_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);
u32 module_salt_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);
u32 module_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);
char module_separator (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 char *module_st_hash (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 char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
u64 module_tmp_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);
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, const char *line_buf, MAYBE_UNUSED const int line_len);
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, char *line_buf, MAYBE_UNUSED const int line_size);

View File

@ -892,10 +892,10 @@ struct hashconfig
u32 hash_type;
u32 salt_type;
u32 attack_exec;
u64 opts_type;
u32 kern_type;
u32 dgst_size;
u32 opti_type;
u64 opts_type;
u32 dgst_pos0;
u32 dgst_pos1;
u32 dgst_pos2;
@ -2215,6 +2215,7 @@ typedef struct module_ctx
u32 (*module_dgst_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
u64 (*module_esalt_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
const char *(*module_hash_name) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
u32 (*module_hash_mode) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
u32 (*module_hash_type) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
u64 (*module_hook_salt_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
u64 (*module_hook_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
@ -2226,6 +2227,7 @@ typedef struct module_ctx
u32 (*module_salt_min) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
u32 (*module_salt_max) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
u32 (*module_salt_type) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
char (*module_separator) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
const char *(*module_st_hash) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
const char *(*module_st_pass) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
u64 (*module_tmp_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);

View File

@ -35,156 +35,19 @@ static const u32 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE
static const char *ST_HASH = "b4b9b02e6f09a9bd760f388b67351e2b";
static const char *ST_PASS = "hashcat";
u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
//return default_attack_exec (hashconfig, user_options, user_options_extra);
return ATTACK_EXEC;
}
u32 module_dgst_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)
{
//return default_dgst_size (hashconfig, user_options, user_options_extra);
return DGST_SIZE;
}
const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
//return default_hash_name (hashconfig, user_options, user_options_extra);
return HASH_NAME;
}
u32 module_hash_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)
{
//return default_hash_type (hashconfig, user_options, user_options_extra);
return HASH_TYPE;
}
u64 module_kern_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)
{
//return default_kern_type (hashconfig, user_options, user_options_extra);
return KERN_TYPE;
}
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
//return default_st_hash (hashconfig, user_options, user_options_extra);
return ST_HASH;
}
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
//return default_st_pass (hashconfig, user_options, user_options_extra);
return ST_PASS;
}
u32 module_opti_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)
{
//return default_opti_type (hashconfig, user_options, user_options_extra);
return OPTI_TYPE;
}
u64 module_opts_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)
{
//return default_opts_type (hashconfig, user_options, user_options_extra);
return OPTS_TYPE;
}
u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
//return default_dgst_pos0 (hashconfig, user_options, user_options_extra);
return DGST_POS0;
}
u32 module_dgst_pos1 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
//return default_dgst_pos1 (hashconfig, user_options, user_options_extra);
return DGST_POS1;
}
u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
//return default_dgst_pos2 (hashconfig, user_options, user_options_extra);
return DGST_POS2;
}
u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
//return default_dgst_pos3 (hashconfig, user_options, user_options_extra);
return DGST_POS3;
}
u32 module_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)
{
return default_salt_type (hashconfig, user_options, user_options_extra);
}
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)
{
return default_esalt_size (hashconfig, user_options, user_options_extra);
}
u64 module_tmp_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)
{
return default_tmp_size (hashconfig, user_options, user_options_extra);
}
u64 module_hook_salt_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)
{
return default_hook_salt_size (hashconfig, user_options, user_options_extra);
}
u64 module_hook_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)
{
return default_hook_size (hashconfig, user_options, user_options_extra);
}
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)
{
return default_benchmark_mask (hashconfig, user_options, user_options_extra);
}
u32 module_benchmark_salt_len (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
return default_benchmark_salt_len (hashconfig, user_options, user_options_extra);
}
u32 module_benchmark_salt_iter (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
return default_benchmark_salt_iter (hashconfig, user_options, user_options_extra);
}
u32 module_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)
{
return default_salt_min (hashconfig, user_options, user_options_extra);
}
u32 module_salt_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)
{
return default_salt_max (hashconfig, user_options, user_options_extra);
}
u32 module_pw_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)
{
return default_pw_min (hashconfig, user_options, user_options_extra);
}
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)
{
return default_pw_max (hashconfig, user_options, user_options_extra);
}
u32 module_attack_exec (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ATTACK_EXEC; }
u32 module_dgst_pos0 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS0; }
u32 module_dgst_pos1 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS1; }
u32 module_dgst_pos2 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS2; }
u32 module_dgst_pos3 (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return DGST_POS3; }
u32 module_dgst_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) { return DGST_SIZE; }
const char *module_hash_name (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return HASH_NAME; }
u32 module_hash_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) { return HASH_TYPE; }
u64 module_kern_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) { return KERN_TYPE; }
u32 module_opti_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) { return OPTI_TYPE; }
u64 module_opts_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) { return OPTS_TYPE; }
const char *module_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_HASH; }
const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra) { return ST_PASS; }
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, const char *line_buf, MAYBE_UNUSED const int line_len)
{
@ -249,31 +112,35 @@ int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE
void module_register (module_ctx_t *module_ctx)
{
// undefined functions automatically call corresponding default functions
module_ctx->module_attack_exec = module_attack_exec;
module_ctx->module_benchmark_mask = module_benchmark_mask;
module_ctx->module_benchmark_salt_len = module_benchmark_salt_len;
module_ctx->module_benchmark_salt_iter = module_benchmark_salt_iter;
module_ctx->module_benchmark_mask = NULL;
module_ctx->module_benchmark_salt_len = NULL;
module_ctx->module_benchmark_salt_iter = NULL;
module_ctx->module_dgst_pos0 = module_dgst_pos0;
module_ctx->module_dgst_pos1 = module_dgst_pos1;
module_ctx->module_dgst_pos2 = module_dgst_pos2;
module_ctx->module_dgst_pos3 = module_dgst_pos3;
module_ctx->module_dgst_size = module_dgst_size;
module_ctx->module_esalt_size = module_esalt_size;
module_ctx->module_esalt_size = NULL;
module_ctx->module_hash_decode = module_hash_decode;
module_ctx->module_hash_encode = module_hash_encode;
module_ctx->module_hash_name = module_hash_name;
module_ctx->module_hash_mode = NULL;
module_ctx->module_hash_type = module_hash_type;
module_ctx->module_hook_salt_size = module_hook_salt_size;
module_ctx->module_hook_size = module_hook_size;
module_ctx->module_hook_salt_size = NULL;
module_ctx->module_hook_size = NULL;
module_ctx->module_kern_type = module_kern_type;
module_ctx->module_opti_type = module_opti_type;
module_ctx->module_opts_type = module_opts_type;
module_ctx->module_pw_max = module_pw_max;
module_ctx->module_pw_min = module_pw_min;
module_ctx->module_salt_max = module_salt_max;
module_ctx->module_salt_min = module_salt_min;
module_ctx->module_salt_type = module_salt_type;
module_ctx->module_pw_max = NULL;
module_ctx->module_pw_min = NULL;
module_ctx->module_salt_max = NULL;
module_ctx->module_salt_min = NULL;
module_ctx->module_salt_type = NULL;
module_ctx->module_separator = NULL;
module_ctx->module_st_hash = module_st_hash;
module_ctx->module_st_pass = module_st_pass;
module_ctx->module_tmp_size = module_tmp_size;
module_ctx->module_tmp_size = NULL;
}

View File

@ -23598,57 +23598,63 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
const user_options_t *user_options = hashcat_ctx->user_options;
const user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
//hashconfig->attack_exec = 0;
//hashconfig->dgst_pos0 = 0;
//hashconfig->dgst_pos1 = 0;
//hashconfig->dgst_pos2 = 0;
//hashconfig->dgst_pos3 = 0;
//hashconfig->dgst_size = 0;
//hashconfig->esalt_size = 0;
hashconfig->hash_mode = user_options->hash_mode;
//hashconfig->hash_type = 0;
hashconfig->has_optimized_kernel = false;
hashconfig->has_pure_kernel = false;
//hashconfig->hook_salt_size = 0;
//hashconfig->hook_size = 0;
hashconfig->is_salted = false;
//hashconfig->kern_type = 0;
//hashconfig->opti_type = 0;
//hashconfig->opts_type = 0;
//hashconfig->parse_func = NULL;
//hashconfig->salt_type = 0;
hashconfig->separator = user_options->separator;
//hashconfig->st_hash = NULL;
//hashconfig->st_pass = NULL;
//hashconfig->tmp_size = 0;
hashconfig->attack_exec = default_attack_exec (hashconfig, user_options, user_options_extra);
hashconfig->benchmark_mask = default_benchmark_mask (hashconfig, user_options, user_options_extra);
hashconfig->benchmark_salt_len = default_benchmark_salt_len (hashconfig, user_options, user_options_extra);
hashconfig->benchmark_salt_iter = default_benchmark_salt_iter (hashconfig, user_options, user_options_extra);
hashconfig->dgst_pos0 = default_dgst_pos0 (hashconfig, user_options, user_options_extra);
hashconfig->dgst_pos1 = default_dgst_pos1 (hashconfig, user_options, user_options_extra);
hashconfig->dgst_pos2 = default_dgst_pos2 (hashconfig, user_options, user_options_extra);
hashconfig->dgst_pos3 = default_dgst_pos3 (hashconfig, user_options, user_options_extra);
hashconfig->dgst_size = default_dgst_size (hashconfig, user_options, user_options_extra);
hashconfig->esalt_size = default_esalt_size (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);
hashconfig->hook_salt_size = default_hook_salt_size (hashconfig, user_options, user_options_extra);
hashconfig->hook_size = default_hook_size (hashconfig, user_options, user_options_extra);
hashconfig->kern_type = default_kern_type (hashconfig, user_options, user_options_extra);
hashconfig->opti_type = default_opti_type (hashconfig, user_options, user_options_extra);
hashconfig->opts_type = default_opts_type (hashconfig, user_options, user_options_extra);
hashconfig->pw_max = default_pw_max (hashconfig, user_options, user_options_extra);
hashconfig->pw_min = default_pw_min (hashconfig, user_options, user_options_extra);
hashconfig->salt_max = default_salt_max (hashconfig, user_options, user_options_extra);
hashconfig->salt_min = default_salt_min (hashconfig, user_options, user_options_extra);
hashconfig->salt_type = default_salt_type (hashconfig, user_options, user_options_extra);
hashconfig->separator = default_separator (hashconfig, user_options, user_options_extra);
hashconfig->st_hash = default_st_hash (hashconfig, user_options, user_options_extra);
hashconfig->st_pass = default_st_pass (hashconfig, user_options, user_options_extra);
hashconfig->tmp_size = default_tmp_size (hashconfig, user_options, user_options_extra);
module_register (module_ctx);
hashconfig->attack_exec = module_ctx->module_attack_exec (hashconfig, user_options, user_options_extra);
hashconfig->benchmark_mask = module_ctx->module_benchmark_mask (hashconfig, user_options, user_options_extra);
hashconfig->benchmark_salt_len = module_ctx->module_benchmark_salt_len (hashconfig, user_options, user_options_extra);
hashconfig->benchmark_salt_iter = module_ctx->module_benchmark_salt_iter (hashconfig, user_options, user_options_extra);
hashconfig->dgst_pos0 = module_ctx->module_dgst_pos0 (hashconfig, user_options, user_options_extra);
hashconfig->dgst_pos1 = module_ctx->module_dgst_pos1 (hashconfig, user_options, user_options_extra);
hashconfig->dgst_pos2 = module_ctx->module_dgst_pos2 (hashconfig, user_options, user_options_extra);
hashconfig->dgst_pos3 = module_ctx->module_dgst_pos3 (hashconfig, user_options, user_options_extra);
hashconfig->dgst_size = module_ctx->module_dgst_size (hashconfig, user_options, user_options_extra);
hashconfig->esalt_size = module_ctx->module_esalt_size (hashconfig, user_options, user_options_extra);
hashconfig->hash_name = module_ctx->module_hash_name (hashconfig, user_options, user_options_extra);
hashconfig->hash_type = module_ctx->module_hash_type (hashconfig, user_options, user_options_extra);
hashconfig->hook_salt_size = module_ctx->module_hook_salt_size (hashconfig, user_options, user_options_extra);
hashconfig->hook_size = module_ctx->module_hook_size (hashconfig, user_options, user_options_extra);
hashconfig->kern_type = module_ctx->module_kern_type (hashconfig, user_options, user_options_extra);
hashconfig->opti_type = module_ctx->module_opti_type (hashconfig, user_options, user_options_extra);
hashconfig->opts_type = module_ctx->module_opts_type (hashconfig, user_options, user_options_extra);
hashconfig->pw_max = module_ctx->module_pw_max (hashconfig, user_options, user_options_extra);
hashconfig->pw_min = module_ctx->module_pw_min (hashconfig, user_options, user_options_extra);
hashconfig->salt_max = module_ctx->module_salt_max (hashconfig, user_options, user_options_extra);
hashconfig->salt_min = module_ctx->module_salt_min (hashconfig, user_options, user_options_extra);
hashconfig->salt_type = module_ctx->module_salt_type (hashconfig, user_options, user_options_extra);
hashconfig->st_hash = module_ctx->module_st_hash (hashconfig, user_options, user_options_extra);
hashconfig->st_pass = module_ctx->module_st_pass (hashconfig, user_options, user_options_extra);
hashconfig->tmp_size = module_ctx->module_tmp_size (hashconfig, user_options, user_options_extra);
if (module_ctx->module_attack_exec) hashconfig->attack_exec = module_ctx->module_attack_exec (hashconfig, user_options, user_options_extra);
if (module_ctx->module_benchmark_mask) hashconfig->benchmark_mask = module_ctx->module_benchmark_mask (hashconfig, user_options, user_options_extra);
if (module_ctx->module_benchmark_salt_len) hashconfig->benchmark_salt_len = module_ctx->module_benchmark_salt_len (hashconfig, user_options, user_options_extra);
if (module_ctx->module_benchmark_salt_iter) hashconfig->benchmark_salt_iter = module_ctx->module_benchmark_salt_iter (hashconfig, user_options, user_options_extra);
if (module_ctx->module_dgst_pos0) hashconfig->dgst_pos0 = module_ctx->module_dgst_pos0 (hashconfig, user_options, user_options_extra);
if (module_ctx->module_dgst_pos1) hashconfig->dgst_pos1 = module_ctx->module_dgst_pos1 (hashconfig, user_options, user_options_extra);
if (module_ctx->module_dgst_pos2) hashconfig->dgst_pos2 = module_ctx->module_dgst_pos2 (hashconfig, user_options, user_options_extra);
if (module_ctx->module_dgst_pos3) hashconfig->dgst_pos3 = module_ctx->module_dgst_pos3 (hashconfig, user_options, user_options_extra);
if (module_ctx->module_dgst_size) hashconfig->dgst_size = module_ctx->module_dgst_size (hashconfig, user_options, user_options_extra);
if (module_ctx->module_esalt_size) hashconfig->esalt_size = module_ctx->module_esalt_size (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);
if (module_ctx->module_hook_salt_size) hashconfig->hook_salt_size = module_ctx->module_hook_salt_size (hashconfig, user_options, user_options_extra);
if (module_ctx->module_hook_size) hashconfig->hook_size = module_ctx->module_hook_size (hashconfig, user_options, user_options_extra);
if (module_ctx->module_kern_type) hashconfig->kern_type = module_ctx->module_kern_type (hashconfig, user_options, user_options_extra);
if (module_ctx->module_opti_type) hashconfig->opti_type = module_ctx->module_opti_type (hashconfig, user_options, user_options_extra);
if (module_ctx->module_opts_type) hashconfig->opts_type = module_ctx->module_opts_type (hashconfig, user_options, user_options_extra);
if (module_ctx->module_pw_max) hashconfig->pw_max = module_ctx->module_pw_max (hashconfig, user_options, user_options_extra);
if (module_ctx->module_pw_min) hashconfig->pw_min = module_ctx->module_pw_min (hashconfig, user_options, user_options_extra);
if (module_ctx->module_salt_max) hashconfig->salt_max = module_ctx->module_salt_max (hashconfig, user_options, user_options_extra);
if (module_ctx->module_salt_min) hashconfig->salt_min = module_ctx->module_salt_min (hashconfig, user_options, user_options_extra);
if (module_ctx->module_salt_type) hashconfig->salt_type = module_ctx->module_salt_type (hashconfig, user_options, user_options_extra);
if (module_ctx->module_separator) hashconfig->separator = module_ctx->module_separator (hashconfig, user_options, user_options_extra);
if (module_ctx->module_st_hash) hashconfig->st_hash = module_ctx->module_st_hash (hashconfig, user_options, user_options_extra);
if (module_ctx->module_st_pass) hashconfig->st_pass = module_ctx->module_st_pass (hashconfig, user_options, user_options_extra);
if (module_ctx->module_tmp_size) hashconfig->tmp_size = module_ctx->module_tmp_size (hashconfig, user_options, user_options_extra);
/*
switch (hashconfig->hash_mode)
@ -28936,6 +28942,9 @@ int hashconfig_init (hashcat_ctx_t *hashcat_ctx)
hashconfig->opts_type |= OPTS_TYPE_PT_NEVERCRACK;
}
hashconfig->has_optimized_kernel = false;
hashconfig->has_pure_kernel = false;
if (hashconfig->kern_type == (u32) -1)
{
// some hash modes tell hashcat about their exact hash-mode inside the parser (eg. luks and jwt)
@ -30350,6 +30359,13 @@ void encoder_apply_options (const hashconfig_t *hashconfig, void *data)
}
}
u32 default_hash_mode (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 hash_mode = user_options->hash_mode;
return hash_mode;
}
u32 default_attack_exec (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 attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
@ -30862,6 +30878,11 @@ u64 default_hook_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED
return hook_size;
}
char default_separator (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
return user_options->separator;
}
const char *default_st_hash (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
return "<empty default>";