Module Structure: Add 3rd party library hook management functions. This also requires an update to all existing module_init()
This commit is contained in:
+6
-2
@@ -71,8 +71,12 @@ bool module_jit_cache_disable (MAYBE_UNUSED const hashconfig_t *ha
|
||||
u32 module_deep_comp_kernel (MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const u32 salt_pos, MAYBE_UNUSED const u32 digest_pos);
|
||||
int module_hash_init_selftest (MAYBE_UNUSED const hashconfig_t *hashconfig, hash_t *hash);
|
||||
|
||||
void module_hook12 (hc_device_param_t *device_param, const void *hook_salts_buf, const u32 salt_pos, const u64 pw_pos);
|
||||
void module_hook23 (hc_device_param_t *device_param, const void *hook_salts_buf, const u32 salt_pos, const u64 pw_pos);
|
||||
u64 module_hook_extra_param_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra);
|
||||
bool module_hook_extra_param_init (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const folder_config_t *folder_config, MAYBE_UNUSED const backend_ctx_t *backend_ctx, void *hook_extra_param);
|
||||
bool module_hook_extra_param_term (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra, MAYBE_UNUSED const folder_config_t *folder_config, MAYBE_UNUSED const backend_ctx_t *backend_ctx, void *hook_extra_param);
|
||||
|
||||
void module_hook12 (hc_device_param_t *device_param, MAYBE_UNUSED const void *hook_extra_param, MAYBE_UNUSED const void *hook_salts_buf, const u32 salt_pos, const u64 pw_pos);
|
||||
void module_hook23 (hc_device_param_t *device_param, MAYBE_UNUSED const void *hook_extra_param, MAYBE_UNUSED const void *hook_salts_buf, const u32 salt_pos, const u64 pw_pos);
|
||||
|
||||
int module_build_plain_postprocess (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const hashes_t *hashes, MAYBE_UNUSED const void *tmps, const u32 *src_buf, MAYBE_UNUSED const size_t src_sz, MAYBE_UNUSED const int src_len, u32 *dst_buf, MAYBE_UNUSED const size_t dst_sz);
|
||||
|
||||
|
||||
+10
-2
@@ -947,6 +947,7 @@ struct hashconfig
|
||||
// sizes have to be size_t
|
||||
|
||||
u64 esalt_size;
|
||||
u64 hook_extra_param_size;
|
||||
u64 hook_salt_size;
|
||||
u64 tmp_size;
|
||||
u64 extra_tmp_size;
|
||||
@@ -2440,6 +2441,8 @@ typedef struct module_ctx
|
||||
|
||||
MODULE_INIT module_init;
|
||||
|
||||
void **hook_extra_params; // free for module to use (for instance: library handles)
|
||||
|
||||
u32 (*module_attack_exec) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
|
||||
void *(*module_benchmark_esalt) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
|
||||
void *(*module_benchmark_hook_salt) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
|
||||
@@ -2505,8 +2508,12 @@ typedef struct module_ctx
|
||||
u32 (*module_deep_comp_kernel) (const hashes_t *, const u32, const u32);
|
||||
int (*module_hash_init_selftest) (const hashconfig_t *, hash_t *);
|
||||
|
||||
void (*module_hook12) (hc_device_param_t *, const void *, const u32, const u64);
|
||||
void (*module_hook23) (hc_device_param_t *, const void *, const u32, const u64);
|
||||
u64 (*module_hook_extra_param_size) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *);
|
||||
bool (*module_hook_extra_param_init) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *, const folder_config_t *, const backend_ctx_t *, void *);
|
||||
bool (*module_hook_extra_param_term) (const hashconfig_t *, const user_options_t *, const user_options_extra_t *, const folder_config_t *, const backend_ctx_t *, void *);
|
||||
|
||||
void (*module_hook12) (hc_device_param_t *, const void *, const void *, const u32, const u64);
|
||||
void (*module_hook23) (hc_device_param_t *, const void *, const void *, const u32, const u64);
|
||||
|
||||
int (*module_build_plain_postprocess) (const hashconfig_t *, const hashes_t *, const void *, const u32 *, const size_t, const int, u32 *, const size_t);
|
||||
|
||||
@@ -2569,6 +2576,7 @@ typedef struct hook_thread_param
|
||||
|
||||
hc_device_param_t *device_param;
|
||||
|
||||
void *hook_extra_param;
|
||||
void *hook_salts_buf;
|
||||
|
||||
u32 salt_pos;
|
||||
|
||||
Reference in New Issue
Block a user