1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 16:18:09 +00:00

Move around some types and globals were they belong to

This commit is contained in:
jsteube 2016-09-30 09:34:06 +02:00
parent a5800b41f4
commit 0d8b179d40
6 changed files with 136 additions and 140 deletions

View File

@ -10,21 +10,6 @@
#define HLFMTS_CNT 11
typedef enum hlfmt_name
{
HLFMT_HASHCAT = 0,
HLFMT_PWDUMP = 1,
HLFMT_PASSWD = 2,
HLFMT_SHADOW = 3,
HLFMT_DCC = 4,
HLFMT_DCC2 = 5,
HLFMT_NETNTLM1 = 7,
HLFMT_NETNTLM2 = 8,
HLFMT_NSLDAP = 9,
HLFMT_NSLDAPS = 10
} hlfmt_name_t;
char *strhlfmt (const uint hashfile_format);
void hlfmt_hash (uint hashfile_format, char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len, const hashconfig_t *hashconfig, const user_options_t *user_options);

View File

@ -683,35 +683,7 @@ typedef struct
} hccap_t;
/**
* parser
*/
typedef enum parser_rc
{
PARSER_OK = 0,
PARSER_COMMENT = -1,
PARSER_GLOBAL_ZERO = -2,
PARSER_GLOBAL_LENGTH = -3,
PARSER_HASH_LENGTH = -4,
PARSER_HASH_VALUE = -5,
PARSER_SALT_LENGTH = -6,
PARSER_SALT_VALUE = -7,
PARSER_SALT_ITERATION = -8,
PARSER_SEPARATOR_UNMATCHED = -9,
PARSER_SIGNATURE_UNMATCHED = -10,
PARSER_HCCAP_FILE_SIZE = -11,
PARSER_HCCAP_EAPOL_SIZE = -12,
PARSER_PSAFE2_FILE_SIZE = -13,
PARSER_PSAFE3_FILE_SIZE = -14,
PARSER_TC_FILE_SIZE = -15,
PARSER_VC_FILE_SIZE = -16,
PARSER_SIP_AUTH_DIRECTIVE = -17,
PARSER_UNKNOWN_ERROR = -255
} parser_rc_t;
/**
* hashtypes cleartext
* hashtypes enums
*/
typedef enum display_len

View File

@ -10,15 +10,6 @@
#include <time.h>
#include <inttypes.h>
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;
void outfile_init (outfile_ctx_t *outfile_ctx, const user_options_t *user_options);
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);

View File

@ -317,6 +317,54 @@ typedef enum attack_exec
} attack_exec_t;
typedef enum hlfmt_name
{
HLFMT_HASHCAT = 0,
HLFMT_PWDUMP = 1,
HLFMT_PASSWD = 2,
HLFMT_SHADOW = 3,
HLFMT_DCC = 4,
HLFMT_DCC2 = 5,
HLFMT_NETNTLM1 = 7,
HLFMT_NETNTLM2 = 8,
HLFMT_NSLDAP = 9,
HLFMT_NSLDAPS = 10
} hlfmt_name_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;
typedef enum parser_rc
{
PARSER_OK = 0,
PARSER_COMMENT = -1,
PARSER_GLOBAL_ZERO = -2,
PARSER_GLOBAL_LENGTH = -3,
PARSER_HASH_LENGTH = -4,
PARSER_HASH_VALUE = -5,
PARSER_SALT_LENGTH = -6,
PARSER_SALT_VALUE = -7,
PARSER_SALT_ITERATION = -8,
PARSER_SEPARATOR_UNMATCHED = -9,
PARSER_SIGNATURE_UNMATCHED = -10,
PARSER_HCCAP_FILE_SIZE = -11,
PARSER_HCCAP_EAPOL_SIZE = -12,
PARSER_PSAFE2_FILE_SIZE = -13,
PARSER_PSAFE3_FILE_SIZE = -14,
PARSER_TC_FILE_SIZE = -15,
PARSER_VC_FILE_SIZE = -16,
PARSER_SIP_AUTH_DIRECTIVE = -17,
PARSER_UNKNOWN_ERROR = -255
} parser_rc_t;
/**
* structs
*/

View File

