1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-24 23:48:19 +00:00

Get rid of truecrypt_keyfiles and veracrypt_keyfiles variable in main

This commit is contained in:
jsteube 2016-09-21 22:21:35 +02:00
parent d4e666d955
commit 80685d94c4
4 changed files with 9 additions and 15 deletions

View File

@ -1638,7 +1638,7 @@ int hashconfig_init (hashconfig_t *hashconfig, const user_optio
void hashconfig_destroy (hashconfig_t *hashconfig); void hashconfig_destroy (hashconfig_t *hashconfig);
uint hashconfig_general_pw_min (hashconfig_t *hashconfig); uint hashconfig_general_pw_min (hashconfig_t *hashconfig);
uint hashconfig_general_pw_max (hashconfig_t *hashconfig); uint hashconfig_general_pw_max (hashconfig_t *hashconfig);
void hashconfig_general_defaults (hashconfig_t *hashconfig, hashes_t *hashes, char *optional_param1); void hashconfig_general_defaults (hashconfig_t *hashconfig, hashes_t *hashes, const user_options_t *user_options);
void hashconfig_benchmark_defaults (hashconfig_t *hashconfig, salt_t *salt, void *esalt); void hashconfig_benchmark_defaults (hashconfig_t *hashconfig, salt_t *salt, void *esalt);
char *hashconfig_benchmark_mask (hashconfig_t *hashconfig); char *hashconfig_benchmark_mask (hashconfig_t *hashconfig);

View File

@ -400,14 +400,8 @@ int main (int argc, char **argv)
// temporarily start // temporarily start
char *truecrypt_keyfiles = NULL;
char *veracrypt_keyfiles = NULL;
if (1) if (1)
{ {
truecrypt_keyfiles = user_options->truecrypt_keyfiles;
veracrypt_keyfiles = user_options->veracrypt_keyfiles;
data.attack_mode = user_options->attack_mode; data.attack_mode = user_options->attack_mode;
data.restore = user_options->restore; data.restore = user_options->restore;
data.restore_timer = user_options->restore_timer; data.restore_timer = user_options->restore_timer;
@ -956,12 +950,7 @@ int main (int argc, char **argv)
* Automatic Optimizers * Automatic Optimizers
*/ */
char *optional_param1 = NULL; hashconfig_general_defaults (hashconfig, hashes, user_options);
if (truecrypt_keyfiles) optional_param1 = truecrypt_keyfiles;
if (veracrypt_keyfiles) optional_param1 = veracrypt_keyfiles;
hashconfig_general_defaults (hashconfig, hashes, optional_param1);
if (hashes->salts_cnt == 1) if (hashes->salts_cnt == 1)
hashconfig->opti_type |= OPTI_TYPE_SINGLE_SALT; hashconfig->opti_type |= OPTI_TYPE_SINGLE_SALT;

View File

@ -20009,7 +20009,7 @@ uint hashconfig_general_pw_max (hashconfig_t *hashconfig)
return pw_max; return pw_max;
} }
void hashconfig_general_defaults (hashconfig_t *hashconfig, hashes_t *hashes, char *optional_param1) void hashconfig_general_defaults (hashconfig_t *hashconfig, hashes_t *hashes, const user_options_t *user_options)
{ {
salt_t *salts_buf = hashes->salts_buf; salt_t *salts_buf = hashes->salts_buf;
void *esalts_buf = hashes->esalts_buf; void *esalts_buf = hashes->esalts_buf;
@ -20055,6 +20055,11 @@ void hashconfig_general_defaults (hashconfig_t *hashconfig, hashes_t *hashes, ch
} }
} }
char *optional_param1 = NULL;
if (user_options->truecrypt_keyfiles) optional_param1 = user_options->truecrypt_keyfiles;
if (user_options->veracrypt_keyfiles) optional_param1 = user_options->veracrypt_keyfiles;
if (optional_param1) if (optional_param1)
{ {
char *tcvc_keyfiles = (char *) optional_param1; char *tcvc_keyfiles = (char *) optional_param1;

View File

@ -356,7 +356,7 @@ int user_options_parse (user_options_t *user_options, int myargc, char **myargv)
if (user_options->segment_size_chgd == true) if (user_options->segment_size_chgd == true)
{ {
user_options->segment_size = user_options->segment_size * (1024 * 1024); user_options->segment_size *= (1024 * 1024);
} }
return 0; return 0;