1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-03-25 11:55:42 +00:00

Add main_potfile_remove_parse_post()

This commit is contained in:
jsteube 2016-10-10 11:10:04 +02:00
parent f962a38221
commit 6d2c58d8df
3 changed files with 77 additions and 62 deletions

View File

@ -77,39 +77,40 @@ typedef struct stat64 hc_stat;
typedef enum event_identifier
{
EVENT_LOG_INFO = 0x00000001,
EVENT_LOG_WARNING = 0x00000002,
EVENT_LOG_ERROR = 0x00000003,
EVENT_WELCOME_SCREEN = 0x00000011,
EVENT_GOODBYE_SCREEN = 0x00000012,
EVENT_LOGFILE_TOP_INITIALIZE = 0x00000021,
EVENT_LOGFILE_TOP_FINALIZE = 0x00000022,
EVENT_LOGFILE_SUB_INITIALIZE = 0x00000023,
EVENT_LOGFILE_SUB_FINALIZE = 0x00000024,
EVENT_OUTERLOOP_STARTING = 0x00000031,
EVENT_OUTERLOOP_MAINSCREEN = 0x00000032,
EVENT_OUTERLOOP_FINISHED = 0x00000033,
EVENT_INNERLOOP1_STARTING = 0x00000041,
EVENT_INNERLOOP1_FINISHED = 0x00000042,
EVENT_INNERLOOP2_STARTING = 0x00000051,
EVENT_INNERLOOP2_FINISHED = 0x00000052,
EVENT_CALCULATED_WORDS_BASE = 0x00000059,
EVENT_AUTOTUNE_STARTING = 0x00000053,
EVENT_AUTOTUNE_FINISHED = 0x00000054,
EVENT_CRACKER_STARTING = 0x00000055,
EVENT_CRACKER_FINISHED = 0x00000056,
EVENT_CRACKER_FINAL_STATS = 0x00000057,
EVENT_CRACKER_HASH_CRACKED = 0x00000058,
EVENT_POTFILE_REMOVE_PARSE = 0x00000061,
EVENT_POTFILE_NUM_CRACKED = 0x00000062,
EVENT_POTFILE_ALL_CRACKED = 0x00000063,
EVENT_OPENCL_SESSION_PRE = 0x00000071,
EVENT_OPENCL_SESSION_POST = 0x00000072,
EVENT_BITMAP_INIT_PRE = 0x00000081,
EVENT_BITMAP_INIT_POST = 0x00000082,
EVENT_WEAK_HASH_PRE = 0x00000091,
EVENT_WEAK_HASH_POST = 0x00000092,
EVENT_SET_KERNEL_POWER_FINAL = 0x000000a1,
EVENT_LOG_INFO = 0x00000001,
EVENT_LOG_WARNING = 0x00000002,
EVENT_LOG_ERROR = 0x00000003,
EVENT_WELCOME_SCREEN = 0x00000011,
EVENT_GOODBYE_SCREEN = 0x00000012,
EVENT_LOGFILE_TOP_INITIALIZE = 0x00000021,
EVENT_LOGFILE_TOP_FINALIZE = 0x00000022,
EVENT_LOGFILE_SUB_INITIALIZE = 0x00000023,
EVENT_LOGFILE_SUB_FINALIZE = 0x00000024,
EVENT_OUTERLOOP_STARTING = 0x00000031,
EVENT_OUTERLOOP_MAINSCREEN = 0x00000032,
EVENT_OUTERLOOP_FINISHED = 0x00000033,
EVENT_INNERLOOP1_STARTING = 0x00000041,
EVENT_INNERLOOP1_FINISHED = 0x00000042,
EVENT_INNERLOOP2_STARTING = 0x00000051,
EVENT_INNERLOOP2_FINISHED = 0x00000052,
EVENT_CALCULATED_WORDS_BASE = 0x00000059,
EVENT_AUTOTUNE_STARTING = 0x00000053,
EVENT_AUTOTUNE_FINISHED = 0x00000054,
EVENT_CRACKER_STARTING = 0x00000055,
EVENT_CRACKER_FINISHED = 0x00000056,
EVENT_CRACKER_FINAL_STATS = 0x00000057,
EVENT_CRACKER_HASH_CRACKED = 0x00000058,
EVENT_POTFILE_REMOVE_PARSE_PRE = 0x00000061,
EVENT_POTFILE_REMOVE_PARSE_POST = 0x00000062,
EVENT_POTFILE_NUM_CRACKED = 0x00000063,
EVENT_POTFILE_ALL_CRACKED = 0x00000064,
EVENT_OPENCL_SESSION_PRE = 0x00000071,
EVENT_OPENCL_SESSION_POST = 0x00000072,
EVENT_BITMAP_INIT_PRE = 0x00000081,
EVENT_BITMAP_INIT_POST = 0x00000082,
EVENT_WEAK_HASH_PRE = 0x00000091,
EVENT_WEAK_HASH_POST = 0x00000092,
EVENT_SET_KERNEL_POWER_FINAL = 0x000000a1,
// there will be much more event types soon

View File

@ -511,9 +511,11 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
if (user_options->potfile_disable == 0)
{
EVENT (EVENT_POTFILE_REMOVE_PARSE);
EVENT (EVENT_POTFILE_REMOVE_PARSE_PRE);
potfile_remove_parse (hashcat_ctx);
EVENT (EVENT_POTFILE_REMOVE_PARSE_POST);
}
/**

View File

@ -315,7 +315,7 @@ static int main_calculated_words_base (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx,
return 0;
}
static int main_potfile_remove_parse (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
static int main_potfile_remove_parse_pre (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
{
const user_options_t *user_options = hashcat_ctx->user_options;
@ -326,6 +326,17 @@ static int main_potfile_remove_parse (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, M
return 0;
}
static int main_potfile_remove_parse_post (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
{
const user_options_t *user_options = hashcat_ctx->user_options;
if (user_options->quiet == true) return 0;
event_log_info_nn (hashcat_ctx, "Compared hashes with potfile entries...");
return 0;
}
static int main_potfile_num_cracked (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, MAYBE_UNUSED const void *buf, MAYBE_UNUSED const size_t len)
{
const user_options_t *user_options = hashcat_ctx->user_options;
@ -538,33 +549,34 @@ int event (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, const size
switch (id)
{
case EVENT_LOG_INFO: rc = main_log_info (hashcat_ctx, buf, len); break;
case EVENT_LOG_WARNING: rc = main_log_warning (hashcat_ctx, buf, len); break;
case EVENT_LOG_ERROR: rc = main_log_error (hashcat_ctx, buf, len); break;
case EVENT_WELCOME_SCREEN: rc = main_welcome_screen (hashcat_ctx, buf, len); break;
case EVENT_GOODBYE_SCREEN: rc = main_goodbye_screen (hashcat_ctx, buf, len); break;
case EVENT_LOGFILE_TOP_INITIALIZE: rc = main_logfile_top_initialize (hashcat_ctx, buf, len); break;
case EVENT_LOGFILE_TOP_FINALIZE: rc = main_logfile_top_finalize (hashcat_ctx, buf, len); break;
case EVENT_LOGFILE_SUB_INITIALIZE: rc = main_logfile_sub_initialize (hashcat_ctx, buf, len); break;
case EVENT_LOGFILE_SUB_FINALIZE: rc = main_logfile_sub_finalize (hashcat_ctx, buf, len); break;
case EVENT_OUTERLOOP_STARTING: rc = main_outerloop_starting (hashcat_ctx, buf, len); break;
case EVENT_OUTERLOOP_FINISHED: rc = main_outerloop_finished (hashcat_ctx, buf, len); break;
case EVENT_OUTERLOOP_MAINSCREEN: rc = main_outerloop_mainscreen (hashcat_ctx, buf, len); break;
case EVENT_CRACKER_STARTING: rc = main_cracker_starting (hashcat_ctx, buf, len); break;
case EVENT_CRACKER_FINISHED: rc = main_cracker_finished (hashcat_ctx, buf, len); break;
case EVENT_CRACKER_FINAL_STATS: rc = main_cracker_final_stats (hashcat_ctx, buf, len); break;
case EVENT_CRACKER_HASH_CRACKED: rc = main_cracker_hash_cracked (hashcat_ctx, buf, len); break;
case EVENT_CALCULATED_WORDS_BASE: rc = main_calculated_words_base (hashcat_ctx, buf, len); break;
case EVENT_POTFILE_REMOVE_PARSE: rc = main_potfile_remove_parse (hashcat_ctx, buf, len); break;
case EVENT_POTFILE_NUM_CRACKED: rc = main_potfile_num_cracked (hashcat_ctx, buf, len); break;
case EVENT_POTFILE_ALL_CRACKED: rc = main_potfile_all_cracked (hashcat_ctx, buf, len); break;
case EVENT_OPENCL_SESSION_PRE: rc = main_opencl_session_pre (hashcat_ctx, buf, len); break;
case EVENT_OPENCL_SESSION_POST: rc = main_opencl_session_post (hashcat_ctx, buf, len); break;
case EVENT_BITMAP_INIT_PRE: rc = main_bitmap_init_pre (hashcat_ctx, buf, len); break;
case EVENT_BITMAP_INIT_POST: rc = main_bitmap_init_post (hashcat_ctx, buf, len); break;
case EVENT_WEAK_HASH_PRE: rc = main_weak_hash_pre (hashcat_ctx, buf, len); break;
case EVENT_WEAK_HASH_POST: rc = main_weak_hash_post (hashcat_ctx, buf, len); break;
case EVENT_SET_KERNEL_POWER_FINAL: rc = main_set_kernel_power_final (hashcat_ctx, buf, len); break;
case EVENT_LOG_INFO: rc = main_log_info (hashcat_ctx, buf, len); break;
case EVENT_LOG_WARNING: rc = main_log_warning (hashcat_ctx, buf, len); break;
case EVENT_LOG_ERROR: rc = main_log_error (hashcat_ctx, buf, len); break;
case EVENT_WELCOME_SCREEN: rc = main_welcome_screen (hashcat_ctx, buf, len); break;
case EVENT_GOODBYE_SCREEN: rc = main_goodbye_screen (hashcat_ctx, buf, len); break;
case EVENT_LOGFILE_TOP_INITIALIZE: rc = main_logfile_top_initialize (hashcat_ctx, buf, len); break;
case EVENT_LOGFILE_TOP_FINALIZE: rc = main_logfile_top_finalize (hashcat_ctx, buf, len); break;
case EVENT_LOGFILE_SUB_INITIALIZE: rc = main_logfile_sub_initialize (hashcat_ctx, buf, len); break;
case EVENT_LOGFILE_SUB_FINALIZE: rc = main_logfile_sub_finalize (hashcat_ctx, buf, len); break;
case EVENT_OUTERLOOP_STARTING: rc = main_outerloop_starting (hashcat_ctx, buf, len); break;
case EVENT_OUTERLOOP_FINISHED: rc = main_outerloop_finished (hashcat_ctx, buf, len); break;
case EVENT_OUTERLOOP_MAINSCREEN: rc = main_outerloop_mainscreen (hashcat_ctx, buf, len); break;
case EVENT_CRACKER_STARTING: rc = main_cracker_starting (hashcat_ctx, buf, len); break;
case EVENT_CRACKER_FINISHED: rc = main_cracker_finished (hashcat_ctx, buf, len); break;
case EVENT_CRACKER_FINAL_STATS: rc = main_cracker_final_stats (hashcat_ctx, buf, len); break;
case EVENT_CRACKER_HASH_CRACKED: rc = main_cracker_hash_cracked (hashcat_ctx, buf, len); break;
case EVENT_CALCULATED_WORDS_BASE: rc = main_calculated_words_base (hashcat_ctx, buf, len); break;
case EVENT_POTFILE_REMOVE_PARSE_PRE: rc = main_potfile_remove_parse_pre (hashcat_ctx, buf, len); break;
case EVENT_POTFILE_REMOVE_PARSE_POST: rc = main_potfile_remove_parse_post (hashcat_ctx, buf, len); break;
case EVENT_POTFILE_NUM_CRACKED: rc = main_potfile_num_cracked (hashcat_ctx, buf, len); break;
case EVENT_POTFILE_ALL_CRACKED: rc = main_potfile_all_cracked (hashcat_ctx, buf, len); break;
case EVENT_OPENCL_SESSION_PRE: rc = main_opencl_session_pre (hashcat_ctx, buf, len); break;
case EVENT_OPENCL_SESSION_POST: rc = main_opencl_session_post (hashcat_ctx, buf, len); break;
case EVENT_BITMAP_INIT_PRE: rc = main_bitmap_init_pre (hashcat_ctx, buf, len); break;
case EVENT_BITMAP_INIT_POST: rc = main_bitmap_init_post (hashcat_ctx, buf, len); break;
case EVENT_WEAK_HASH_PRE: rc = main_weak_hash_pre (hashcat_ctx, buf, len); break;
case EVENT_WEAK_HASH_POST: rc = main_weak_hash_post (hashcat_ctx, buf, len); break;
case EVENT_SET_KERNEL_POWER_FINAL: rc = main_set_kernel_power_final (hashcat_ctx, buf, len); break;
}
return rc;