@ -156,93 +156,6 @@ typedef enum user_options_map
} user_options_map_t;
static const char short_options[] = "hVvm:a:r:j:k:g:o:t:d:D:n:u:c:p:s:l:1:2:3:4:iIbw:";
static const struct option long_options[] =
{
{"help", no_argument, 0, IDX_HELP},
{"version", no_argument, 0, IDX_VERSION},
{"quiet", no_argument, 0, IDX_QUIET},
{"show", no_argument, 0, IDX_SHOW},
{"left", no_argument, 0, IDX_LEFT},
{"username", no_argument, 0, IDX_USERNAME},
{"remove", no_argument, 0, IDX_REMOVE},
{"remove-timer", required_argument, 0, IDX_REMOVE_TIMER},
{"skip", required_argument, 0, IDX_SKIP},
{"limit", required_argument, 0, IDX_LIMIT},
{"keyspace", no_argument, 0, IDX_KEYSPACE},
{"potfile-disable", no_argument, 0, IDX_POTFILE_DISABLE},
{"potfile-path", required_argument, 0, IDX_POTFILE_PATH},
{"debug-mode", required_argument, 0, IDX_DEBUG_MODE},
{"debug-file", required_argument, 0, IDX_DEBUG_FILE},
{"induction-dir", required_argument, 0, IDX_INDUCTION_DIR},
{"outfile-check-dir", required_argument, 0, IDX_OUTFILE_CHECK_DIR},
{"force", no_argument, 0, IDX_FORCE},
{"benchmark", no_argument, 0, IDX_BENCHMARK},
{"stdout", no_argument, 0, IDX_STDOUT_FLAG},
{"restore", no_argument, 0, IDX_RESTORE},
{"restore-disable", no_argument, 0, IDX_RESTORE_DISABLE},
{"status", no_argument, 0, IDX_STATUS},
{"status-timer", required_argument, 0, IDX_STATUS_TIMER},
{"machine-readable", no_argument, 0, IDX_MACHINE_READABLE},
{"loopback", no_argument, 0, IDX_LOOPBACK},
{"weak-hash-threshold", required_argument, 0, IDX_WEAK_HASH_THRESHOLD},
{"session", required_argument, 0, IDX_SESSION},
{"runtime", required_argument, 0, IDX_RUNTIME},
{"generate-rules", required_argument, 0, IDX_RP_GEN},
{"generate-rules-func-min", required_argument, 0, IDX_RP_GEN_FUNC_MIN},
{"generate-rules-func-max", required_argument, 0, IDX_RP_GEN_FUNC_MAX},
{"generate-rules-seed", required_argument, 0, IDX_RP_GEN_SEED},
{"rule-left", required_argument, 0, IDX_RULE_BUF_L},
{"rule-right", required_argument, 0, IDX_RULE_BUF_R},
{"hash-type", required_argument, 0, IDX_HASH_MODE},
{"attack-mode", required_argument, 0, IDX_ATTACK_MODE},
{"rules-file", required_argument, 0, IDX_RP_FILE},
{"outfile", required_argument, 0, IDX_OUTFILE},
{"outfile-format", required_argument, 0, IDX_OUTFILE_FORMAT},
{"outfile-autohex-disable", no_argument, 0, IDX_OUTFILE_AUTOHEX_DISABLE},
{"outfile-check-timer", required_argument, 0, IDX_OUTFILE_CHECK_TIMER},
{"hex-charset", no_argument, 0, IDX_HEX_CHARSET},
{"hex-salt", no_argument, 0, IDX_HEX_SALT},
{"hex-wordlist", no_argument, 0, IDX_HEX_WORDLIST},
{"markov-disable", no_argument, 0, IDX_MARKOV_DISABLE},
{"markov-classic", no_argument, 0, IDX_MARKOV_CLASSIC},
{"markov-threshold", required_argument, 0, IDX_MARKOV_THRESHOLD},
{"markov-hcstat", required_argument, 0, IDX_MARKOV_HCSTAT},
{"cpu-affinity", required_argument, 0, IDX_CPU_AFFINITY},
{"opencl-info", no_argument, 0, IDX_OPENCL_INFO},
{"opencl-devices", required_argument, 0, IDX_OPENCL_DEVICES},
{"opencl-platforms", required_argument, 0, IDX_OPENCL_PLATFORMS},
{"opencl-device-types", required_argument, 0, IDX_OPENCL_DEVICE_TYPES},
{"opencl-vector-width", required_argument, 0, IDX_OPENCL_VECTOR_WIDTH},
{"workload-profile", required_argument, 0, IDX_WORKLOAD_PROFILE},
{"kernel-accel", required_argument, 0, IDX_KERNEL_ACCEL},
{"kernel-loops", required_argument, 0, IDX_KERNEL_LOOPS},
{"nvidia-spin-damp", required_argument, 0, IDX_NVIDIA_SPIN_DAMP},
{"gpu-temp-disable", no_argument, 0, IDX_GPU_TEMP_DISABLE},
{"gpu-temp-abort", required_argument, 0, IDX_GPU_TEMP_ABORT},
{"gpu-temp-retain", required_argument, 0, IDX_GPU_TEMP_RETAIN},
{"powertune-enable", no_argument, 0, IDX_POWERTUNE_ENABLE},
{"logfile-disable", no_argument, 0, IDX_LOGFILE_DISABLE},
{"truecrypt-keyfiles", required_argument, 0, IDX_TRUECRYPT_KEYFILES},
{"veracrypt-keyfiles", required_argument, 0, IDX_VERACRYPT_KEYFILES},
{"veracrypt-pim", required_argument, 0, IDX_VERACRYPT_PIM},
{"segment-size", required_argument, 0, IDX_SEGMENT_SIZE},
{"scrypt-tmto", required_argument, 0, IDX_SCRYPT_TMTO},
{"seperator", required_argument, 0, IDX_SEPARATOR},
{"separator", required_argument, 0, IDX_SEPARATOR},
{"bitmap-min", required_argument, 0, IDX_BITMAP_MIN},
{"bitmap-max", required_argument, 0, IDX_BITMAP_MAX},
{"increment", no_argument, 0, IDX_INCREMENT},
{"increment-min", required_argument, 0, IDX_INCREMENT_MIN},
{"increment-max", required_argument, 0, IDX_INCREMENT_MAX},
{"custom-charset1", required_argument, 0, IDX_CUSTOM_CHARSET_1},
{"custom-charset2", required_argument, 0, IDX_CUSTOM_CHARSET_2},
{"custom-charset3", required_argument, 0, IDX_CUSTOM_CHARSET_3},
{"custom-charset4", required_argument, 0, IDX_CUSTOM_CHARSET_4},
{0, 0, 0, 0}
};
void user_options_init (user_options_t *user_options);
void user_options_destroy (user_options_t *user_options);

