Separate rules and straight mode from each other, remove rules_ctx_t
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@
|
||||
#ifndef _AUTOTUNE_H
|
||||
#define _AUTOTUNE_H
|
||||
|
||||
int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const rules_ctx_t *rules_ctx);
|
||||
int autotune (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const straight_ctx_t *straight_ctx);
|
||||
|
||||
void *thread_autotune (void *p);
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ int sort_by_hash_no_salt (const void *v1, const void *v2);
|
||||
|
||||
void save_hash (const user_options_t *user_options, const hashconfig_t *hashconfig, const hashes_t *hashes);
|
||||
|
||||
void check_hash (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const rules_ctx_t *rules_ctx, plain_t *plain);
|
||||
void check_hash (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const straight_ctx_t *straight_ctx, plain_t *plain);
|
||||
|
||||
int check_cracked (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const rules_ctx_t *rules_ctx, hashconfig_t *hashconfig, hashes_t *hashes, const uint salt_pos);
|
||||
int check_cracked (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const straight_ctx_t *straight_ctx, 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, 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);
|
||||
|
||||
+3
-3
@@ -23,7 +23,7 @@ void writeProgramBin (char *dst, char *binary, size_t binary_size);
|
||||
|
||||
int gidd_to_pw_t (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const u64 gidd, pw_t *pw);
|
||||
|
||||
int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const rules_ctx_t *rules_ctx, const mask_ctx_t *mask_ctx, hashconfig_t *hashconfig, const uint attack_exec, const uint attack_mode, const uint opts_type, const salt_t *salt_buf, const uint highest_pw_len, const uint pws_cnt, const uint fast_iteration);
|
||||
int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const straight_ctx_t *straight_ctx, const mask_ctx_t *mask_ctx, hashconfig_t *hashconfig, const uint attack_exec, const uint attack_mode, const uint opts_type, const salt_t *salt_buf, const uint highest_pw_len, const uint pws_cnt, const uint fast_iteration);
|
||||
int run_kernel (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num, const uint event_update, const uint iteration, hashconfig_t *hashconfig, const user_options_t *user_options);
|
||||
int run_kernel_mp (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num);
|
||||
int run_kernel_tm (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param);
|
||||
@@ -33,7 +33,7 @@ int run_kernel_bzero (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param,
|
||||
|
||||
int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const uint pws_cnt);
|
||||
|
||||
int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, hashes_t *hashes, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const rules_ctx_t *rules_ctx, const mask_ctx_t *mask_ctx, const uint pws_cnt);
|
||||
int run_cracker (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, hashes_t *hashes, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const straight_ctx_t *straight_ctx, const mask_ctx_t *mask_ctx, const uint pws_cnt);
|
||||
|
||||
int opencl_ctx_init (opencl_ctx_t *opencl_ctx, const user_options_t *user_options);
|
||||
void opencl_ctx_destroy (opencl_ctx_t *opencl_ctx);
|
||||
@@ -41,7 +41,7 @@ void opencl_ctx_destroy (opencl_ctx_t *opencl_ctx);
|
||||
int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const user_options_t *user_options);
|
||||
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 rules_ctx_t *rules_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const folder_config_t *folder_config, const bitmap_ctx_t *bitmap_ctx, const tuning_db_t *tuning_db);
|
||||
int opencl_session_begin (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const straight_ctx_t *straight_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const folder_config_t *folder_config, const bitmap_ctx_t *bitmap_ctx, const tuning_db_t *tuning_db);
|
||||
void opencl_session_destroy (opencl_ctx_t *opencl_ctx);
|
||||
void opencl_session_reset (opencl_ctx_t *opencl_ctx);
|
||||
int opencl_session_update_mp (opencl_ctx_t *opencl_ctx, const mask_ctx_t *mask_ctx);
|
||||
|
||||
+4
-4
@@ -23,14 +23,14 @@ bool class_alpha (const u8 c);
|
||||
int conv_ctoi (const u8 c);
|
||||
int conv_itoc (const u8 c);
|
||||
|
||||
int generate_random_rule (char rule_buf[RP_RULE_BUFSIZ], u32 rp_gen_func_min, u32 rp_gen_func_max);
|
||||
int generate_random_rule (char rule_buf[RP_RULE_BUFSIZ], const u32 rp_gen_func_min, const u32 rp_gen_func_max);
|
||||
|
||||
int cpu_rule_to_kernel_rule (char *rule_buf, uint rule_len, kernel_rule_t *rule);
|
||||
int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule);
|
||||
|
||||
int rules_ctx_init (rules_ctx_t *rules_ctx, const user_options_t *user_options);
|
||||
void rules_ctx_destroy (rules_ctx_t *rules_ctx);
|
||||
bool kernel_rules_has_noop (const kernel_rule_t *kernel_rules_buf, const u32 kernel_rules_cnt);
|
||||
|
||||
bool rules_ctx_has_noop (rules_ctx_t *rules_ctx);
|
||||
int kernel_rules_load (kernel_rule_t **out_buf, u32 *out_cnt, const user_options_t *user_options);
|
||||
int kernel_rules_generate (kernel_rule_t **out_buf, u32 *out_cnt, const user_options_t *user_options);
|
||||
|
||||
#endif // _RP_H
|
||||
|
||||
+2
-2
@@ -11,8 +11,8 @@
|
||||
|
||||
double get_avg_exec_time (hc_device_param_t *device_param, const int last_num_entries);
|
||||
|
||||
void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hashes_t *hashes, const restore_ctx_t *restore_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const rules_ctx_t *rules_ctx, const mask_ctx_t *mask_ctx);
|
||||
void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const restore_ctx_t *restore_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const rules_ctx_t *rules_ctx, const mask_ctx_t *mask_ctx);
|
||||
void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hashes_t *hashes, const restore_ctx_t *restore_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const straight_ctx_t *straight_ctx, const mask_ctx_t *mask_ctx);
|
||||
void status_display (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const restore_ctx_t *restore_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const straight_ctx_t *straight_ctx, const mask_ctx_t *mask_ctx);
|
||||
void status_benchmark_automate (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig);
|
||||
void status_benchmark (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const user_options_t *user_options);
|
||||
|
||||
|
||||
+1
-1
@@ -20,6 +20,6 @@
|
||||
#include <pwd.h>
|
||||
#endif // _POSIX
|
||||
|
||||
void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const rules_ctx_t *rules_ctx, const mask_ctx_t *mask_ctx, const uint pws_cnt);
|
||||
void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const straight_ctx_t *straight_ctx, const mask_ctx_t *mask_ctx, const uint pws_cnt);
|
||||
|
||||
#endif // _STDOUT_H
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Author......: See docs/credits.txt
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#ifndef _STRAIGHT_H
|
||||
#define _STRAIGHT_H
|
||||
|
||||
#include <string.h>
|
||||
|
||||
int straight_ctx_init (straight_ctx_t *straight_ctx, const user_options_t *user_options);
|
||||
void straight_ctx_destroy (straight_ctx_t *straight_ctx);
|
||||
|
||||
#endif // _STRAIGHT_H
|
||||
+20
-16
@@ -1114,6 +1114,25 @@ typedef struct
|
||||
|
||||
} induct_ctx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool enabled;
|
||||
|
||||
char *root_directory;
|
||||
|
||||
} outcheck_ctx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool enabled;
|
||||
|
||||
char *dictfile;
|
||||
|
||||
u32 kernel_rules_cnt;
|
||||
kernel_rule_t *kernel_rules_buf;
|
||||
|
||||
} straight_ctx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool enabled;
|
||||
@@ -1143,21 +1162,6 @@ typedef struct
|
||||
|
||||
} mask_ctx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool enabled;
|
||||
|
||||
char *root_directory;
|
||||
|
||||
} outcheck_ctx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 kernel_rules_cnt;
|
||||
kernel_rule_t *kernel_rules_buf;
|
||||
|
||||
} rules_ctx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/**
|
||||
@@ -1224,8 +1228,8 @@ typedef struct
|
||||
induct_ctx_t *induct_ctx;
|
||||
outcheck_ctx_t *outcheck_ctx;
|
||||
logfile_ctx_t *logfile_ctx;
|
||||
rules_ctx_t *rules_ctx;
|
||||
restore_ctx_t *restore_ctx;
|
||||
straight_ctx_t *straight_ctx;
|
||||
mask_ctx_t *mask_ctx;
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -6,6 +6,6 @@
|
||||
#ifndef _WEAK_HASH_H
|
||||
#define _WEAK_HASH_H
|
||||
|
||||
void weak_hash_check (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const rules_ctx_t *rules_ctx, hashconfig_t *hashconfig, hashes_t *hashes, const uint salt_pos);
|
||||
void weak_hash_check (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const straight_ctx_t *straight_ctx, hashconfig_t *hashconfig, hashes_t *hashes, const uint salt_pos);
|
||||
|
||||
#endif // _WEAK_HASH_H
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ void get_next_word (wl_data_t *wl_data, const user_options_t *user_options, cons
|
||||
|
||||
void pw_add (hc_device_param_t *device_param, const u8 *pw_buf, const int pw_len);
|
||||
|
||||
u64 count_words (wl_data_t *wl_data, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const rules_ctx_t *rules_ctx, FILE *fd, const char *dictfile, dictstat_ctx_t *dictstat_ctx);
|
||||
u64 count_words (wl_data_t *wl_data, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const straight_ctx_t *straight_ctx, FILE *fd, const char *dictfile, dictstat_ctx_t *dictstat_ctx);
|
||||
|
||||
void wl_data_init (wl_data_t *wl_data, const user_options_t *user_options, const hashconfig_t *hashconfig);
|
||||
void wl_data_destroy (wl_data_t *wl_data);
|
||||
|
||||
Reference in New Issue
Block a user