1
mirror of https://github.com/hashcat/hashcat synced 2024-11-24 14:27:14 +01:00
hashcat/include/modules.h
Jens Steube 55add7c60e The goal of this branch to develop a plugin like interface for hashcat kernels.
The modification of existing core source files to add new hashcat kernels conflicts with the idea of having private hashcat kernel repositories especially when backporting latest hashcat core changes and new features.
The final outcome of this should be a plugin format that does not require modifications on the core soruce files.
Also convert all existing hash-modes to hashcat modules.
We'll start with dynamic loading the modules at runtime rather than linking them at compile time.
This will require some extra code for different OS types but should beneficial on a long term.
This commit add some first ideas of how such modules could look like, however there's no dynamic loading interface yet.
Next steps will be removing all hash-mode depending special code from source files and move them to the modules.
Finally merge with master.
2018-12-06 14:02:10 +01:00

49 lines
2.3 KiB
C

#ifndef _MODULES_H
#define _MODULES_H
typedef struct hashcat_module
{
const char *(*module_hash_name) ();
u32 (*module_salt_type) ();
u32 (*module_attack_exec) ();
u64 (*module_opts_type) ();
u32 (*module_dgst_size) ();
u32 (*module_opti_type) ();
u32 (*module_dgst_pos0) ();
u32 (*module_dgst_pos1) ();
u32 (*module_dgst_pos2) ();
u32 (*module_dgst_pos3) ();
const char *(*module_st_hash) ();
const char *(*module_st_pass) ();
u32 (*module_pw_min) (const hashcat_ctx_t *);
u32 (*module_pw_max) (const hashcat_ctx_t *);
u32 (*module_salt_min) (const hashcat_ctx_t *);
u32 (*module_salt_max) (const hashcat_ctx_t *);
int (*module_hash_decode) (const hashcat_ctx_t *, const u8 *, const int, hash_t *);
int (*module_hash_encode) (const hashcat_ctx_t *, const void *, const salt_t *, const void *, u8 *, const size_t);
} hashcat_module_t;
const char *module_hash_name ();
u32 module_salt_type ();
u32 module_attack_exec ();
u64 module_opts_type ();
u32 module_dgst_size ();
u32 module_opti_type ();
u32 module_dgst_pos0 ();
u32 module_dgst_pos1 ();
u32 module_dgst_pos2 ();
u32 module_dgst_pos3 ();
const char *module_st_hash ();
const char *module_st_pass ();
u32 module_pw_min (MAYBE_UNUSED const hashcat_ctx_t *hashcat_ctx);
u32 module_pw_max (MAYBE_UNUSED const hashcat_ctx_t *hashcat_ctx);
u32 module_salt_min (MAYBE_UNUSED const hashcat_ctx_t *hashcat_ctx);
u32 module_salt_max (MAYBE_UNUSED const hashcat_ctx_t *hashcat_ctx);
int module_hash_decode (MAYBE_UNUSED const hashcat_ctx_t *hashcat_ctx, const u8 *input_buf, const int input_len, hash_t *hash_buf);
int module_hash_encode (MAYBE_UNUSED const hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *digest, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt, u8 *output_buf, const size_t output_size);
void module_register (hashcat_module_t *hashcat_module);
#endif // _MODULES_H