mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-15 12:29:35 +00:00
227 lines
2.8 KiB
C
227 lines
2.8 KiB
C
/**
|
|
* Authors.....: Jens Steube <jens.steube@gmail.com>
|
|
* Gabriele Gristina <matrix@hashcat.net>
|
|
*
|
|
* License.....: MIT
|
|
*/
|
|
|
|
#ifndef _TYPES_H
|
|
#define _TYPES_H
|
|
|
|
#include <stdio.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <string.h>
|
|
|
|
#define OUTFILES_DIR "outfiles"
|
|
|
|
typedef enum wl_mode
|
|
{
|
|
WL_MODE_STDIN = 1,
|
|
WL_MODE_FILE = 2,
|
|
WL_MODE_MASK = 3
|
|
|
|
} wl_mode_t;
|
|
|
|
typedef enum hl_mode
|
|
{
|
|
HL_MODE_FILE = 4,
|
|
HL_MODE_ARG = 5
|
|
|
|
} hl_mode_t;
|
|
|
|
|
|
typedef struct
|
|
{
|
|
char *file_name;
|
|
long seek;
|
|
time_t ctime;
|
|
|
|
} outfile_data_t;
|
|
|
|
|
|
typedef enum attack_mode
|
|
{
|
|
ATTACK_MODE_STRAIGHT = 0,
|
|
ATTACK_MODE_COMBI = 1,
|
|
ATTACK_MODE_TOGGLE = 2,
|
|
ATTACK_MODE_BF = 3,
|
|
ATTACK_MODE_PERM = 4,
|
|
ATTACK_MODE_TABLE = 5,
|
|
ATTACK_MODE_HYBRID1 = 6,
|
|
ATTACK_MODE_HYBRID2 = 7,
|
|
ATTACK_MODE_NONE = 100
|
|
|
|
} attack_mode_t;
|
|
|
|
typedef enum attack_kern
|
|
{
|
|
ATTACK_KERN_STRAIGHT = 0,
|
|
ATTACK_KERN_COMBI = 1,
|
|
ATTACK_KERN_BF = 3,
|
|
ATTACK_KERN_NONE = 100
|
|
|
|
} attack_kern_t;
|
|
|
|
typedef enum combinator_mode
|
|
{
|
|
COMBINATOR_MODE_BASE_LEFT = 10001,
|
|
COMBINATOR_MODE_BASE_RIGHT = 10002
|
|
|
|
} combinator_mode_t;
|
|
|
|
typedef enum kern_run
|
|
{
|
|
KERN_RUN_1 = 1000,
|
|
KERN_RUN_12 = 1500,
|
|
KERN_RUN_2 = 2000,
|
|
KERN_RUN_23 = 2500,
|
|
KERN_RUN_3 = 3000
|
|
|
|
} kern_run_t;
|
|
|
|
typedef enum kern_run_mp
|
|
{
|
|
KERN_RUN_MP = 101,
|
|
KERN_RUN_MP_L = 102,
|
|
KERN_RUN_MP_R = 103
|
|
|
|
} kern_run_mp_t;
|
|
|
|
|
|
|
|
/**
|
|
* status
|
|
*/
|
|
|
|
|
|
|
|
typedef struct
|
|
{
|
|
uint salt_buf[16];
|
|
uint salt_buf_pc[8];
|
|
|
|
uint salt_len;
|
|
uint salt_iter;
|
|
uint salt_sign[2];
|
|
|
|
uint keccak_mdlen;
|
|
uint truecrypt_mdlen;
|
|
|
|
uint digests_cnt;
|
|
uint digests_done;
|
|
|
|
uint digests_offset;
|
|
|
|
uint scrypt_N;
|
|
uint scrypt_r;
|
|
uint scrypt_p;
|
|
|
|
} salt_t;
|
|
|
|
typedef struct
|
|
{
|
|
char *user_name;
|
|
uint user_len;
|
|
|
|
} user_t;
|
|
|
|
typedef struct
|
|
{
|
|
user_t *user;
|
|
char *orighash;
|
|
|
|
} hashinfo_t;
|
|
|
|
typedef struct
|
|
{
|
|
void *digest;
|
|
salt_t *salt;
|
|
void *esalt;
|
|
int cracked;
|
|
hashinfo_t *hash_info;
|
|
|
|
} hash_t;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
{
|
|
u32 i[16];
|
|
|
|
u32 pw_len;
|
|
|
|
u32 alignment_placeholder_1;
|
|
u32 alignment_placeholder_2;
|
|
u32 alignment_placeholder_3;
|
|
|
|
} pw_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint i;
|
|
|
|
} bf_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint b[32];
|
|
|
|
} bs_word_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint i[8];
|
|
|
|
uint pw_len;
|
|
|
|
} comb_t;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define CPT_BUF 0x20000
|
|
|
|
typedef struct
|
|
{
|
|
uint cracked;
|
|
time_t timestamp;
|
|
|
|
} cpt_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint salt_pos;
|
|
uint digest_pos;
|
|
uint hash_pos;
|
|
uint gidvid;
|
|
uint il_pos;
|
|
|
|
} plain_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint word_buf[16];
|
|
|
|
} wordl_t;
|
|
|
|
typedef struct
|
|
{
|
|
uint word_buf[1];
|
|
|
|
} wordr_t;
|
|
|
|
#define RULES_MAX 256
|
|
#define PW_MIN 0
|
|
#define PW_MAX 54
|
|
#define PW_MAX1 (PW_MAX + 1)
|
|
#define PW_DICTMAX 31
|
|
#define PW_DICTMAX1 (PW_DICTMAX + 1)
|
|
|
|
#endif // _TYPES_H
|