Make a final status snapshot
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user