1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-25 01:18:15 +00:00

Refactor restore_disable variable to restore_enable, try to make variable names always positive for easier handling

This commit is contained in:
jsteube 2023-10-20 12:16:18 +00:00
parent ff94f4c9d0
commit b597a96328
3 changed files with 22 additions and 22 deletions

View File

@ -691,7 +691,7 @@ typedef enum user_options_defaults
QUIET = false,
REMOVE = false,
REMOVE_TIMER = 60,
RESTORE_DISABLE = false,
RESTORE_ENABLE = true,
RESTORE = false,
RESTORE_TIMER = 1,
RP_GEN = 0,
@ -2360,7 +2360,7 @@ typedef struct user_options
bool quiet;
bool remove;
bool restore;
bool restore_disable;
bool restore_enable;
bool self_test;
bool show;
bool slow_candidates;

View File

@ -302,20 +302,20 @@ int restore_ctx_init (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
restore_ctx->enabled = false;
if (user_options->usage > 0) return 0;
if (user_options->backend_info > 0) return 0;
if (user_options->usage > 0) return 0;
if (user_options->backend_info > 0) return 0;
if (user_options->benchmark == true) return 0;
if (user_options->hash_info == true) return 0;
if (user_options->keyspace == true) return 0;
if (user_options->left == true) return 0;
if (user_options->show == true) return 0;
if (user_options->stdout_flag == true) return 0;
if (user_options->speed_only == true) return 0;
if (user_options->progress_only == true) return 0;
if (user_options->version == true) return 0;
if (user_options->identify == true) return 0;
if (user_options->restore_disable == true) return 0;
if (user_options->benchmark == true) return 0;
if (user_options->hash_info == true) return 0;
if (user_options->keyspace == true) return 0;
if (user_options->left == true) return 0;
if (user_options->show == true) return 0;
if (user_options->stdout_flag == true) return 0;
if (user_options->speed_only == true) return 0;
if (user_options->progress_only == true) return 0;
if (user_options->version == true) return 0;
if (user_options->identify == true) return 0;
if (user_options->restore_enable == false) return 0;
if (argc == 0) return 0;
if (argv == NULL) return 0;

View File

@ -255,7 +255,7 @@ int user_options_init (hashcat_ctx_t *hashcat_ctx)
user_options->quiet = QUIET;
user_options->remove = REMOVE;
user_options->remove_timer = REMOVE_TIMER;
user_options->restore_disable = RESTORE_DISABLE;
user_options->restore_enable = RESTORE_ENABLE;
user_options->restore_file_path = NULL;
user_options->restore = RESTORE;
user_options->restore_timer = RESTORE_TIMER;
@ -429,7 +429,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
case IDX_IDENTIFY: user_options->identify = true; break;
case IDX_SPEED_ONLY: user_options->speed_only = true; break;
case IDX_PROGRESS_ONLY: user_options->progress_only = true; break;
case IDX_RESTORE_DISABLE: user_options->restore_disable = true; break;
case IDX_RESTORE_DISABLE: user_options->restore_enable = false; break;
case IDX_RESTORE_FILE_PATH: user_options->restore_file_path = optarg; break;
case IDX_STATUS: user_options->status = true; break;
case IDX_STATUS_JSON: user_options->status_json = true; break;
@ -1838,7 +1838,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
user_options->spin_damp = 0;
user_options->outfile_check_timer = 0;
user_options->potfile_disable = true;
user_options->restore_disable = true;
user_options->restore_enable = false;
user_options->restore = false;
user_options->restore_timer = 0;
user_options->show = false;
@ -1862,7 +1862,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
user_options->spin_damp = 0;
user_options->outfile_check_timer = 0;
user_options->potfile_disable = true;
user_options->restore_disable = true;
user_options->restore_enable = false;
user_options->restore = false;
user_options->restore_timer = 0;
user_options->show = false;
@ -1885,7 +1885,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
user_options->spin_damp = 0;
user_options->potfile_disable = true;
user_options->progress_only = false;
user_options->restore_disable = true;
user_options->restore_enable = false;
user_options->restore = false;
user_options->restore_timer = 0;
user_options->show = false;
@ -1986,7 +1986,7 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
// this allows the user to use --show and --left while cracking (i.e. while another instance of hashcat is running)
if (user_options->show == true || user_options->left == true)
{
user_options->restore_disable = true;
user_options->restore_enable = false;
user_options->restore = false;
}
@ -3270,7 +3270,7 @@ void user_options_logger (hashcat_ctx_t *hashcat_ctx)
logfile_top_uint (user_options->remove);
logfile_top_uint (user_options->remove_timer);
logfile_top_uint (user_options->restore);
logfile_top_uint (user_options->restore_disable);
logfile_top_uint (user_options->restore_enable);
logfile_top_uint (user_options->restore_timer);
logfile_top_uint (user_options->rp_files_cnt);
logfile_top_uint (user_options->rp_gen);