View File

@ -14,6 +14,93 @@
#include "outfile.h"
#include "user_options.h"
static const char short_options[] = "hVvm:a:r:j:k:g:o:t:d:D:n:u:c:p:s:l:1:2:3:4:iIbw:";
static const struct option long_options[] =
{
{"help", no_argument, 0, IDX_HELP},
{"version", no_argument, 0, IDX_VERSION},
{"quiet", no_argument, 0, IDX_QUIET},
{"show", no_argument, 0, IDX_SHOW},
{"left", no_argument, 0, IDX_LEFT},
{"username", no_argument, 0, IDX_USERNAME},
{"remove", no_argument, 0, IDX_REMOVE},
{"remove-timer", required_argument, 0, IDX_REMOVE_TIMER},
{"skip", required_argument, 0, IDX_SKIP},
{"limit", required_argument, 0, IDX_LIMIT},
{"keyspace", no_argument, 0, IDX_KEYSPACE},
{"potfile-disable", no_argument, 0, IDX_POTFILE_DISABLE},
{"potfile-path", required_argument, 0, IDX_POTFILE_PATH},
{"debug-mode", required_argument, 0, IDX_DEBUG_MODE},
{"debug-file", required_argument, 0, IDX_DEBUG_FILE},
{"induction-dir", required_argument, 0, IDX_INDUCTION_DIR},
{"outfile-check-dir", required_argument, 0, IDX_OUTFILE_CHECK_DIR},
{"force", no_argument, 0, IDX_FORCE},
{"benchmark", no_argument, 0, IDX_BENCHMARK},
{"stdout", no_argument, 0, IDX_STDOUT_FLAG},
{"restore", no_argument, 0, IDX_RESTORE},
{"restore-disable", no_argument, 0, IDX_RESTORE_DISABLE},
{"status", no_argument, 0, IDX_STATUS},
{"status-timer", required_argument, 0, IDX_STATUS_TIMER},
{"machine-readable", no_argument, 0, IDX_MACHINE_READABLE},
{"loopback", no_argument, 0, IDX_LOOPBACK},
{"weak-hash-threshold", required_argument, 0, IDX_WEAK_HASH_THRESHOLD},
{"session", required_argument, 0, IDX_SESSION},
{"runtime", required_argument, 0, IDX_RUNTIME},
{"generate-rules", required_argument, 0, IDX_RP_GEN},
{"generate-rules-func-min", required_argument, 0, IDX_RP_GEN_FUNC_MIN},
{"generate-rules-func-max", required_argument, 0, IDX_RP_GEN_FUNC_MAX},
{"generate-rules-seed", required_argument, 0, IDX_RP_GEN_SEED},
{"rule-left", required_argument, 0, IDX_RULE_BUF_L},
{"rule-right", required_argument, 0, IDX_RULE_BUF_R},
{"hash-type", required_argument, 0, IDX_HASH_MODE},
{"attack-mode", required_argument, 0, IDX_ATTACK_MODE},
{"rules-file", required_argument, 0, IDX_RP_FILE},
{"outfile", required_argument, 0, IDX_OUTFILE},
{"outfile-format", required_argument, 0, IDX_OUTFILE_FORMAT},
{"outfile-autohex-disable", no_argument, 0, IDX_OUTFILE_AUTOHEX_DISABLE},
{"outfile-check-timer", required_argument, 0, IDX_OUTFILE_CHECK_TIMER},
{"hex-charset", no_argument, 0, IDX_HEX_CHARSET},
{"hex-salt", no_argument, 0, IDX_HEX_SALT},
{"hex-wordlist", no_argument, 0, IDX_HEX_WORDLIST},
{"markov-disable", no_argument, 0, IDX_MARKOV_DISABLE},
{"markov-classic", no_argument, 0, IDX_MARKOV_CLASSIC},
{"markov-threshold", required_argument, 0, IDX_MARKOV_THRESHOLD},
{"markov-hcstat", required_argument, 0, IDX_MARKOV_HCSTAT},
{"cpu-affinity", required_argument, 0, IDX_CPU_AFFINITY},
{"opencl-info", no_argument, 0, IDX_OPENCL_INFO},
{"opencl-devices", required_argument, 0, IDX_OPENCL_DEVICES},
{"opencl-platforms", required_argument, 0, IDX_OPENCL_PLATFORMS},
{"opencl-device-types", required_argument, 0, IDX_OPENCL_DEVICE_TYPES},
{"opencl-vector-width", required_argument, 0, IDX_OPENCL_VECTOR_WIDTH},
{"workload-profile", required_argument, 0, IDX_WORKLOAD_PROFILE},
{"kernel-accel", required_argument, 0, IDX_KERNEL_ACCEL},
{"kernel-loops", required_argument, 0, IDX_KERNEL_LOOPS},
{"nvidia-spin-damp", required_argument, 0, IDX_NVIDIA_SPIN_DAMP},
{"gpu-temp-disable", no_argument, 0, IDX_GPU_TEMP_DISABLE},
{"gpu-temp-abort", required_argument, 0, IDX_GPU_TEMP_ABORT},
{"gpu-temp-retain", required_argument, 0, IDX_GPU_TEMP_RETAIN},
{"powertune-enable", no_argument, 0, IDX_POWERTUNE_ENABLE},
{"logfile-disable", no_argument, 0, IDX_LOGFILE_DISABLE},
{"truecrypt-keyfiles", required_argument, 0, IDX_TRUECRYPT_KEYFILES},
{"veracrypt-keyfiles", required_argument, 0, IDX_VERACRYPT_KEYFILES},
{"veracrypt-pim", required_argument, 0, IDX_VERACRYPT_PIM},
{"segment-size", required_argument, 0, IDX_SEGMENT_SIZE},
{"scrypt-tmto", required_argument, 0, IDX_SCRYPT_TMTO},
{"seperator", required_argument, 0, IDX_SEPARATOR},
{"separator", required_argument, 0, IDX_SEPARATOR},
{"bitmap-min", required_argument, 0, IDX_BITMAP_MIN},
{"bitmap-max", required_argument, 0, IDX_BITMAP_MAX},
{"increment", no_argument, 0, IDX_INCREMENT},
{"increment-min", required_argument, 0, IDX_INCREMENT_MIN},
{"increment-max", required_argument, 0, IDX_INCREMENT_MAX},
{"custom-charset1", required_argument, 0, IDX_CUSTOM_CHARSET_1},
{"custom-charset2", required_argument, 0, IDX_CUSTOM_CHARSET_2},
{"custom-charset3", required_argument, 0, IDX_CUSTOM_CHARSET_3},
{"custom-charset4", required_argument, 0, IDX_CUSTOM_CHARSET_4},
{0, 0, 0, 0}
};
static char RULE_BUF_R[] = ":";
static char RULE_BUF_L[] = ":";