Move outfile specific functions into their own source file
This commit is contained in:
@@ -43,7 +43,6 @@
|
||||
|
||||
#define MAX_CUT_TRIES 4
|
||||
|
||||
|
||||
#define CEIL(a) ((a - (int) (a)) > 0 ? a + 1 : a)
|
||||
|
||||
#if defined (__APPLE__)
|
||||
|
||||
+3
-3
@@ -135,9 +135,7 @@ typedef struct
|
||||
char *profile_dir;
|
||||
char *session_dir;
|
||||
char *shared_dir;
|
||||
char *outfile;
|
||||
uint outfile_format;
|
||||
uint outfile_autohex;
|
||||
|
||||
uint outfile_check_timer;
|
||||
char *eff_restore_file;
|
||||
char *new_restore_file;
|
||||
@@ -178,6 +176,8 @@ typedef struct
|
||||
|
||||
hashconfig_t *hashconfig;
|
||||
|
||||
outfile_ctx_t *outfile_ctx;
|
||||
|
||||
potfile_ctx_t *potfile_ctx;
|
||||
|
||||
#if defined (HAVE_HWMON)
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define HLFMTS_CNT 11
|
||||
|
||||
typedef enum hlfmt_name
|
||||
{
|
||||
HLFMT_HASHCAT = 0,
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Authors.....: Jens Steube <jens.steube@gmail.com>
|
||||
* License.....: MIT
|
||||
*/
|
||||
|
||||
#ifndef _OUTFILE_H
|
||||
#define _OUTFILE_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#define OUTFILE_FORMAT 3
|
||||
#define OUTFILE_AUTOHEX 1
|
||||
|
||||
typedef enum outfile_fmt
|
||||
{
|
||||
OUTFILE_FMT_HASH = (1 << 0),
|
||||
OUTFILE_FMT_PLAIN = (1 << 1),
|
||||
OUTFILE_FMT_HEXPLAIN = (1 << 2),
|
||||
OUTFILE_FMT_CRACKPOS = (1 << 3)
|
||||
|
||||
} outfile_fmt_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *filename;
|
||||
|
||||
FILE *fp;
|
||||
|
||||
uint outfile_format;
|
||||
uint outfile_autohex;
|
||||
|
||||
} outfile_ctx_t;
|
||||
|
||||
void outfile_init (outfile_ctx_t *outfile_ctx, char *outfile, const uint outfile_format, const uint outfile_autohex);
|
||||
void outfile_destroy (outfile_ctx_t *outfile_ctx);
|
||||
void outfile_format_plain (outfile_ctx_t *outfile_ctx, const unsigned char *plain_ptr, const uint plain_len);
|
||||
void outfile_write_open (outfile_ctx_t *outfile_ctx);
|
||||
void outfile_write_close (outfile_ctx_t *outfile_ctx);
|
||||
void outfile_write (outfile_ctx_t *outfile_ctx, const char *out_buf, const unsigned char *plain_ptr, const uint plain_len, const u64 crackpos, const unsigned char *username, const uint user_len, const hashconfig_t *hashconfig);
|
||||
|
||||
#endif // _OUTFILE_H
|
||||
+5
-4
@@ -42,6 +42,7 @@ int sort_by_hash_t_salt (const void *v1, const void *v2);
|
||||
int sort_by_hash_t_salt_hccap (const void *v1, const void *v2);
|
||||
|
||||
void potfile_init (potfile_ctx_t *potfile_ctx, const char *profile_dir, const char *potfile_path);
|
||||
void potfile_format_plain (potfile_ctx_t *potfile_ctx, const unsigned char *plain_ptr, const uint plain_len);
|
||||
int potfile_read_open (potfile_ctx_t *potfile_ctx);
|
||||
void potfile_read_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig);
|
||||
void potfile_read_close (potfile_ctx_t *potfile_ctx);
|
||||
@@ -50,10 +51,10 @@ void potfile_write_close (potfile_ctx_t *potfile_ctx);
|
||||
void potfile_write_append (potfile_ctx_t *potfile_ctx, const char *out_buf, u8 *plain_ptr, unsigned int plain_len);
|
||||
void potfile_hash_alloc (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, const uint num);
|
||||
void potfile_hash_free (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig);
|
||||
void potfile_show_request (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
|
||||
void potfile_left_request (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
|
||||
void potfile_show_request_lm (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
|
||||
void potfile_left_request_lm (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *), FILE *out_fp);
|
||||
void potfile_show_request (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, outfile_ctx_t *outfile_ctx, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *));
|
||||
void potfile_left_request (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, outfile_ctx_t *outfile_ctx, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *));
|
||||
void potfile_show_request_lm (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, outfile_ctx_t *outfile_ctx, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *));
|
||||
void potfile_left_request_lm (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, outfile_ctx_t *outfile_ctx, char *input_buf, int input_len, hash_t *hash_left, hash_t *hash_right, int (*sort_by_pot) (const void *, const void *));
|
||||
int potfile_remove_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, const hash_t *hashes_buf, const uint hashes_cnt);
|
||||
void potfile_destroy (potfile_ctx_t *potfile_ctx);
|
||||
|
||||
|
||||
+8
-28
@@ -13,11 +13,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/**
|
||||
* Outfile formats
|
||||
*/
|
||||
|
||||
#define OUTFILES_DIR "outfiles"
|
||||
|
||||
typedef enum wl_mode
|
||||
{
|
||||
@@ -34,8 +30,14 @@ typedef enum hl_mode
|
||||
|
||||
} hl_mode_t;
|
||||
|
||||
#define HLFMTS_CNT 11
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *file_name;
|
||||
long seek;
|
||||
time_t ctime;
|
||||
|
||||
} outfile_data_t;
|
||||
|
||||
|
||||
typedef enum attack_mode
|
||||
@@ -86,14 +88,7 @@ typedef enum kern_run_mp
|
||||
|
||||
} kern_run_mp_t;
|
||||
|
||||
typedef enum outfile_fmt
|
||||
{
|
||||
OUTFILE_FMT_HASH = (1 << 0),
|
||||
OUTFILE_FMT_PLAIN = (1 << 1),
|
||||
OUTFILE_FMT_HEXPLAIN = (1 << 2),
|
||||
OUTFILE_FMT_CRACKPOS = (1 << 3)
|
||||
|
||||
} outfile_fmt_t;
|
||||
|
||||
/**
|
||||
* status
|
||||
@@ -186,13 +181,7 @@ typedef struct
|
||||
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *file_name;
|
||||
long seek;
|
||||
time_t ctime;
|
||||
|
||||
} outfile_data_t;
|
||||
|
||||
|
||||
|
||||
@@ -205,15 +194,6 @@ typedef struct
|
||||
|
||||
} cpt_t;
|
||||
|
||||
/*
|
||||
typedef struct
|
||||
{
|
||||
uint plain_buf[16];
|
||||
uint plain_len;
|
||||
|
||||
} plain_t;
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint salt_pos;
|
||||
|
||||
Reference in New Issue
Block a user