1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-23 00:28:11 +00:00

Finish conversion to strtol family

This commit is contained in:
Rosen Penev 2017-11-13 12:53:05 -08:00
parent ea5425b344
commit b3adf1dc30

View File

@ -313,113 +313,112 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
{ {
switch (c) switch (c)
{ {
case IDX_HELP: user_options->usage = true; break; case IDX_HELP: user_options->usage = true; break;
case IDX_VERSION: user_options->version = true; break; case IDX_VERSION: user_options->version = true; break;
case IDX_RESTORE: user_options->restore = true; break; case IDX_RESTORE: user_options->restore = true; break;
case IDX_QUIET: user_options->quiet = true; break; case IDX_QUIET: user_options->quiet = true; break;
case IDX_SHOW: user_options->show = true; break; case IDX_SHOW: user_options->show = true; break;
case IDX_LEFT: user_options->left = true; break; case IDX_LEFT: user_options->left = true; break;
case IDX_ADVICE_DISABLE: user_options->advice_disable = true; break; case IDX_ADVICE_DISABLE: user_options->advice_disable = true; break;
case IDX_USERNAME: user_options->username = true; break; case IDX_USERNAME: user_options->username = true; break;
case IDX_REMOVE: user_options->remove = true; break; case IDX_REMOVE: user_options->remove = true; break;
case IDX_REMOVE_TIMER: user_options->remove_timer = atoi (optarg); case IDX_REMOVE_TIMER: user_options->remove_timer = strtoul (optarg, NULL, 10);
user_options->remove_timer_chgd = true; break; user_options->remove_timer_chgd = true; break;
case IDX_POTFILE_DISABLE: user_options->potfile_disable = true; break; case IDX_POTFILE_DISABLE: user_options->potfile_disable = true; break;
case IDX_POTFILE_PATH: user_options->potfile_path = optarg; break; case IDX_POTFILE_PATH: user_options->potfile_path = optarg; break;
case IDX_DEBUG_MODE: user_options->debug_mode = atoi (optarg); break; case IDX_DEBUG_MODE: user_options->debug_mode = strtoul (optarg, NULL, 10); break;
case IDX_DEBUG_FILE: user_options->debug_file = optarg; break; case IDX_DEBUG_FILE: user_options->debug_file = optarg; break;
case IDX_ENCODING_FROM: user_options->encoding_from = optarg; break; case IDX_ENCODING_FROM: user_options->encoding_from = optarg; break;
case IDX_ENCODING_TO: user_options->encoding_to = optarg; break; case IDX_ENCODING_TO: user_options->encoding_to = optarg; break;
case IDX_INDUCTION_DIR: user_options->induction_dir = optarg; break; case IDX_INDUCTION_DIR: user_options->induction_dir = optarg; break;
case IDX_OUTFILE_CHECK_DIR: user_options->outfile_check_dir = optarg; break; case IDX_OUTFILE_CHECK_DIR: user_options->outfile_check_dir = optarg; break;
case IDX_EXAMPLE_HASHES: user_options->example_hashes = true; break; case IDX_EXAMPLE_HASHES: user_options->example_hashes = true; break;
case IDX_FORCE: user_options->force = true; break; case IDX_FORCE: user_options->force = true; break;
case IDX_SELF_TEST_DISABLE: user_options->self_test_disable = true; break; case IDX_SELF_TEST_DISABLE: user_options->self_test_disable = true; break;
case IDX_SKIP: user_options->skip = atoll (optarg); break; case IDX_SKIP: user_options->skip = strtoull (optarg, NULL, 10); break;
case IDX_LIMIT: user_options->limit = atoll (optarg); break; case IDX_LIMIT: user_options->limit = strtoull (optarg, NULL, 10); break;
case IDX_KEEP_GUESSING: user_options->keep_guessing = true; break; case IDX_KEEP_GUESSING: user_options->keep_guessing = true; break;
case IDX_KEYSPACE: user_options->keyspace = true; break; case IDX_KEYSPACE: user_options->keyspace = true; break;
case IDX_BENCHMARK: user_options->benchmark = true; break; case IDX_BENCHMARK: user_options->benchmark = true; break;
case IDX_STDOUT_FLAG: user_options->stdout_flag = true; break; case IDX_STDOUT_FLAG: user_options->stdout_flag = true; break;
case IDX_SPEED_ONLY: user_options->speed_only = true; break; case IDX_SPEED_ONLY: user_options->speed_only = true; break;
case IDX_PROGRESS_ONLY: user_options->progress_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_disable = true; break;
case IDX_RESTORE_FILE_PATH: user_options->restore_file_path = optarg; break; case IDX_RESTORE_FILE_PATH: user_options->restore_file_path = optarg; break;
case IDX_STATUS: user_options->status = true; break; case IDX_STATUS: user_options->status = true; break;
case IDX_STATUS_TIMER: user_options->status_timer = atoi (optarg); break; case IDX_STATUS_TIMER: user_options->status_timer = strtoul (optarg, NULL, 10); break;
case IDX_MACHINE_READABLE: user_options->machine_readable = true; break; case IDX_MACHINE_READABLE: user_options->machine_readable = true; break;
case IDX_LOOPBACK: user_options->loopback = true; break; case IDX_LOOPBACK: user_options->loopback = true; break;
case IDX_SESSION: user_options->session = optarg; break; case IDX_SESSION: user_options->session = optarg; break;
case IDX_HASH_MODE: user_options->hash_mode = atoi (optarg); case IDX_HASH_MODE: user_options->hash_mode = strtoul (optarg, NULL, 10);
user_options->hash_mode_chgd = true; break; user_options->hash_mode_chgd = true; break;
case IDX_RUNTIME: user_options->runtime = atoi (optarg); case IDX_RUNTIME: user_options->runtime = strtoul (optarg, NULL, 10);
user_options->runtime_chgd = true; break; user_options->runtime_chgd = true; break;
case IDX_ATTACK_MODE: user_options->attack_mode = atoi (optarg); case IDX_ATTACK_MODE: user_options->attack_mode = strtoul (optarg, NULL, 10);
user_options->attack_mode_chgd = true; break; user_options->attack_mode_chgd = true; break;
case IDX_RP_FILE: user_options->rp_files[user_options->rp_files_cnt++] case IDX_RP_FILE: user_options->rp_files[user_options->rp_files_cnt++] = optarg; break;
= optarg; break; case IDX_RP_GEN: user_options->rp_gen = strtoul (optarg, NULL, 10); break;
case IDX_RP_GEN: user_options->rp_gen = atoi (optarg); break; case IDX_RP_GEN_FUNC_MIN: user_options->rp_gen_func_min = strtoul (optarg, NULL, 10); break;
case IDX_RP_GEN_FUNC_MIN: user_options->rp_gen_func_min = atoi (optarg); break; case IDX_RP_GEN_FUNC_MAX: user_options->rp_gen_func_max = strtoul (optarg, NULL, 10); break;
case IDX_RP_GEN_FUNC_MAX: user_options->rp_gen_func_max = atoi (optarg); break; case IDX_RP_GEN_SEED: user_options->rp_gen_seed = strtoul (optarg, NULL, 10);
case IDX_RP_GEN_SEED: user_options->rp_gen_seed = atoi (optarg); user_options->rp_gen_seed_chgd = true; break;
user_options->rp_gen_seed_chgd = true; break; case IDX_RULE_BUF_L: user_options->rule_buf_l = optarg; break;
case IDX_RULE_BUF_L: user_options->rule_buf_l = optarg; break; case IDX_RULE_BUF_R: user_options->rule_buf_r = optarg; break;
case IDX_RULE_BUF_R: user_options->rule_buf_r = optarg; break; case IDX_MARKOV_DISABLE: user_options->markov_disable = true; break;
case IDX_MARKOV_DISABLE: user_options->markov_disable = true; break; case IDX_MARKOV_CLASSIC: user_options->markov_classic = true; break;
case IDX_MARKOV_CLASSIC: user_options->markov_classic = true; break; case IDX_MARKOV_THRESHOLD: user_options->markov_threshold = strtoul (optarg, NULL, 10); break;
case IDX_MARKOV_THRESHOLD: user_options->markov_threshold = atoi (optarg); break; case IDX_MARKOV_HCSTAT: user_options->markov_hcstat = optarg; break;
case IDX_MARKOV_HCSTAT: user_options->markov_hcstat = optarg; break; case IDX_OUTFILE: user_options->outfile = optarg; break;
case IDX_OUTFILE: user_options->outfile = optarg; break; case IDX_OUTFILE_FORMAT: user_options->outfile_format = strtoul (optarg, NULL, 10);
case IDX_OUTFILE_FORMAT: user_options->outfile_format = atoi (optarg); user_options->outfile_format_chgd = true; break;
user_options->outfile_format_chgd = true; break; case IDX_OUTFILE_AUTOHEX_DISABLE: user_options->outfile_autohex = false; break;
case IDX_OUTFILE_AUTOHEX_DISABLE: user_options->outfile_autohex = false; break; case IDX_OUTFILE_CHECK_TIMER: user_options->outfile_check_timer = strtoul (optarg, NULL, 10); break;
case IDX_OUTFILE_CHECK_TIMER: user_options->outfile_check_timer = atoi (optarg); break; case IDX_WORDLIST_AUTOHEX_DISABLE: user_options->wordlist_autohex_disable = true; break;
case IDX_WORDLIST_AUTOHEX_DISABLE: user_options->wordlist_autohex_disable = true; break; case IDX_HEX_CHARSET: user_options->hex_charset = true; break;
case IDX_HEX_CHARSET: user_options->hex_charset = true; break; case IDX_HEX_SALT: user_options->hex_salt = true; break;
case IDX_HEX_SALT: user_options->hex_salt = true; break; case IDX_HEX_WORDLIST: user_options->hex_wordlist = true; break;
case IDX_HEX_WORDLIST: user_options->hex_wordlist = true; break; case IDX_CPU_AFFINITY: user_options->cpu_affinity = optarg; break;
case IDX_CPU_AFFINITY: user_options->cpu_affinity = optarg; break; case IDX_OPENCL_INFO: user_options->opencl_info = true; break;
case IDX_OPENCL_INFO: user_options->opencl_info = true; break; case IDX_OPENCL_DEVICES: user_options->opencl_devices = optarg; break;
case IDX_OPENCL_DEVICES: user_options->opencl_devices = optarg; break; case IDX_OPENCL_PLATFORMS: user_options->opencl_platforms = optarg; break;
case IDX_OPENCL_PLATFORMS: user_options->opencl_platforms = optarg; break; case IDX_OPENCL_DEVICE_TYPES: user_options->opencl_device_types = optarg; break;
case IDX_OPENCL_DEVICE_TYPES: user_options->opencl_device_types = optarg; break; case IDX_OPENCL_VECTOR_WIDTH: user_options->opencl_vector_width = strtoul (optarg, NULL, 10);
case IDX_OPENCL_VECTOR_WIDTH: user_options->opencl_vector_width = atoi (optarg); user_options->opencl_vector_width_chgd = true; break;
user_options->opencl_vector_width_chgd = true; break; case IDX_OPTIMIZED_KERNEL_ENABLE: user_options->optimized_kernel_enable = true; break;
case IDX_OPTIMIZED_KERNEL_ENABLE: user_options->optimized_kernel_enable = true; break; case IDX_WORKLOAD_PROFILE: user_options->workload_profile = strtoul (optarg, NULL, 10);
case IDX_WORKLOAD_PROFILE: user_options->workload_profile = atoi (optarg); user_options->workload_profile_chgd = true; break;
user_options->workload_profile_chgd = true; break; case IDX_KERNEL_ACCEL: user_options->kernel_accel = strtoul (optarg, NULL, 10);
case IDX_KERNEL_ACCEL: user_options->kernel_accel = atoi (optarg); user_options->kernel_accel_chgd = true; break;
user_options->kernel_accel_chgd = true; break; case IDX_KERNEL_LOOPS: user_options->kernel_loops = strtoul (optarg, NULL, 10);
case IDX_KERNEL_LOOPS: user_options->kernel_loops = atoi (optarg); user_options->kernel_loops_chgd = true; break;
user_options->kernel_loops_chgd = true; break; case IDX_NVIDIA_SPIN_DAMP: user_options->nvidia_spin_damp = strtoul (optarg, NULL, 10);
case IDX_NVIDIA_SPIN_DAMP: user_options->nvidia_spin_damp = atoi (optarg); user_options->nvidia_spin_damp_chgd = true; break;
user_options->nvidia_spin_damp_chgd = true; break; case IDX_GPU_TEMP_DISABLE: user_options->gpu_temp_disable = true; break;
case IDX_GPU_TEMP_DISABLE: user_options->gpu_temp_disable = true; break; case IDX_GPU_TEMP_ABORT: user_options->gpu_temp_abort = strtoul (optarg, NULL, 10); break;
case IDX_GPU_TEMP_ABORT: user_options->gpu_temp_abort = atoi (optarg); break; case IDX_GPU_TEMP_RETAIN: user_options->gpu_temp_retain = strtoul (optarg, NULL, 10); break;
case IDX_GPU_TEMP_RETAIN: user_options->gpu_temp_retain = atoi (optarg); break; case IDX_POWERTUNE_ENABLE: user_options->powertune_enable = true; break;
case IDX_POWERTUNE_ENABLE: user_options->powertune_enable = true; break; case IDX_LOGFILE_DISABLE: user_options->logfile_disable = true; break;
case IDX_LOGFILE_DISABLE: user_options->logfile_disable = true; break; case IDX_HCCAPX_MESSAGE_PAIR: user_options->hccapx_message_pair = strtoul (optarg, NULL, 10);
case IDX_HCCAPX_MESSAGE_PAIR: user_options->hccapx_message_pair = atoi (optarg); user_options->hccapx_message_pair_chgd = true; break;
user_options->hccapx_message_pair_chgd = true; break; case IDX_NONCE_ERROR_CORRECTIONS: user_options->nonce_error_corrections = strtoul (optarg, NULL, 10); break;
case IDX_NONCE_ERROR_CORRECTIONS: user_options->nonce_error_corrections = atoi (optarg); break; case IDX_TRUECRYPT_KEYFILES: user_options->truecrypt_keyfiles = optarg; break;
case IDX_TRUECRYPT_KEYFILES: user_options->truecrypt_keyfiles = optarg; break; case IDX_VERACRYPT_KEYFILES: user_options->veracrypt_keyfiles = optarg; break;
case IDX_VERACRYPT_KEYFILES: user_options->veracrypt_keyfiles = optarg; break; case IDX_VERACRYPT_PIM: user_options->veracrypt_pim = strtoul (optarg, NULL, 10); break;
case IDX_VERACRYPT_PIM: user_options->veracrypt_pim = atoi (optarg); break; case IDX_SEGMENT_SIZE: user_options->segment_size = strtoul (optarg, NULL, 10);
case IDX_SEGMENT_SIZE: user_options->segment_size = atoi (optarg); user_options->segment_size_chgd = true; break;
user_options->segment_size_chgd = true; break; case IDX_SCRYPT_TMTO: user_options->scrypt_tmto = strtoul (optarg, NULL, 10); break;
case IDX_SCRYPT_TMTO: user_options->scrypt_tmto = atoi (optarg); break; case IDX_SEPARATOR: user_options->separator = optarg[0]; break;
case IDX_SEPARATOR: user_options->separator = optarg[0]; break; case IDX_BITMAP_MIN: user_options->bitmap_min = strtoul (optarg, NULL, 10); break;
case IDX_BITMAP_MIN: user_options->bitmap_min = atoi (optarg); break; case IDX_BITMAP_MAX: user_options->bitmap_max = strtoul (optarg, NULL, 10); break;
case IDX_BITMAP_MAX: user_options->bitmap_max = atoi (optarg); break; case IDX_INCREMENT: user_options->increment = true; break;
case IDX_INCREMENT: user_options->increment = true; break; case IDX_INCREMENT_MIN: user_options->increment_min = strtoul (optarg, NULL, 10);
case IDX_INCREMENT_MIN: user_options->increment_min = atoi (optarg); user_options->increment_min_chgd = true; break;
user_options->increment_min_chgd = true; break; case IDX_INCREMENT_MAX: user_options->increment_max = strtoul (optarg, NULL, 10);
case IDX_INCREMENT_MAX: user_options->increment_max = atoi (optarg); user_options->increment_max_chgd = true; break;
user_options->increment_max_chgd = true; break; case IDX_CUSTOM_CHARSET_1: user_options->custom_charset_1 = optarg; break;
case IDX_CUSTOM_CHARSET_1: user_options->custom_charset_1 = optarg; break; case IDX_CUSTOM_CHARSET_2: user_options->custom_charset_2 = optarg; break;
case IDX_CUSTOM_CHARSET_2: user_options->custom_charset_2 = optarg; break; case IDX_CUSTOM_CHARSET_3: user_options->custom_charset_3 = optarg; break;
case IDX_CUSTOM_CHARSET_3: user_options->custom_charset_3 = optarg; break; case IDX_CUSTOM_CHARSET_4: user_options->custom_charset_4 = optarg; break;
case IDX_CUSTOM_CHARSET_4: user_options->custom_charset_4 = optarg; break;
} }
} }