1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-23 14:10:57 +00:00

Get rid of stdout_flag, restore and machine_readable variable in main

This commit is contained in:
jsteube 2016-09-21 20:34:58 +02:00
parent f3c427407e
commit c0fcd29770

View File

@ -337,20 +337,6 @@ int main (int argc, char **argv)
if (rc_user_options_parse1 == -1) return -1; if (rc_user_options_parse1 == -1) return -1;
if (user_options->version)
{
log_info ("%s", VERSION_TAG);
return 0;
}
if (user_options->usage)
{
usage_big_print (PROGNAME);
return 0;
}
/** /**
* session * session
*/ */
@ -418,7 +404,6 @@ int main (int argc, char **argv)
uint stdout_flag = STDOUT_FLAG;
uint show = SHOW; uint show = SHOW;
uint left = LEFT; uint left = LEFT;
uint remove = REMOVE; uint remove = REMOVE;
@ -440,10 +425,7 @@ int main (int argc, char **argv)
uint outfile_format = OUTFILE_FORMAT; uint outfile_format = OUTFILE_FORMAT;
uint outfile_autohex = OUTFILE_AUTOHEX; uint outfile_autohex = OUTFILE_AUTOHEX;
uint outfile_check_timer = OUTFILE_CHECK_TIMER; uint outfile_check_timer = OUTFILE_CHECK_TIMER;
uint restore = RESTORE;
uint status = STATUS; uint status = STATUS;
uint machine_readable = MACHINE_READABLE;
uint loopback = LOOPBACK; uint loopback = LOOPBACK;
uint weak_hash_threshold = WEAK_HASH_THRESHOLD; uint weak_hash_threshold = WEAK_HASH_THRESHOLD;
char *session = NULL; char *session = NULL;
@ -482,7 +464,6 @@ int main (int argc, char **argv)
left = user_options->left; left = user_options->left;
limit = user_options->limit; limit = user_options->limit;
loopback = user_options->loopback; loopback = user_options->loopback;
machine_readable = user_options->machine_readable;
markov_classic = user_options->markov_classic; markov_classic = user_options->markov_classic;
markov_disable = user_options->markov_disable; markov_disable = user_options->markov_disable;
markov_hcstat = user_options->markov_hcstat; markov_hcstat = user_options->markov_hcstat;
@ -496,8 +477,6 @@ int main (int argc, char **argv)
potfile_path = user_options->potfile_path; potfile_path = user_options->potfile_path;
powertune_enable = user_options->powertune_enable; powertune_enable = user_options->powertune_enable;
remove = user_options->remove; remove = user_options->remove;
restore = user_options->restore;
rp_gen_func_max = user_options->rp_gen_func_max; rp_gen_func_max = user_options->rp_gen_func_max;
rp_gen_func_min = user_options->rp_gen_func_min; rp_gen_func_min = user_options->rp_gen_func_min;
rp_gen = user_options->rp_gen; rp_gen = user_options->rp_gen;
@ -507,14 +486,10 @@ int main (int argc, char **argv)
show = user_options->show; show = user_options->show;
skip = user_options->skip; skip = user_options->skip;
status = user_options->status; status = user_options->status;
stdout_flag = user_options->stdout_flag;
truecrypt_keyfiles = user_options->truecrypt_keyfiles; truecrypt_keyfiles = user_options->truecrypt_keyfiles;
veracrypt_keyfiles = user_options->veracrypt_keyfiles; veracrypt_keyfiles = user_options->veracrypt_keyfiles;
weak_hash_threshold = user_options->weak_hash_threshold; weak_hash_threshold = user_options->weak_hash_threshold;
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;
@ -561,6 +536,21 @@ int main (int argc, char **argv)
} }
if (user_options->version)
{
log_info ("%s", VERSION_TAG);
return 0;
}
if (user_options->usage)
{
usage_big_print (PROGNAME);
return 0;
}
/** /**
* Inform user things getting started, * Inform user things getting started,
* - this is giving us a visual header before preparations start, so we do not need to clear them afterwards * - this is giving us a visual header before preparations start, so we do not need to clear them afterwards
@ -571,7 +561,7 @@ int main (int argc, char **argv)
{ {
if (user_options->benchmark == true) if (user_options->benchmark == true)
{ {
if (machine_readable == false) if (user_options->machine_readable == false)
{ {
log_info ("%s (%s) starting in benchmark-mode...", PROGNAME, VERSION_TAG); log_info ("%s (%s) starting in benchmark-mode...", PROGNAME, VERSION_TAG);
log_info (""); log_info ("");
@ -581,22 +571,22 @@ int main (int argc, char **argv)
log_info ("# %s (%s) %s", PROGNAME, VERSION_TAG, ctime (&proc_start)); log_info ("# %s (%s) %s", PROGNAME, VERSION_TAG, ctime (&proc_start));
} }
} }
else if (restore == true) else if (user_options->restore == true)
{ {
log_info ("%s (%s) starting in restore-mode...", PROGNAME, VERSION_TAG); log_info ("%s (%s) starting in restore-mode...", PROGNAME, VERSION_TAG);
log_info (""); log_info ("");
} }
else if (stdout_flag == true) else if (user_options->stdout_flag == true)
{ {
// do nothing // do nothing
} }
else if (keyspace == true) else if (user_options->keyspace == true)
{ {
// do nothing // do nothing
} }
else else
{ {
if ((show == true) || (left == true)) if ((user_options->show == true) || (user_options->left == true))
{ {
// do nothing // do nothing
} }