1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-09 15:20:59 +00:00

Make status_display(), status_benchmark_automate() and status_benchmark() use of hashcat_status_t

This commit is contained in:
jsteube 2016-10-17 23:49:44 +02:00
parent 65b3910dc0
commit 89e3168280
3 changed files with 315 additions and 195 deletions

View File

@ -1484,6 +1484,7 @@ typedef struct
{ {
bool skipped_dev; bool skipped_dev;
double hashes_msec_dev; double hashes_msec_dev;
double hashes_msec_dev_benchmark;
double exec_msec_dev; double exec_msec_dev;
char *speed_sec_dev; char *speed_sec_dev;
char *input_candidates_dev; char *input_candidates_dev;

View File

@ -1131,6 +1131,31 @@ char *hashcat_get_log (hashcat_ctx_t *hashcat_ctx)
int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_status) int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_status)
{ {
const status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
if (status_ctx->devices_status == STATUS_INIT)
{
event_log_error (hashcat_ctx, "Status view is not available during initialization phase");
return -1;
}
if (status_ctx->devices_status == STATUS_AUTOTUNE)
{
event_log_error (hashcat_ctx, "Status view is not available during autotune phase");
return -1;
}
if (status_ctx->shutdown_inner == true)
{
// in this case some required buffers are free'd, ascii_digest() would run into segfault
event_log_error (hashcat_ctx, "Status view is not available during shutdown phase");
return -1;
}
memset (hashcat_status, 0, sizeof (hashcat_status_t)); memset (hashcat_status, 0, sizeof (hashcat_status_t));
hashcat_status->digests_cnt = status_get_digests_cnt (hashcat_ctx); hashcat_status->digests_cnt = status_get_digests_cnt (hashcat_ctx);
@ -1186,12 +1211,13 @@ int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_st
{ {
device_info_t *device_info = hashcat_status->device_info_buf + device_id; device_info_t *device_info = hashcat_status->device_info_buf + device_id;
device_info->skipped_dev = status_get_skipped_dev (hashcat_ctx, device_id); device_info->skipped_dev = status_get_skipped_dev (hashcat_ctx, device_id);
device_info->hashes_msec_dev = status_get_hashes_msec_dev (hashcat_ctx, device_id); device_info->hashes_msec_dev = status_get_hashes_msec_dev (hashcat_ctx, device_id);
device_info->exec_msec_dev = status_get_exec_msec_dev (hashcat_ctx, device_id); device_info->hashes_msec_dev_benchmark = status_get_hashes_msec_dev_benchmark (hashcat_ctx, device_id);
device_info->speed_sec_dev = status_get_speed_sec_dev (hashcat_ctx, device_id); device_info->exec_msec_dev = status_get_exec_msec_dev (hashcat_ctx, device_id);
device_info->input_candidates_dev = status_get_input_candidates_dev (hashcat_ctx, device_id); device_info->speed_sec_dev = status_get_speed_sec_dev (hashcat_ctx, device_id);
device_info->hwmon_dev = status_get_hwmon_dev (hashcat_ctx, device_id); device_info->input_candidates_dev = status_get_input_candidates_dev (hashcat_ctx, device_id);
device_info->hwmon_dev = status_get_hwmon_dev (hashcat_ctx, device_id);
} }
hashcat_status->hashes_msec_all = status_get_hashes_msec_all (hashcat_ctx); hashcat_status->hashes_msec_all = status_get_hashes_msec_all (hashcat_ctx);

View File

@ -5,6 +5,7 @@
#include "common.h" #include "common.h"
#include "types.h" #include "types.h"
#include "memory.h"
#include "event.h" #include "event.h"
#include "convert.h" #include "convert.h"
#include "thread.h" #include "thread.h"
@ -16,6 +17,7 @@
#include "interface.h" #include "interface.h"
#include "outfile.h" #include "outfile.h"
#include "terminal.h" #include "terminal.h"
#include "hashcat.h"
const char *PROMPT = "[s]tatus [p]ause [r]esume [b]ypass [c]heckpoint [q]uit => "; const char *PROMPT = "[s]tatus [p]ause [r]esume [b]ypass [c]heckpoint [q]uit => ";
@ -611,31 +613,7 @@ void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx)
void status_display (hashcat_ctx_t *hashcat_ctx) void status_display (hashcat_ctx_t *hashcat_ctx)
{ {
status_ctx_t *status_ctx = hashcat_ctx->status_ctx; const user_options_t *user_options = hashcat_ctx->user_options;
user_options_t *user_options = hashcat_ctx->user_options;
if (status_ctx->devices_status == STATUS_INIT)
{
event_log_error (hashcat_ctx, "Status view is not available during initialization phase");
return;
}
if (status_ctx->devices_status == STATUS_AUTOTUNE)
{
event_log_error (hashcat_ctx, "Status view is not available during autotune phase");
return;
}
if (status_ctx->shutdown_inner == true)
{
// in this case some required buffers are free'd, ascii_digest() would run into segfault
event_log_error (hashcat_ctx, "Status view is not available during shutdown phase");
return;
}
if (user_options->machine_readable == true) if (user_options->machine_readable == true)
{ {
@ -644,142 +622,308 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
return; return;
} }
hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (hashcat_ctx, sizeof (hashcat_status_t));
const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status);
if (rc_status == -1)
{
hcfree (hashcat_status);
return;
}
/** /**
* show something * show something
*/ */
event_log_info (hashcat_ctx, "Session........: %s", status_get_session (hashcat_ctx)); event_log_info (hashcat_ctx,
event_log_info (hashcat_ctx, "Status.........: %s", status_get_status_string (hashcat_ctx)); "Session........: %s",
event_log_info (hashcat_ctx, "Time.Started...: %s (%s)", hashcat_status->session);
status_get_time_started_absolute (hashcat_ctx),
status_get_time_started_relative (hashcat_ctx));
event_log_info (hashcat_ctx, "Time.Estimated.: %s (%s)",
status_get_time_estimated_absolute (hashcat_ctx),
status_get_time_estimated_relative (hashcat_ctx));
event_log_info (hashcat_ctx, "Hash.Type......: %s", status_get_hash_type (hashcat_ctx));
event_log_info (hashcat_ctx, "Hash.Target....: %s", status_get_hash_target (hashcat_ctx));
switch (status_get_input_mode (hashcat_ctx)) event_log_info (hashcat_ctx,
"Status.........: %s",
hashcat_status->status);
event_log_info (hashcat_ctx,
"Time.Started...: %s (%s)",
hashcat_status->time_started_absolute,
hashcat_status->time_started_relative);
event_log_info (hashcat_ctx,
"Time.Estimated.: %s (%s)",
hashcat_status->time_estimated_absolute,
hashcat_status->time_estimated_relative);
event_log_info (hashcat_ctx,
"Hash.Type......: %s",
hashcat_status->hash_type);
event_log_info (hashcat_ctx,
"Hash.Target....: %s",
hashcat_status->hash_target);
switch (hashcat_status->input_mode)
{ {
case INPUT_MODE_STRAIGHT_FILE: case INPUT_MODE_STRAIGHT_FILE:
event_log_info (hashcat_ctx, "Input.Base.....: File (%s)", status_get_input_base (hashcat_ctx));
event_log_info (hashcat_ctx,
"Input.Base.....: File (%s)",
hashcat_status->input_base);
break; break;
case INPUT_MODE_STRAIGHT_FILE_RULES_FILE: case INPUT_MODE_STRAIGHT_FILE_RULES_FILE:
event_log_info (hashcat_ctx, "Input.Base.....: File (%s)", status_get_input_base (hashcat_ctx));
event_log_info (hashcat_ctx, "Input.Mod......: Rules (%s)", status_get_input_mod (hashcat_ctx)); event_log_info (hashcat_ctx,
"Input.Base.....: File (%s)",
hashcat_status->input_base);
event_log_info (hashcat_ctx,
"Input.Mod......: Rules (%s)",
hashcat_status->input_mod);
break; break;
case INPUT_MODE_STRAIGHT_FILE_RULES_GEN: case INPUT_MODE_STRAIGHT_FILE_RULES_GEN:
event_log_info (hashcat_ctx, "Input.Base.....: File (%s)", status_get_input_base (hashcat_ctx));
event_log_info (hashcat_ctx, "Input.Mod......: Rules (Generated)"); event_log_info (hashcat_ctx,
"Input.Base.....: File (%s)",
hashcat_status->input_base);
event_log_info (hashcat_ctx,
"Input.Mod......: Rules (Generated)");
break; break;
case INPUT_MODE_STRAIGHT_STDIN: case INPUT_MODE_STRAIGHT_STDIN:
event_log_info (hashcat_ctx, "Input.Base.....: Pipe");
event_log_info (hashcat_ctx,
"Input.Base.....: Pipe");
break; break;
case INPUT_MODE_STRAIGHT_STDIN_RULES_FILE: case INPUT_MODE_STRAIGHT_STDIN_RULES_FILE:
event_log_info (hashcat_ctx, "Input.Base.....: Pipe");
event_log_info (hashcat_ctx, "Input.Mod......: Rules (%s)", status_get_input_mod (hashcat_ctx)); event_log_info (hashcat_ctx,
"Input.Base.....: Pipe");
event_log_info (hashcat_ctx,
"Input.Mod......: Rules (%s)",
hashcat_status->input_mod);
break; break;
case INPUT_MODE_STRAIGHT_STDIN_RULES_GEN: case INPUT_MODE_STRAIGHT_STDIN_RULES_GEN:
event_log_info (hashcat_ctx, "Input.Base.....: Pipe");
event_log_info (hashcat_ctx, "Input.Mod......: Rules (Generated)"); event_log_info (hashcat_ctx,
"Input.Base.....: Pipe");
event_log_info (hashcat_ctx,
"Input.Mod......: Rules (Generated)");
break; break;
case INPUT_MODE_COMBINATOR_BASE_LEFT: case INPUT_MODE_COMBINATOR_BASE_LEFT:
event_log_info (hashcat_ctx, "Input.Base.....: File (%s), Left Side", status_get_input_base (hashcat_ctx));
event_log_info (hashcat_ctx, "Input.Mod......: File (%s), Right Side", status_get_input_mod (hashcat_ctx)); event_log_info (hashcat_ctx,
"Input.Base.....: File (%s), Left Side",
hashcat_status->input_base);
event_log_info (hashcat_ctx,
"Input.Mod......: File (%s), Right Side",
hashcat_status->input_mod);
break; break;
case INPUT_MODE_COMBINATOR_BASE_RIGHT: case INPUT_MODE_COMBINATOR_BASE_RIGHT:
event_log_info (hashcat_ctx, "Input.Base.....: File (%s), Right Side", status_get_input_base (hashcat_ctx));
event_log_info (hashcat_ctx, "Input.Mod......: File (%s), Left Side", status_get_input_mod (hashcat_ctx)); event_log_info (hashcat_ctx,
"Input.Base.....: File (%s), Right Side",
hashcat_status->input_base);
event_log_info (hashcat_ctx,
"Input.Mod......: File (%s), Left Side",
hashcat_status->input_mod);
break; break;
case INPUT_MODE_MASK: case INPUT_MODE_MASK:
event_log_info (hashcat_ctx, "Input.Mask.....: %s", status_get_input_base (hashcat_ctx));
event_log_info (hashcat_ctx,
"Input.Mask.....: %s",
hashcat_status->input_base);
break; break;
case INPUT_MODE_MASK_CS: case INPUT_MODE_MASK_CS:
event_log_info (hashcat_ctx, "Input.Mask.....: %s", status_get_input_base (hashcat_ctx));
event_log_info (hashcat_ctx, "Input.Charset..: %s", status_get_input_charset (hashcat_ctx)); event_log_info (hashcat_ctx,
"Input.Mask.....: %s",
hashcat_status->input_base);
event_log_info (hashcat_ctx,
"Input.Charset..: %s",
hashcat_status->input_charset);
break; break;
case INPUT_MODE_HYBRID1: case INPUT_MODE_HYBRID1:
event_log_info (hashcat_ctx, "Input.Base.....: File (%s), Left Side", status_get_input_base (hashcat_ctx));
event_log_info (hashcat_ctx, "Input.Mod......: Mask (%s), Right Side", status_get_input_mod (hashcat_ctx)); event_log_info (hashcat_ctx,
"Input.Base.....: File (%s), Left Side",
hashcat_status->input_base);
event_log_info (hashcat_ctx,
"Input.Mod......: Mask (%s), Right Side",
hashcat_status->input_mod);
break; break;
case INPUT_MODE_HYBRID1_CS: case INPUT_MODE_HYBRID1_CS:
event_log_info (hashcat_ctx, "Input.Base.....: File (%s), Left Side", status_get_input_base (hashcat_ctx));
event_log_info (hashcat_ctx, "Input.Mod......: Mask (%s), Right Side", status_get_input_mod (hashcat_ctx)); event_log_info (hashcat_ctx,
event_log_info (hashcat_ctx, "Input.Charset..: %s", status_get_input_charset (hashcat_ctx)); "Input.Base.....: File (%s), Left Side",
hashcat_status->input_base);
event_log_info (hashcat_ctx,
"Input.Mod......: Mask (%s), Right Side",
hashcat_status->input_mod);
event_log_info (hashcat_ctx,
"Input.Charset..: %s",
hashcat_status->input_charset);
break; break;
case INPUT_MODE_HYBRID2: case INPUT_MODE_HYBRID2:
event_log_info (hashcat_ctx, "Input.Base.....: File (%s), Right Side", status_get_input_base (hashcat_ctx));
event_log_info (hashcat_ctx, "Input.Mod......: Mask (%s), Left Side", status_get_input_mod (hashcat_ctx)); event_log_info (hashcat_ctx,
"Input.Base.....: File (%s), Right Side",
hashcat_status->input_base);
event_log_info (hashcat_ctx,
"Input.Mod......: Mask (%s), Left Side",
hashcat_status->input_mod);
break; break;
case INPUT_MODE_HYBRID2_CS: case INPUT_MODE_HYBRID2_CS:
event_log_info (hashcat_ctx, "Input.Base.....: File (%s), Right Side", status_get_input_base (hashcat_ctx));
event_log_info (hashcat_ctx, "Input.Mod......: Mask (%s), Left Side", status_get_input_mod (hashcat_ctx)); event_log_info (hashcat_ctx,
event_log_info (hashcat_ctx, "Input.Charset..: %s", status_get_input_charset (hashcat_ctx)); "Input.Base.....: File (%s), Right Side",
hashcat_status->input_base);
event_log_info (hashcat_ctx,
"Input.Mod......: Mask (%s), Left Side",
hashcat_status->input_mod);
event_log_info (hashcat_ctx,
"Input.Charset..: %s",
hashcat_status->input_charset);
break; break;
} }
for (int device_id = 0; device_id < status_get_device_info_cnt (hashcat_ctx); device_id++) for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
{ {
if (status_get_skipped_dev (hashcat_ctx, device_id) == true) continue; const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
event_log_info (hashcat_ctx, "Candidates.#%d..: %s", device_id + 1, status_get_input_candidates_dev (hashcat_ctx, device_id)); if (device_info->skipped_dev == true) continue;
event_log_info (hashcat_ctx,
"Candidates.#%d..: %s", device_id + 1,
device_info->input_candidates_dev);
} }
switch (status_get_progress_mode (hashcat_ctx)) switch (hashcat_status->progress_mode)
{ {
case PROGRESS_MODE_KEYSPACE_KNOWN: case PROGRESS_MODE_KEYSPACE_KNOWN:
event_log_info (hashcat_ctx, "Progress.......: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
status_get_progress_cur_relative_skip (hashcat_ctx), event_log_info (hashcat_ctx,
status_get_progress_end_relative_skip (hashcat_ctx), "Progress.......: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
status_get_progress_finished_percent (hashcat_ctx)); hashcat_status->progress_cur_relative_skip,
event_log_info (hashcat_ctx, "Rejected.......: %" PRIu64 "/%" PRIu64 " (%.02f%%)", hashcat_status->progress_end_relative_skip,
status_get_progress_rejected (hashcat_ctx), hashcat_status->progress_finished_percent);
status_get_progress_cur_relative_skip (hashcat_ctx),
status_get_progress_rejected_percent (hashcat_ctx)); event_log_info (hashcat_ctx,
event_log_info (hashcat_ctx, "Restore.Point..: %" PRIu64 "/%" PRIu64 " (%.02f%%)", "Rejected.......: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
status_get_restore_point (hashcat_ctx), hashcat_status->progress_rejected,
status_get_restore_total (hashcat_ctx), hashcat_status->progress_cur_relative_skip,
status_get_restore_percent (hashcat_ctx)); hashcat_status->progress_rejected_percent);
event_log_info (hashcat_ctx,
"Restore.Point..: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
hashcat_status->restore_point,
hashcat_status->restore_total,
hashcat_status->restore_percent);
break; break;
case PROGRESS_MODE_KEYSPACE_UNKNOWN: case PROGRESS_MODE_KEYSPACE_UNKNOWN:
event_log_info (hashcat_ctx, "Progress.......: %" PRIu64, status_get_progress_cur_relative_skip (hashcat_ctx));
event_log_info (hashcat_ctx, "Rejected.......: %" PRIu64, status_get_progress_rejected (hashcat_ctx)); event_log_info (hashcat_ctx,
event_log_info (hashcat_ctx, "Restore.Point..: %" PRIu64, status_get_restore_point (hashcat_ctx)); "Progress.......: %" PRIu64,
hashcat_status->progress_cur_relative_skip);
event_log_info (hashcat_ctx,
"Rejected.......: %" PRIu64,
hashcat_status->progress_rejected);
event_log_info (hashcat_ctx,
"Restore.Point..: %" PRIu64,
hashcat_status->restore_point);
break; break;
} }
event_log_info (hashcat_ctx, "Recovered......: %u/%u (%.2f%%) Digests, %u/%u (%.2f%%) Salts", event_log_info (hashcat_ctx,
status_get_digests_done (hashcat_ctx), "Recovered......: %u/%u (%.2f%%) Digests, %u/%u (%.2f%%) Salts",
status_get_digests_cnt (hashcat_ctx), hashcat_status->digests_done,
status_get_digests_percent (hashcat_ctx), hashcat_status->digests_cnt,
status_get_salts_done (hashcat_ctx), hashcat_status->digests_percent,
status_get_salts_cnt (hashcat_ctx), hashcat_status->salts_done,
status_get_salts_percent (hashcat_ctx)); hashcat_status->salts_cnt,
event_log_info (hashcat_ctx, "Recovered/Time.: %s", status_get_cpt (hashcat_ctx)); hashcat_status->salts_percent);
for (int device_id = 0; device_id < status_get_device_info_cnt (hashcat_ctx); device_id++) event_log_info (hashcat_ctx,
"Recovered/Time.: %s",
hashcat_status->cpt);
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
{ {
if (status_get_skipped_dev (hashcat_ctx, device_id) == true) continue; const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
event_log_info (hashcat_ctx, "Speed.Dev.#%d...: %9sH/s (%0.2fms)", device_id + 1, if (device_info->skipped_dev == true) continue;
status_get_speed_sec_dev (hashcat_ctx, device_id),
status_get_exec_msec_dev (hashcat_ctx, device_id)); event_log_info (hashcat_ctx,
"Speed.Dev.#%d...: %9sH/s (%0.2fms)", device_id + 1,
device_info->speed_sec_dev,
device_info->exec_msec_dev);
} }
if (status_get_device_info_active (hashcat_ctx) > 1) if (hashcat_status->device_info_active > 1)
{ {
event_log_info (hashcat_ctx, "Speed.Dev.#*...: %9sH/s", status_get_speed_sec_all (hashcat_ctx)); event_log_info (hashcat_ctx,
"Speed.Dev.#*...: %9sH/s",
hashcat_status->speed_sec_all);
} }
if (user_options->gpu_temp_disable == false) if (user_options->gpu_temp_disable == false)
{ {
for (int device_id = 0; device_id < status_get_device_info_cnt (hashcat_ctx); device_id++) for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
{ {
if (status_get_skipped_dev (hashcat_ctx, device_id) == true) continue; const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
event_log_info (hashcat_ctx, "HWMon.Dev.#%d...: %s", device_id + 1, status_get_hwmon_dev (hashcat_ctx, device_id)); if (device_info->skipped_dev == true) continue;
event_log_info (hashcat_ctx,
"HWMon.Dev.#%d...: %s", device_id + 1,
device_info->hwmon_dev);
} }
} }
hcfree (hashcat_status);
} }
void status_benchmark_automate (hashcat_ctx_t *hashcat_ctx) void status_benchmark_automate (hashcat_ctx_t *hashcat_ctx)
@ -788,35 +932,32 @@ void status_benchmark_automate (hashcat_ctx_t *hashcat_ctx)
const u32 hash_mode = hashconfig->hash_mode; const u32 hash_mode = hashconfig->hash_mode;
for (int device_id = 0; device_id < status_get_device_info_cnt (hashcat_ctx); device_id++) hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (hashcat_ctx, sizeof (hashcat_status_t));
{
if (status_get_skipped_dev (hashcat_ctx, device_id) == true) continue;
event_log_info (hashcat_ctx, "%u:%u:%" PRIu64, device_id + 1, hash_mode, (u64) (status_get_hashes_msec_dev_benchmark (hashcat_ctx, device_id) * 1000)); const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status);
if (rc_status == -1)
{
hcfree (hashcat_status);
return;
} }
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
{
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_info->skipped_dev == true) continue;
event_log_info (hashcat_ctx, "%u:%u:%" PRIu64, device_id + 1, hash_mode, (u64) (device_info->hashes_msec_dev_benchmark * 1000));
}
hcfree (hashcat_status);
} }
void status_benchmark (hashcat_ctx_t *hashcat_ctx) void status_benchmark (hashcat_ctx_t *hashcat_ctx)
{ {
opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx; const user_options_t *user_options = hashcat_ctx->user_options;
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
user_options_t *user_options = hashcat_ctx->user_options;
if (status_ctx->devices_status == STATUS_INIT)
{
event_log_error (hashcat_ctx, "status view is not available during initialization phase");
return;
}
if (status_ctx->devices_status == STATUS_AUTOTUNE)
{
event_log_error (hashcat_ctx, "status view is not available during autotune phase");
return;
}
if (status_ctx->shutdown_inner == 1) return;
if (user_options->machine_readable == true) if (user_options->machine_readable == true)
{ {
@ -825,83 +966,35 @@ void status_benchmark (hashcat_ctx_t *hashcat_ctx)
return; return;
} }
u64 speed_cnt[DEVICES_MAX] = { 0 }; hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (hashcat_ctx, sizeof (hashcat_status_t));
double speed_msec[DEVICES_MAX] = { 0 };
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) const int rc_status = hashcat_get_status (hashcat_ctx, hashcat_status);
if (rc_status == -1)
{ {
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; hcfree (hashcat_status);
if (device_param->skipped) continue; return;
speed_cnt[device_id] = device_param->speed_cnt[0];
speed_msec[device_id] = device_param->speed_msec[0];
} }
double hashes_all_msec = 0; for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
double hashes_dev_msec[DEVICES_MAX] = { 0 };
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
{ {
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
if (device_param->skipped) continue; if (device_info->skipped_dev == true) continue;
hashes_dev_msec[device_id] = 0; event_log_info (hashcat_ctx,
"Speed.Dev.#%d...: %9sH/s (%0.2fms)", device_id + 1,
if (speed_msec[device_id] > 0) device_info->speed_sec_dev,
{ device_info->exec_msec_dev);
hashes_dev_msec[device_id] = (double) speed_cnt[device_id] / speed_msec[device_id];
hashes_all_msec += hashes_dev_msec[device_id];
}
} }
/** if (hashcat_status->device_info_active > 1)
* exec time
*/
double exec_all_msec[DEVICES_MAX] = { 0 };
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
{ {
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; event_log_info (hashcat_ctx,
"Speed.Dev.#*...: %9sH/s",
if (device_param->skipped) continue; hashcat_status->speed_sec_all);
double exec_msec_avg = get_avg_exec_time (device_param, EXEC_CACHE);
exec_all_msec[device_id] = exec_msec_avg;
} }
for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) hcfree (hashcat_status);
{
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
if (device_param->skipped) continue;
char display_dev_cur[16] = { 0 };
strncpy (display_dev_cur, "0.00", 4);
format_speed_display ((double) hashes_dev_msec[device_id] * 1000, display_dev_cur, sizeof (display_dev_cur));
if (opencl_ctx->devices_active >= 10)
{
event_log_info (hashcat_ctx, "Speed.Dev.#%d: %9sH/s (%0.2fms)", device_id + 1, display_dev_cur, exec_all_msec[device_id]);
}
else
{
event_log_info (hashcat_ctx, "Speed.Dev.#%d.: %9sH/s (%0.2fms)", device_id + 1, display_dev_cur, exec_all_msec[device_id]);
}
}
char display_all_cur[16] = { 0 };
strncpy (display_all_cur, "0.00", 4);
format_speed_display ((double) hashes_all_msec * 1000, display_all_cur, sizeof (display_all_cur));
if (opencl_ctx->devices_active > 1) event_log_info (hashcat_ctx, "Speed.Dev.#*.: %9sH/s", display_all_cur);
} }