mirror of
https://github.com/hashcat/hashcat.git
synced 2025-04-05 17:25:42 +00:00
Make a final status snapshot
This commit is contained in:
parent
baa9517aa1
commit
0fb9779c15
146
include/types.h
146
include/types.h
@ -1547,6 +1547,76 @@ typedef struct cpt_ctx
|
||||
|
||||
} cpt_ctx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool skipped_dev;
|
||||
double hashes_msec_dev;
|
||||
double hashes_msec_dev_benchmark;
|
||||
double exec_msec_dev;
|
||||
char *speed_sec_dev;
|
||||
char *input_candidates_dev;
|
||||
char *hwmon_dev;
|
||||
|
||||
} device_info_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *hash_target;
|
||||
char *hash_type;
|
||||
int input_mode;
|
||||
char *input_base;
|
||||
char *input_charset;
|
||||
char *input_mod;
|
||||
int input_mask_length;
|
||||
char *session;
|
||||
char *status_string;
|
||||
int status_number;
|
||||
char *time_estimated_absolute;
|
||||
char *time_estimated_relative;
|
||||
char *time_started_absolute;
|
||||
char *time_started_relative;
|
||||
double msec_paused;
|
||||
double msec_running;
|
||||
double msec_real;
|
||||
int digests_cnt;
|
||||
int digests_done;
|
||||
double digests_percent;
|
||||
int salts_cnt;
|
||||
int salts_done;
|
||||
double salts_percent;
|
||||
int progress_mode;
|
||||
double progress_finished_percent;
|
||||
u64 progress_cur;
|
||||
u64 progress_cur_relative_skip;
|
||||
u64 progress_done;
|
||||
u64 progress_end;
|
||||
u64 progress_end_relative_skip;
|
||||
u64 progress_ignore;
|
||||
u64 progress_rejected;
|
||||
double progress_rejected_percent;
|
||||
u64 progress_restored;
|
||||
u64 progress_skip;
|
||||
u64 restore_point;
|
||||
u64 restore_total;
|
||||
double restore_percent;
|
||||
int cpt_cur_min;
|
||||
int cpt_cur_hour;
|
||||
int cpt_cur_day;
|
||||
double cpt_avg_min;
|
||||
double cpt_avg_hour;
|
||||
double cpt_avg_day;
|
||||
char *cpt;
|
||||
|
||||
device_info_t device_info_buf[DEVICES_MAX];
|
||||
int device_info_cnt;
|
||||
int device_info_active;
|
||||
|
||||
double hashes_msec_all;
|
||||
double exec_msec_all;
|
||||
char *speed_sec_all;
|
||||
|
||||
} hashcat_status_t;
|
||||
|
||||
typedef struct status_ctx
|
||||
{
|
||||
/**
|
||||
@ -1557,6 +1627,12 @@ typedef struct status_ctx
|
||||
|
||||
u32 devices_status;
|
||||
|
||||
/**
|
||||
* full (final) status snapshot
|
||||
*/
|
||||
|
||||
hashcat_status_t *hashcat_status_final;
|
||||
|
||||
/**
|
||||
* thread control
|
||||
*/
|
||||
@ -1703,76 +1779,6 @@ typedef struct hashcat_ctx
|
||||
|
||||
} hashcat_ctx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
bool skipped_dev;
|
||||
double hashes_msec_dev;
|
||||
double hashes_msec_dev_benchmark;
|
||||
double exec_msec_dev;
|
||||
char *speed_sec_dev;
|
||||
char *input_candidates_dev;
|
||||
char *hwmon_dev;
|
||||
|
||||
} device_info_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *hash_target;
|
||||
char *hash_type;
|
||||
int input_mode;
|
||||
char *input_base;
|
||||
char *input_charset;
|
||||
char *input_mod;
|
||||
int input_mask_length;
|
||||
char *session;
|
||||
char *status_string;
|
||||
int status_number;
|
||||
char *time_estimated_absolute;
|
||||
char *time_estimated_relative;
|
||||
char *time_started_absolute;
|
||||
char *time_started_relative;
|
||||
double msec_paused;
|
||||
double msec_running;
|
||||
double msec_real;
|
||||
int digests_cnt;
|
||||
int digests_done;
|
||||
double digests_percent;
|
||||
int salts_cnt;
|
||||
int salts_done;
|
||||
double salts_percent;
|
||||
int progress_mode;
|
||||
double progress_finished_percent;
|
||||
u64 progress_cur;
|
||||
u64 progress_cur_relative_skip;
|
||||
u64 progress_done;
|
||||
u64 progress_end;
|
||||
u64 progress_end_relative_skip;
|
||||
u64 progress_ignore;
|
||||
u64 progress_rejected;
|
||||
double progress_rejected_percent;
|
||||
u64 progress_restored;
|
||||
u64 progress_skip;
|
||||
u64 restore_point;
|
||||
u64 restore_total;
|
||||
double restore_percent;
|
||||
int cpt_cur_min;
|
||||
int cpt_cur_hour;
|
||||
int cpt_cur_day;
|
||||
double cpt_avg_min;
|
||||
double cpt_avg_hour;
|
||||
double cpt_avg_day;
|
||||
char *cpt;
|
||||
|
||||
device_info_t device_info_buf[DEVICES_MAX];
|
||||
int device_info_cnt;
|
||||
int device_info_active;
|
||||
|
||||
double hashes_msec_all;
|
||||
double exec_msec_all;
|
||||
char *speed_sec_all;
|
||||
|
||||
} hashcat_status_t;
|
||||
|
||||
typedef struct thread_param
|
||||
{
|
||||
u32 tid;
|
||||
|
@ -264,10 +264,12 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
time (&status_ctx->prepare_start);
|
||||
|
||||
EVENT (EVENT_CRACKER_FINISHED);
|
||||
hashcat_get_status (hashcat_ctx, status_ctx->hashcat_status_final);
|
||||
|
||||
status_ctx->accessible = false;
|
||||
|
||||
EVENT (EVENT_CRACKER_FINISHED);
|
||||
|
||||
// mark sub logfile
|
||||
|
||||
logfile_sub_var_uint ("status-after-work", status_ctx->devices_status);
|
||||
@ -1168,7 +1170,17 @@ int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_st
|
||||
|
||||
if (status_ctx == NULL) return -1; // ways too early
|
||||
|
||||
if (status_ctx->accessible == false) return -1; // either too early or too late
|
||||
if (status_ctx->accessible == false)
|
||||
{
|
||||
if (status_ctx->hashcat_status_final->msec_running > 0)
|
||||
{
|
||||
memcpy (hashcat_status, status_ctx->hashcat_status_final, sizeof (hashcat_status_t));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return -1; // still too early
|
||||
}
|
||||
|
||||
hashcat_status->digests_cnt = status_get_digests_cnt (hashcat_ctx);
|
||||
hashcat_status->digests_done = status_get_digests_done (hashcat_ctx);
|
||||
|
18
src/status.c
18
src/status.c
@ -1541,17 +1541,19 @@ int status_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
status_ctx->devices_status = STATUS_INIT;
|
||||
|
||||
status_ctx->run_main_level1 = true;
|
||||
status_ctx->run_main_level2 = true;
|
||||
status_ctx->run_main_level3 = true;
|
||||
status_ctx->run_thread_level1 = true;
|
||||
status_ctx->run_thread_level2 = true;
|
||||
status_ctx->run_main_level1 = true;
|
||||
status_ctx->run_main_level2 = true;
|
||||
status_ctx->run_main_level3 = true;
|
||||
status_ctx->run_thread_level1 = true;
|
||||
status_ctx->run_thread_level2 = true;
|
||||
|
||||
status_ctx->shutdown_inner = false;
|
||||
status_ctx->shutdown_outer = false;
|
||||
status_ctx->shutdown_inner = false;
|
||||
status_ctx->shutdown_outer = false;
|
||||
|
||||
status_ctx->checkpoint_shutdown = false;
|
||||
|
||||
status_ctx->hashcat_status_final = (hashcat_status_t *) hcmalloc (hashcat_ctx, sizeof (hashcat_status_t));
|
||||
|
||||
hc_thread_mutex_init (status_ctx->mux_dispatcher);
|
||||
hc_thread_mutex_init (status_ctx->mux_counter);
|
||||
hc_thread_mutex_init (status_ctx->mux_display);
|
||||
@ -1569,5 +1571,7 @@ void status_ctx_destroy (hashcat_ctx_t *hashcat_ctx)
|
||||
hc_thread_mutex_delete (status_ctx->mux_display);
|
||||
hc_thread_mutex_delete (status_ctx->mux_hwmon);
|
||||
|
||||
hcfree (status_ctx->hashcat_status_final);
|
||||
|
||||
memset (status_ctx, 0, sizeof (status_ctx_t));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user