Make more use of new user_options_t*
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#ifndef _COMMON_H
|
||||
#define _COMMON_H
|
||||
|
||||
#define PROGNAME "hashcat"
|
||||
|
||||
#if defined (__linux__)
|
||||
#define _POSIX
|
||||
#elif defined (__APPLE__)
|
||||
|
||||
@@ -17,8 +17,8 @@ void check_hash (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, plai
|
||||
|
||||
int check_cracked (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, hashes_t *hashes, const uint salt_pos);
|
||||
|
||||
int hashes_init_stage1 (hashes_t *hashes, const hashconfig_t *hashconfig, potfile_ctx_t *potfile_ctx, outfile_ctx_t *outfile_ctx, char *hash_or_file, const uint keyspace, const uint quiet, const uint benchmark, const bool opencl_info, const uint stdout_flag, const uint username, const uint remove, const uint show, const uint left);
|
||||
int hashes_init_stage2 (hashes_t *hashes, const hashconfig_t *hashconfig, opencl_ctx_t *opencl_ctx, const uint username, const uint remove, const uint show);
|
||||
int hashes_init_stage1 (hashes_t *hashes, const hashconfig_t *hashconfig, potfile_ctx_t *potfile_ctx, outfile_ctx_t *outfile_ctx, user_options_t *user_options, char *hash_or_file);
|
||||
int hashes_init_stage2 (hashes_t *hashes, const hashconfig_t *hashconfig, opencl_ctx_t *opencl_ctx, user_options_t *user_options);
|
||||
|
||||
void hashes_destroy (hashes_t *hashes);
|
||||
|
||||
|
||||
+3
-3
@@ -85,13 +85,13 @@ int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashcon
|
||||
|
||||
int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, hashes_t *hashes, const uint pws_cnt);
|
||||
|
||||
int opencl_ctx_init (opencl_ctx_t *opencl_ctx, const char *opencl_platforms, const char *opencl_devices, const char *opencl_device_types, const uint opencl_vector_width, const uint opencl_vector_width_chgd, const uint nvidia_spin_damp, const uint nvidia_spin_damp_chgd, const uint workload_profile, const uint kernel_accel, const uint kernel_accel_chgd, const uint kernel_loops, const uint kernel_loops_chgd, const uint keyspace, const uint stdout_flag);
|
||||
int opencl_ctx_init (opencl_ctx_t *opencl_ctx, const user_options_t *user_options);
|
||||
void opencl_ctx_destroy (opencl_ctx_t *opencl_ctx);
|
||||
|
||||
int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const tuning_db_t *tuning_db, const uint attack_mode, const bool quiet, const bool force, const bool benchmark, const bool opencl_info, const bool machine_readable, const uint algorithm_pos);
|
||||
int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const tuning_db_t *tuning_db, const user_options_t *user_options, const uint algorithm_pos);
|
||||
void opencl_ctx_devices_destroy (opencl_ctx_t *opencl_ctx);
|
||||
|
||||
int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const session_ctx_t *session_ctx);
|
||||
int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const session_ctx_t *session_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra);
|
||||
int opencl_session_destroy (opencl_ctx_t *opencl_ctx);
|
||||
|
||||
#endif // _OPENCL_H
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
#ifndef _SESSION_H
|
||||
#define _SESSION_H
|
||||
|
||||
void session_ctx_init (session_ctx_t *session_ctx, const bool quiet, const bool force, const bool benchmark, const u32 scrypt_tmto, char *cwd, char *install_dir, char *profile_dir, char *session_dir, char *shared_dir, char *cpath_real, const u32 wordlist_mode, char *rule_buf_l, char *rule_buf_r, const int rule_len_l, const int rule_len_r, const u32 kernel_rules_cnt, kernel_rule_t *kernel_rules_buf, const u32 attack_mode, const u32 attack_kern, const u32 bitmap_size, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, u32 *bitmap_s1_a, u32 *bitmap_s1_b, u32 *bitmap_s1_c, u32 *bitmap_s1_d, u32 *bitmap_s2_a, u32 *bitmap_s2_b, u32 *bitmap_s2_c, u32 *bitmap_s2_d);
|
||||
void session_ctx_init (session_ctx_t *session_ctx, char *cwd, char *install_dir, char *profile_dir, char *session_dir, char *shared_dir, char *cpath_real, const u32 wordlist_mode, const u32 kernel_rules_cnt, kernel_rule_t *kernel_rules_buf,const u32 bitmap_size, const u32 bitmap_mask, const u32 bitmap_shift1, const u32 bitmap_shift2, u32 *bitmap_s1_a, u32 *bitmap_s1_b, u32 *bitmap_s1_c, u32 *bitmap_s1_d, u32 *bitmap_s2_a, u32 *bitmap_s2_b, u32 *bitmap_s2_c, u32 *bitmap_s2_d);
|
||||
|
||||
void session_ctx_destroy (session_ctx_t *session_ctx);
|
||||
|
||||
|
||||
+5
-27
@@ -513,19 +513,7 @@ typedef struct
|
||||
u32 devices_filter;
|
||||
cl_device_type device_types_filter;
|
||||
|
||||
u32 opencl_vector_width;
|
||||
u32 opencl_vector_width_chgd;
|
||||
|
||||
u32 nvidia_spin_damp;
|
||||
u32 nvidia_spin_damp_chgd;
|
||||
|
||||
u32 kernel_loops;
|
||||
u32 kernel_loops_chgd;
|
||||
|
||||
u32 kernel_accel;
|
||||
u32 kernel_accel_chgd;
|
||||
|
||||
u32 workload_profile;
|
||||
double target_ms;
|
||||
|
||||
int need_adl;
|
||||
int need_nvml;
|
||||
@@ -856,18 +844,16 @@ typedef struct
|
||||
typedef struct
|
||||
{
|
||||
u32 attack_kern;
|
||||
|
||||
u32 rule_len_r;
|
||||
u32 rule_len_l;
|
||||
|
||||
int optind;
|
||||
|
||||
} user_options_extra_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool quiet;
|
||||
bool force;
|
||||
bool benchmark;
|
||||
|
||||
u32 scrypt_tmto;
|
||||
|
||||
char *cwd;
|
||||
char *install_dir;
|
||||
char *profile_dir;
|
||||
@@ -877,17 +863,9 @@ typedef struct
|
||||
|
||||
u32 wordlist_mode;
|
||||
|
||||
char *rule_buf_l;
|
||||
char *rule_buf_r;
|
||||
int rule_len_l;
|
||||
int rule_len_r;
|
||||
|
||||
u32 kernel_rules_cnt;
|
||||
kernel_rule_t *kernel_rules_buf;
|
||||
|
||||
u32 attack_mode;
|
||||
u32 attack_kern;
|
||||
|
||||
u32 bitmap_size;
|
||||
u32 bitmap_mask;
|
||||
u32 bitmap_shift1;
|
||||
|
||||
Reference in New Issue
Block a user