2016-09-08 07:21:25 +00:00
|
|
|
/**
|
2016-09-11 20:20:15 +00:00
|
|
|
* Author......: See docs/credits.txt
|
2016-09-08 07:21:25 +00:00
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "types.h"
|
2016-09-14 14:07:24 +00:00
|
|
|
#include "interface.h"
|
2016-09-08 07:21:25 +00:00
|
|
|
#include "timer.h"
|
|
|
|
#include "memory.h"
|
|
|
|
#include "logging.h"
|
|
|
|
#include "ext_OpenCL.h"
|
|
|
|
#include "ext_ADL.h"
|
|
|
|
#include "ext_nvapi.h"
|
|
|
|
#include "ext_nvml.h"
|
|
|
|
#include "ext_xnvctrl.h"
|
2016-09-15 14:02:52 +00:00
|
|
|
#include "tuningdb.h"
|
2016-09-20 11:18:47 +00:00
|
|
|
#include "thread.h"
|
2016-09-14 18:22:38 +00:00
|
|
|
#include "opencl.h"
|
2016-09-15 14:02:52 +00:00
|
|
|
#include "hwmon.h"
|
|
|
|
#include "restore.h"
|
2016-09-16 15:01:18 +00:00
|
|
|
#include "hash_management.h"
|
2016-09-08 07:21:25 +00:00
|
|
|
#include "rp_cpu.h"
|
|
|
|
#include "terminal.h"
|
|
|
|
#include "mpsp.h"
|
2016-09-10 15:35:58 +00:00
|
|
|
#include "outfile.h"
|
2016-09-09 21:17:43 +00:00
|
|
|
#include "potfile.h"
|
2016-09-13 08:38:59 +00:00
|
|
|
#include "debugfile.h"
|
2016-09-12 12:58:25 +00:00
|
|
|
#include "loopback.h"
|
2016-09-08 07:21:25 +00:00
|
|
|
#include "data.h"
|
|
|
|
#include "status.h"
|
|
|
|
|
|
|
|
extern hc_global_data_t data;
|
|
|
|
extern hc_thread_mutex_t mux_hwmon;
|
|
|
|
|
|
|
|
hc_thread_mutex_t mux_display;
|
|
|
|
|
2016-09-24 19:44:43 +00:00
|
|
|
static const char ST_0000[] = "Initializing";
|
|
|
|
static const char ST_0001[] = "Autotuning";
|
|
|
|
static const char ST_0002[] = "Running";
|
|
|
|
static const char ST_0003[] = "Paused";
|
|
|
|
static const char ST_0004[] = "Exhausted";
|
|
|
|
static const char ST_0005[] = "Cracked";
|
|
|
|
static const char ST_0006[] = "Aborted";
|
|
|
|
static const char ST_0007[] = "Quit";
|
|
|
|
static const char ST_0008[] = "Bypass";
|
|
|
|
|
2016-09-08 08:01:49 +00:00
|
|
|
static void format_timer_display (struct tm *tm, char *buf, size_t len)
|
|
|
|
{
|
|
|
|
const char *time_entities_s[] = { "year", "day", "hour", "min", "sec" };
|
|
|
|
const char *time_entities_m[] = { "years", "days", "hours", "mins", "secs" };
|
|
|
|
|
|
|
|
if (tm->tm_year - 70)
|
|
|
|
{
|
|
|
|
char *time_entity1 = ((tm->tm_year - 70) == 1) ? (char *) time_entities_s[0] : (char *) time_entities_m[0];
|
|
|
|
char *time_entity2 = ( tm->tm_yday == 1) ? (char *) time_entities_s[1] : (char *) time_entities_m[1];
|
|
|
|
|
|
|
|
snprintf (buf, len - 1, "%d %s, %d %s", tm->tm_year - 70, time_entity1, tm->tm_yday, time_entity2);
|
|
|
|
}
|
|
|
|
else if (tm->tm_yday)
|
|
|
|
{
|
|
|
|
char *time_entity1 = (tm->tm_yday == 1) ? (char *) time_entities_s[1] : (char *) time_entities_m[1];
|
|
|
|
char *time_entity2 = (tm->tm_hour == 1) ? (char *) time_entities_s[2] : (char *) time_entities_m[2];
|
|
|
|
|
|
|
|
snprintf (buf, len - 1, "%d %s, %d %s", tm->tm_yday, time_entity1, tm->tm_hour, time_entity2);
|
|
|
|
}
|
|
|
|
else if (tm->tm_hour)
|
|
|
|
{
|
|
|
|
char *time_entity1 = (tm->tm_hour == 1) ? (char *) time_entities_s[2] : (char *) time_entities_m[2];
|
|
|
|
char *time_entity2 = (tm->tm_min == 1) ? (char *) time_entities_s[3] : (char *) time_entities_m[3];
|
|
|
|
|
|
|
|
snprintf (buf, len - 1, "%d %s, %d %s", tm->tm_hour, time_entity1, tm->tm_min, time_entity2);
|
|
|
|
}
|
|
|
|
else if (tm->tm_min)
|
|
|
|
{
|
|
|
|
char *time_entity1 = (tm->tm_min == 1) ? (char *) time_entities_s[3] : (char *) time_entities_m[3];
|
|
|
|
char *time_entity2 = (tm->tm_sec == 1) ? (char *) time_entities_s[4] : (char *) time_entities_m[4];
|
|
|
|
|
|
|
|
snprintf (buf, len - 1, "%d %s, %d %s", tm->tm_min, time_entity1, tm->tm_sec, time_entity2);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char *time_entity1 = (tm->tm_sec == 1) ? (char *) time_entities_s[4] : (char *) time_entities_m[4];
|
|
|
|
|
|
|
|
snprintf (buf, len - 1, "%d %s", tm->tm_sec, time_entity1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void format_speed_display (double val, char *buf, size_t len)
|
|
|
|
{
|
|
|
|
if (val <= 0)
|
|
|
|
{
|
|
|
|
buf[0] = '0';
|
|
|
|
buf[1] = ' ';
|
|
|
|
buf[2] = 0;
|
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
char units[7] = { ' ', 'k', 'M', 'G', 'T', 'P', 'E' };
|
|
|
|
|
|
|
|
uint level = 0;
|
|
|
|
|
|
|
|
while (val > 99999)
|
|
|
|
{
|
|
|
|
val /= 1000;
|
|
|
|
|
|
|
|
level++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* generate output */
|
|
|
|
|
|
|
|
if (level == 0)
|
|
|
|
{
|
|
|
|
snprintf (buf, len - 1, "%.0f ", val);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf (buf, len - 1, "%.1f %c", val, units[level]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-24 19:44:43 +00:00
|
|
|
static char *strstatus (const uint devices_status)
|
|
|
|
{
|
|
|
|
switch (devices_status)
|
|
|
|
{
|
|
|
|
case STATUS_INIT: return ((char *) ST_0000);
|
|
|
|
case STATUS_AUTOTUNE: return ((char *) ST_0001);
|
|
|
|
case STATUS_RUNNING: return ((char *) ST_0002);
|
|
|
|
case STATUS_PAUSED: return ((char *) ST_0003);
|
|
|
|
case STATUS_EXHAUSTED: return ((char *) ST_0004);
|
|
|
|
case STATUS_CRACKED: return ((char *) ST_0005);
|
|
|
|
case STATUS_ABORTED: return ((char *) ST_0006);
|
|
|
|
case STATUS_QUIT: return ((char *) ST_0007);
|
|
|
|
case STATUS_BYPASS: return ((char *) ST_0008);
|
|
|
|
}
|
|
|
|
|
|
|
|
return ((char *) "Uninitialized! Bug!");
|
|
|
|
}
|
2016-09-14 14:07:24 +00:00
|
|
|
double get_avg_exec_time (hc_device_param_t *device_param, const int last_num_entries)
|
|
|
|
{
|
|
|
|
int exec_pos = (int) device_param->exec_pos - last_num_entries;
|
|
|
|
|
|
|
|
if (exec_pos < 0) exec_pos += EXEC_CACHE;
|
|
|
|
|
|
|
|
double exec_ms_sum = 0;
|
|
|
|
|
|
|
|
int exec_ms_cnt = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < last_num_entries; i++)
|
|
|
|
{
|
|
|
|
double exec_ms = device_param->exec_ms[(exec_pos + i) % EXEC_CACHE];
|
|
|
|
|
|
|
|
if (exec_ms > 0)
|
|
|
|
{
|
|
|
|
exec_ms_sum += exec_ms;
|
|
|
|
|
|
|
|
exec_ms_cnt++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (exec_ms_cnt == 0) return 0;
|
|
|
|
|
|
|
|
return exec_ms_sum / exec_ms_cnt;
|
|
|
|
}
|
|
|
|
|
2016-09-28 20:28:44 +00:00
|
|
|
void status_display_machine_readable (opencl_ctx_t *opencl_ctx, const hwmon_ctx_t *hwmon_ctx, const hashes_t *hashes, const restore_ctx_t *restore_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const straight_ctx_t *straight_ctx, const combinator_ctx_t *combinator_ctx, const mask_ctx_t *mask_ctx)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-19 13:52:01 +00:00
|
|
|
if (opencl_ctx->devices_status == STATUS_INIT)
|
|
|
|
{
|
|
|
|
log_error ("ERROR: status view is not available during initialization phase");
|
2016-09-18 20:16:03 +00:00
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
return;
|
|
|
|
}
|
2016-09-18 20:16:03 +00:00
|
|
|
|
2016-09-08 07:21:25 +00:00
|
|
|
FILE *out = stdout;
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
fprintf (out, "STATUS\t%u\t", opencl_ctx->devices_status);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* speed new
|
|
|
|
*/
|
|
|
|
|
|
|
|
fprintf (out, "SPEED\t");
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
u64 speed_cnt = 0;
|
|
|
|
double speed_ms = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < SPEED_CACHE; i++)
|
|
|
|
{
|
|
|
|
speed_cnt += device_param->speed_cnt[i];
|
|
|
|
speed_ms += device_param->speed_ms[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
speed_cnt /= SPEED_CACHE;
|
|
|
|
speed_ms /= SPEED_CACHE;
|
|
|
|
|
|
|
|
fprintf (out, "%" PRIu64 "\t%f\t", speed_cnt, speed_ms);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* exec time
|
|
|
|
*/
|
|
|
|
|
|
|
|
fprintf (out, "EXEC_RUNTIME\t");
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
double exec_ms_avg = get_avg_exec_time (device_param, EXEC_CACHE);
|
|
|
|
|
|
|
|
fprintf (out, "%f\t", exec_ms_avg);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* words_cur
|
|
|
|
*/
|
|
|
|
|
2016-09-24 23:02:44 +00:00
|
|
|
u64 words_cur = get_lowest_words_done (restore_ctx, opencl_ctx);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
fprintf (out, "CURKU\t%" PRIu64 "\t", words_cur);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* counter
|
|
|
|
*/
|
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
u64 progress_total = data.words_cnt * hashes->salts_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
u64 all_done = 0;
|
|
|
|
u64 all_rejected = 0;
|
|
|
|
u64 all_restored = 0;
|
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
for (uint salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
all_done += data.words_progress_done[salt_pos];
|
|
|
|
all_rejected += data.words_progress_rejected[salt_pos];
|
|
|
|
all_restored += data.words_progress_restored[salt_pos];
|
|
|
|
}
|
|
|
|
|
|
|
|
u64 progress_cur = all_restored + all_done + all_rejected;
|
|
|
|
u64 progress_end = progress_total;
|
|
|
|
|
|
|
|
u64 progress_skip = 0;
|
|
|
|
|
2016-09-22 10:33:33 +00:00
|
|
|
if (user_options->skip)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-22 10:33:33 +00:00
|
|
|
progress_skip = MIN (user_options->skip, data.words_base) * hashes->salts_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-27 11:13:07 +00:00
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) progress_skip *= straight_ctx->kernel_rules_cnt;
|
2016-09-27 16:32:09 +00:00
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) progress_skip *= combinator_ctx->combs_cnt;
|
2016-09-25 23:18:00 +00:00
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_BF) progress_skip *= mask_ctx->bfs_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
|
2016-09-22 10:33:33 +00:00
|
|
|
if (user_options->limit)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-22 10:33:33 +00:00
|
|
|
progress_end = MIN (user_options->limit, data.words_base) * hashes->salts_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-27 11:13:07 +00:00
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) progress_end *= straight_ctx->kernel_rules_cnt;
|
2016-09-27 16:32:09 +00:00
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) progress_end *= combinator_ctx->combs_cnt;
|
2016-09-25 23:18:00 +00:00
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_BF) progress_end *= mask_ctx->bfs_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
u64 progress_cur_relative_skip = progress_cur - progress_skip;
|
|
|
|
u64 progress_end_relative_skip = progress_end - progress_skip;
|
|
|
|
|
|
|
|
fprintf (out, "PROGRESS\t%" PRIu64 "\t%" PRIu64 "\t", progress_cur_relative_skip, progress_end_relative_skip);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* cracks
|
|
|
|
*/
|
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
fprintf (out, "RECHASH\t%u\t%u\t", hashes->digests_done, hashes->digests_cnt);
|
|
|
|
fprintf (out, "RECSALT\t%u\t%u\t", hashes->salts_done, hashes->salts_cnt);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* temperature
|
|
|
|
*/
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options->gpu_temp_disable == false)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
fprintf (out, "TEMP\t");
|
|
|
|
|
|
|
|
hc_thread_mutex_lock (mux_hwmon);
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
2016-09-28 20:28:44 +00:00
|
|
|
int temp = hm_get_temperature_with_device_id (hwmon_ctx, opencl_ctx, device_id);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
fprintf (out, "%d\t", temp);
|
|
|
|
}
|
|
|
|
|
|
|
|
hc_thread_mutex_unlock (mux_hwmon);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* flush
|
|
|
|
*/
|
|
|
|
|
|
|
|
fputs (EOL, out);
|
|
|
|
fflush (out);
|
|
|
|
}
|
|
|
|
|
2016-09-29 13:19:12 +00:00
|
|
|
void status_display (opencl_ctx_t *opencl_ctx, const hwmon_ctx_t *hwmon_ctx, const hashconfig_t *hashconfig, const hashes_t *hashes, const cpt_ctx_t *cpt_ctx, const restore_ctx_t *restore_ctx, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const straight_ctx_t *straight_ctx, const combinator_ctx_t *combinator_ctx, const mask_ctx_t *mask_ctx)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-19 13:52:01 +00:00
|
|
|
if (opencl_ctx->devices_status == STATUS_INIT)
|
|
|
|
{
|
|
|
|
log_error ("ERROR: status view is not available during initialization phase");
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
return;
|
|
|
|
}
|
2016-09-18 20:16:03 +00:00
|
|
|
|
2016-09-08 07:21:25 +00:00
|
|
|
// in this case some required buffers are free'd, ascii_digest() would run into segfault
|
2016-09-28 11:51:00 +00:00
|
|
|
if (data.shutdown_inner == 1) return;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options->machine_readable == true)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-28 20:28:44 +00:00
|
|
|
status_display_machine_readable (opencl_ctx, hwmon_ctx, hashes, restore_ctx, user_options, user_options_extra, straight_ctx, combinator_ctx, mask_ctx);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
char tmp_buf[1000] = { 0 };
|
|
|
|
|
|
|
|
uint tmp_len = 0;
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
log_info ("Session.Name...: %s", user_options->session);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
char *status_type = strstatus (opencl_ctx->devices_status);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-09 14:54:48 +00:00
|
|
|
uint hash_mode = hashconfig->hash_mode;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
char *hash_type = strhashtype (hash_mode); // not a bug
|
|
|
|
|
|
|
|
log_info ("Status.........: %s", status_type);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* show rules
|
|
|
|
*/
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options->rp_files_cnt)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
uint i;
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
for (i = 0, tmp_len = 0; i < user_options->rp_files_cnt - 1 && tmp_len < sizeof (tmp_buf); i++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-22 10:45:48 +00:00
|
|
|
tmp_len += snprintf (tmp_buf + tmp_len, sizeof (tmp_buf) - tmp_len, "File (%s), ", user_options->rp_files[i]);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
snprintf (tmp_buf + tmp_len, sizeof (tmp_buf) - tmp_len, "File (%s)", user_options->rp_files[i]);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
log_info ("Rules.Type.....: %s", tmp_buf);
|
|
|
|
|
|
|
|
tmp_len = 0;
|
|
|
|
}
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options->rp_gen)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-22 10:45:48 +00:00
|
|
|
log_info ("Rules.Type.....: Generated (%u)", user_options->rp_gen);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options->rp_gen_seed)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-22 10:45:48 +00:00
|
|
|
log_info ("Rules.Seed.....: %u", user_options->rp_gen_seed);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* show input
|
|
|
|
*/
|
|
|
|
|
2016-09-22 10:23:26 +00:00
|
|
|
char *custom_charset_1 = user_options->custom_charset_1;
|
|
|
|
char *custom_charset_2 = user_options->custom_charset_2;
|
|
|
|
char *custom_charset_3 = user_options->custom_charset_3;
|
|
|
|
char *custom_charset_4 = user_options->custom_charset_4;
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options->attack_mode == ATTACK_MODE_STRAIGHT)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options_extra->wordlist_mode == WL_MODE_FILE)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-29 12:46:51 +00:00
|
|
|
log_info ("Input.Mode.....: File (%s)", straight_ctx->dict);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
2016-09-22 10:45:48 +00:00
|
|
|
else if (user_options_extra->wordlist_mode == WL_MODE_STDIN)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
log_info ("Input.Mode.....: Pipe");
|
|
|
|
}
|
|
|
|
}
|
2016-09-22 10:45:48 +00:00
|
|
|
else if (user_options->attack_mode == ATTACK_MODE_COMBI)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-29 12:46:51 +00:00
|
|
|
log_info ("Input.Left.....: File (%s)", combinator_ctx->dict1);
|
|
|
|
log_info ("Input.Right....: File (%s)", combinator_ctx->dict2);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
2016-09-22 10:45:48 +00:00
|
|
|
else if (user_options->attack_mode == ATTACK_MODE_BF)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-25 23:18:00 +00:00
|
|
|
char *mask = mask_ctx->mask;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (mask != NULL)
|
|
|
|
{
|
2016-09-25 23:18:00 +00:00
|
|
|
uint mask_len = mask_ctx->css_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
tmp_len += snprintf (tmp_buf + tmp_len, sizeof (tmp_buf) - tmp_len, "Mask (%s)", mask);
|
|
|
|
|
|
|
|
if (mask_len > 0)
|
|
|
|
{
|
2016-09-09 14:54:48 +00:00
|
|
|
if (hashconfig->opti_type & OPTI_TYPE_SINGLE_HASH)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-09 14:54:48 +00:00
|
|
|
if (hashconfig->opti_type & OPTI_TYPE_APPENDED_SALT)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-16 15:01:18 +00:00
|
|
|
mask_len -= hashes->salts_buf[0].salt_len;
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-09 14:54:48 +00:00
|
|
|
if (hashconfig->opts_type & OPTS_TYPE_PT_UNICODE) mask_len /= 2;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
tmp_len += snprintf (tmp_buf + tmp_len, sizeof (tmp_buf) - tmp_len, " [%i]", mask_len);
|
|
|
|
}
|
|
|
|
|
2016-09-25 23:18:00 +00:00
|
|
|
if (mask_ctx->masks_cnt > 1)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-27 11:30:29 +00:00
|
|
|
const int maks_pos_done = ((opencl_ctx->devices_status == STATUS_EXHAUSTED) && (opencl_ctx->run_main_level1 == true)) ? 1 : 0;
|
|
|
|
|
|
|
|
double mask_percentage = (double) (mask_ctx->masks_pos + maks_pos_done) / (double) mask_ctx->masks_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
tmp_len += snprintf (tmp_buf + tmp_len, sizeof (tmp_buf) - tmp_len, " (%.02f%%)", mask_percentage * 100);
|
|
|
|
}
|
|
|
|
|
|
|
|
log_info ("Input.Mode.....: %s", tmp_buf);
|
|
|
|
|
2016-09-22 10:23:26 +00:00
|
|
|
if ((custom_charset_1 != NULL) || (custom_charset_2 != NULL) || (custom_charset_3 != NULL) || (custom_charset_4 != NULL))
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-22 10:23:26 +00:00
|
|
|
if (custom_charset_1 == NULL) custom_charset_1 = "Undefined";
|
|
|
|
if (custom_charset_2 == NULL) custom_charset_2 = "Undefined";
|
|
|
|
if (custom_charset_3 == NULL) custom_charset_3 = "Undefined";
|
|
|
|
if (custom_charset_4 == NULL) custom_charset_4 = "Undefined";
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-22 10:23:26 +00:00
|
|
|
log_info ("Custom.Charset.: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tmp_len = 0;
|
|
|
|
}
|
2016-09-22 10:45:48 +00:00
|
|
|
else if (user_options->attack_mode == ATTACK_MODE_HYBRID1)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-29 12:46:51 +00:00
|
|
|
log_info ("Input.Left.....: File (%s)", straight_ctx->dict);
|
|
|
|
log_info ("Input.Right....: Mask (%s) [%i]", mask_ctx->mask, mask_ctx->css_cnt);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-22 10:23:26 +00:00
|
|
|
if ((custom_charset_1 != NULL) || (custom_charset_2 != NULL) || (custom_charset_3 != NULL) || (custom_charset_4 != NULL))
|
|
|
|
{
|
|
|
|
if (custom_charset_1 == NULL) custom_charset_1 = "Undefined";
|
|
|
|
if (custom_charset_2 == NULL) custom_charset_2 = "Undefined";
|
|
|
|
if (custom_charset_3 == NULL) custom_charset_3 = "Undefined";
|
|
|
|
if (custom_charset_4 == NULL) custom_charset_4 = "Undefined";
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-22 10:23:26 +00:00
|
|
|
log_info ("Custom.Charset.: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
}
|
2016-09-22 13:41:59 +00:00
|
|
|
else if (user_options->attack_mode == ATTACK_MODE_HYBRID2)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-29 12:46:51 +00:00
|
|
|
log_info ("Input.Left.....: Mask (%s) [%i]", mask_ctx->mask, mask_ctx->css_cnt);
|
|
|
|
log_info ("Input.Right....: File (%s)", straight_ctx->dict);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-22 10:23:26 +00:00
|
|
|
if ((custom_charset_1 != NULL) || (custom_charset_2 != NULL) || (custom_charset_3 != NULL) || (custom_charset_4 != NULL))
|
|
|
|
{
|
|
|
|
if (custom_charset_1 == NULL) custom_charset_1 = "Undefined";
|
|
|
|
if (custom_charset_2 == NULL) custom_charset_2 = "Undefined";
|
|
|
|
if (custom_charset_3 == NULL) custom_charset_3 = "Undefined";
|
|
|
|
if (custom_charset_4 == NULL) custom_charset_4 = "Undefined";
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-22 10:23:26 +00:00
|
|
|
log_info ("Custom.Charset.: -1 %s, -2 %s, -3 %s, -4 %s", custom_charset_1, custom_charset_2, custom_charset_3, custom_charset_4);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
if (hashes->digests_cnt == 1)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-09 14:54:48 +00:00
|
|
|
if (hashconfig->hash_mode == 2500)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-16 15:01:18 +00:00
|
|
|
wpa_t *wpa = (wpa_t *) hashes->esalts_buf;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
log_info ("Hash.Target....: %s (%02x:%02x:%02x:%02x:%02x:%02x <-> %02x:%02x:%02x:%02x:%02x:%02x)",
|
2016-09-16 15:01:18 +00:00
|
|
|
(char *) hashes->salts_buf[0].salt_buf,
|
2016-09-08 07:21:25 +00:00
|
|
|
wpa->orig_mac1[0],
|
|
|
|
wpa->orig_mac1[1],
|
|
|
|
wpa->orig_mac1[2],
|
|
|
|
wpa->orig_mac1[3],
|
|
|
|
wpa->orig_mac1[4],
|
|
|
|
wpa->orig_mac1[5],
|
|
|
|
wpa->orig_mac2[0],
|
|
|
|
wpa->orig_mac2[1],
|
|
|
|
wpa->orig_mac2[2],
|
|
|
|
wpa->orig_mac2[3],
|
|
|
|
wpa->orig_mac2[4],
|
|
|
|
wpa->orig_mac2[5]);
|
|
|
|
}
|
2016-09-09 14:54:48 +00:00
|
|
|
else if (hashconfig->hash_mode == 5200)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-16 15:01:18 +00:00
|
|
|
log_info ("Hash.Target....: File (%s)", hashes->hashfile);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
2016-09-09 14:54:48 +00:00
|
|
|
else if (hashconfig->hash_mode == 9000)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-16 15:01:18 +00:00
|
|
|
log_info ("Hash.Target....: File (%s)", hashes->hashfile);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
2016-09-09 14:54:48 +00:00
|
|
|
else if ((hashconfig->hash_mode >= 6200) && (hashconfig->hash_mode <= 6299))
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-16 15:01:18 +00:00
|
|
|
log_info ("Hash.Target....: File (%s)", hashes->hashfile);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
2016-09-09 14:54:48 +00:00
|
|
|
else if ((hashconfig->hash_mode >= 13700) && (hashconfig->hash_mode <= 13799))
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-16 15:01:18 +00:00
|
|
|
log_info ("Hash.Target....: File (%s)", hashes->hashfile);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-09-08 10:17:56 +00:00
|
|
|
char out_buf[HCBUFSIZ_LARGE] = { 0 };
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
ascii_digest (out_buf, 0, 0, hashconfig, hashes);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
// limit length
|
|
|
|
if (strlen (out_buf) > 40)
|
|
|
|
{
|
|
|
|
out_buf[41] = '.';
|
|
|
|
out_buf[42] = '.';
|
|
|
|
out_buf[43] = '.';
|
|
|
|
out_buf[44] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
log_info ("Hash.Target....: %s", out_buf);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-09-09 14:54:48 +00:00
|
|
|
if (hashconfig->hash_mode == 3000)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
char out_buf1[32] = { 0 };
|
|
|
|
char out_buf2[32] = { 0 };
|
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
ascii_digest (out_buf1, 0, 0, hashconfig, hashes);
|
|
|
|
ascii_digest (out_buf2, 0, 1, hashconfig, hashes);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
log_info ("Hash.Target....: %s, %s", out_buf1, out_buf2);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-09-16 15:01:18 +00:00
|
|
|
log_info ("Hash.Target....: File (%s)", hashes->hashfile);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
log_info ("Hash.Type......: %s", hash_type);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* speed new
|
|
|
|
*/
|
|
|
|
|
|
|
|
u64 speed_cnt[DEVICES_MAX] = { 0 };
|
|
|
|
double speed_ms[DEVICES_MAX] = { 0 };
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
speed_cnt[device_id] = 0;
|
|
|
|
speed_ms[device_id] = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < SPEED_CACHE; i++)
|
|
|
|
{
|
|
|
|
speed_cnt[device_id] += device_param->speed_cnt[i];
|
|
|
|
speed_ms[device_id] += device_param->speed_ms[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
speed_cnt[device_id] /= SPEED_CACHE;
|
|
|
|
speed_ms[device_id] /= SPEED_CACHE;
|
|
|
|
}
|
|
|
|
|
|
|
|
double hashes_all_ms = 0;
|
|
|
|
|
|
|
|
double hashes_dev_ms[DEVICES_MAX] = { 0 };
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
hashes_dev_ms[device_id] = 0;
|
|
|
|
|
|
|
|
if (speed_ms[device_id] > 0)
|
|
|
|
{
|
|
|
|
hashes_dev_ms[device_id] = (double) speed_cnt[device_id] / speed_ms[device_id];
|
|
|
|
|
|
|
|
hashes_all_ms += hashes_dev_ms[device_id];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* exec time
|
|
|
|
*/
|
|
|
|
|
|
|
|
double exec_all_ms[DEVICES_MAX] = { 0 };
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
double exec_ms_avg = get_avg_exec_time (device_param, EXEC_CACHE);
|
|
|
|
|
|
|
|
exec_all_ms[device_id] = exec_ms_avg;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* timers
|
|
|
|
*/
|
|
|
|
|
|
|
|
double ms_running = 0;
|
|
|
|
|
|
|
|
hc_timer_get (data.timer_running, ms_running);
|
|
|
|
|
|
|
|
double ms_paused = data.ms_paused;
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
if (opencl_ctx->devices_status == STATUS_PAUSED)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
double ms_paused_tmp = 0;
|
|
|
|
|
|
|
|
hc_timer_get (data.timer_paused, ms_paused_tmp);
|
|
|
|
|
|
|
|
ms_paused += ms_paused_tmp;
|
|
|
|
}
|
|
|
|
|
|
|
|
#if defined (_WIN)
|
|
|
|
|
|
|
|
__time64_t sec_run = (__time64_t) ms_running / 1000;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
time_t sec_run = (time_t) ms_running / 1000;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (sec_run)
|
|
|
|
{
|
|
|
|
char display_run[32] = { 0 };
|
|
|
|
|
|
|
|
struct tm tm_run;
|
|
|
|
|
|
|
|
struct tm *tmp = NULL;
|
|
|
|
|
|
|
|
#if defined (_WIN)
|
|
|
|
|
|
|
|
tmp = _gmtime64 (&sec_run);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
tmp = gmtime (&sec_run);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (tmp != NULL)
|
|
|
|
{
|
|
|
|
memset (&tm_run, 0, sizeof (tm_run));
|
|
|
|
|
|
|
|
memcpy (&tm_run, tmp, sizeof (tm_run));
|
|
|
|
|
|
|
|
format_timer_display (&tm_run, display_run, sizeof (tm_run));
|
|
|
|
|
|
|
|
char *start = ctime (&data.proc_start);
|
|
|
|
|
|
|
|
size_t start_len = strlen (start);
|
|
|
|
|
|
|
|
if (start[start_len - 1] == '\n') start[start_len - 1] = 0;
|
|
|
|
if (start[start_len - 2] == '\r') start[start_len - 2] = 0;
|
|
|
|
|
|
|
|
log_info ("Time.Started...: %s (%s)", start, display_run);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
log_info ("Time.Started...: 0 secs");
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* counters
|
|
|
|
*/
|
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
u64 progress_total = data.words_cnt * hashes->salts_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
u64 all_done = 0;
|
|
|
|
u64 all_rejected = 0;
|
|
|
|
u64 all_restored = 0;
|
|
|
|
|
|
|
|
u64 progress_noneed = 0;
|
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
for (uint salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
all_done += data.words_progress_done[salt_pos];
|
|
|
|
all_rejected += data.words_progress_rejected[salt_pos];
|
|
|
|
all_restored += data.words_progress_restored[salt_pos];
|
|
|
|
|
|
|
|
// Important for ETA only
|
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
if (hashes->salts_shown[salt_pos] == 1)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
const u64 all = data.words_progress_done[salt_pos]
|
|
|
|
+ data.words_progress_rejected[salt_pos]
|
|
|
|
+ data.words_progress_restored[salt_pos];
|
|
|
|
|
|
|
|
const u64 left = data.words_cnt - all;
|
|
|
|
|
|
|
|
progress_noneed += left;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
u64 progress_cur = all_restored + all_done + all_rejected;
|
|
|
|
u64 progress_end = progress_total;
|
|
|
|
|
|
|
|
u64 progress_skip = 0;
|
|
|
|
|
2016-09-22 10:33:33 +00:00
|
|
|
if (user_options->skip)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-22 10:33:33 +00:00
|
|
|
progress_skip = MIN (user_options->skip, data.words_base) * hashes->salts_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-27 11:13:07 +00:00
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) progress_skip *= straight_ctx->kernel_rules_cnt;
|
2016-09-27 16:32:09 +00:00
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) progress_skip *= combinator_ctx->combs_cnt;
|
2016-09-25 23:18:00 +00:00
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_BF) progress_skip *= mask_ctx->bfs_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
|
2016-09-22 10:33:33 +00:00
|
|
|
if (user_options->limit)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-22 10:33:33 +00:00
|
|
|
progress_end = MIN (user_options->limit, data.words_base) * hashes->salts_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-27 11:13:07 +00:00
|
|
|
if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) progress_end *= straight_ctx->kernel_rules_cnt;
|
2016-09-27 16:32:09 +00:00
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_COMBI) progress_end *= combinator_ctx->combs_cnt;
|
2016-09-25 23:18:00 +00:00
|
|
|
else if (user_options_extra->attack_kern == ATTACK_KERN_BF) progress_end *= mask_ctx->bfs_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
u64 progress_cur_relative_skip = progress_cur - progress_skip;
|
|
|
|
u64 progress_end_relative_skip = progress_end - progress_skip;
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK))
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
if (opencl_ctx->devices_status != STATUS_CRACKED)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
#if defined (_WIN)
|
|
|
|
__time64_t sec_etc = 0;
|
|
|
|
#else
|
|
|
|
time_t sec_etc = 0;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (hashes_all_ms > 0)
|
|
|
|
{
|
|
|
|
u64 progress_left_relative_skip = progress_end_relative_skip - progress_cur_relative_skip;
|
|
|
|
|
|
|
|
u64 ms_left = (u64) ((progress_left_relative_skip - progress_noneed) / hashes_all_ms);
|
|
|
|
|
|
|
|
sec_etc = ms_left / 1000;
|
|
|
|
}
|
|
|
|
|
2016-09-08 12:05:53 +00:00
|
|
|
#define SEC10YEARS (60 * 60 * 24 * 365 * 10)
|
|
|
|
|
2016-09-08 07:21:25 +00:00
|
|
|
if (sec_etc == 0)
|
|
|
|
{
|
|
|
|
//log_info ("Time.Estimated.: 0 secs");
|
|
|
|
}
|
2016-09-08 12:05:53 +00:00
|
|
|
else if ((u64) sec_etc > SEC10YEARS)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
log_info ("Time.Estimated.: > 10 Years");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char display_etc[32] = { 0 };
|
|
|
|
char display_runtime[32] = { 0 };
|
|
|
|
|
|
|
|
struct tm tm_etc;
|
|
|
|
struct tm tm_runtime;
|
|
|
|
|
|
|
|
struct tm *tmp = NULL;
|
|
|
|
|
|
|
|
#if defined (_WIN)
|
|
|
|
tmp = _gmtime64 (&sec_etc);
|
|
|
|
#else
|
|
|
|
tmp = gmtime (&sec_etc);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (tmp != NULL)
|
|
|
|
{
|
|
|
|
memcpy (&tm_etc, tmp, sizeof (tm_etc));
|
|
|
|
|
|
|
|
format_timer_display (&tm_etc, display_etc, sizeof (display_etc));
|
|
|
|
|
|
|
|
time_t now;
|
|
|
|
|
|
|
|
time (&now);
|
|
|
|
|
|
|
|
now += sec_etc;
|
|
|
|
|
|
|
|
char *etc = ctime (&now);
|
|
|
|
|
|
|
|
size_t etc_len = strlen (etc);
|
|
|
|
|
|
|
|
if (etc[etc_len - 1] == '\n') etc[etc_len - 1] = 0;
|
|
|
|
if (etc[etc_len - 2] == '\r') etc[etc_len - 2] = 0;
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options->runtime)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
time_t runtime_cur;
|
|
|
|
|
|
|
|
time (&runtime_cur);
|
|
|
|
|
|
|
|
#if defined (_WIN)
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
__time64_t runtime_left = data.proc_start + user_options->runtime + data.prepare_time + (ms_paused / 1000) - runtime_cur;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
tmp = _gmtime64 (&runtime_left);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
time_t runtime_left = data.proc_start + user_options->runtime + data.prepare_time + (ms_paused / 1000) - runtime_cur;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
tmp = gmtime (&runtime_left);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if ((tmp != NULL) && (runtime_left > 0) && (runtime_left < sec_etc))
|
|
|
|
{
|
|
|
|
memcpy (&tm_runtime, tmp, sizeof (tm_runtime));
|
|
|
|
|
|
|
|
format_timer_display (&tm_runtime, display_runtime, sizeof (display_runtime));
|
|
|
|
|
|
|
|
log_info ("Time.Estimated.: %s (%s), but limited (%s)", etc, display_etc, display_runtime);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
log_info ("Time.Estimated.: %s (%s), but limit exceeded", etc, display_etc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
log_info ("Time.Estimated.: %s (%s)", etc, display_etc);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
char display_dev_cur[16] = { 0 };
|
|
|
|
|
|
|
|
strncpy (display_dev_cur, "0.00", 4);
|
|
|
|
|
|
|
|
format_speed_display (hashes_dev_ms[device_id] * 1000, display_dev_cur, sizeof (display_dev_cur));
|
|
|
|
|
|
|
|
log_info ("Speed.Dev.#%d...: %9sH/s (%0.2fms)", device_id + 1, display_dev_cur, exec_all_ms[device_id]);
|
|
|
|
}
|
|
|
|
|
|
|
|
char display_all_cur[16] = { 0 };
|
|
|
|
|
|
|
|
strncpy (display_all_cur, "0.00", 4);
|
|
|
|
|
|
|
|
format_speed_display (hashes_all_ms * 1000, display_all_cur, sizeof (display_all_cur));
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
if (opencl_ctx->devices_active > 1) log_info ("Speed.Dev.#*...: %9sH/s", display_all_cur);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
const double digests_percent = (double) hashes->digests_done / hashes->digests_cnt;
|
|
|
|
const double salts_percent = (double) hashes->salts_done / hashes->salts_cnt;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
log_info ("Recovered......: %u/%u (%.2f%%) Digests, %u/%u (%.2f%%) Salts", hashes->digests_done, hashes->digests_cnt, digests_percent * 100, hashes->salts_done, hashes->salts_cnt, salts_percent * 100);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
// crack-per-time
|
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
if (hashes->digests_cnt > 100)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
time_t now = time (NULL);
|
|
|
|
|
|
|
|
int cpt_cur_min = 0;
|
|
|
|
int cpt_cur_hour = 0;
|
|
|
|
int cpt_cur_day = 0;
|
|
|
|
|
|
|
|
for (int i = 0; i < CPT_BUF; i++)
|
|
|
|
{
|
2016-09-29 13:19:12 +00:00
|
|
|
const uint cracked = cpt_ctx->cpt_buf[i].cracked;
|
|
|
|
const time_t timestamp = cpt_ctx->cpt_buf[i].timestamp;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if ((timestamp + 60) > now)
|
|
|
|
{
|
|
|
|
cpt_cur_min += cracked;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((timestamp + 3600) > now)
|
|
|
|
{
|
|
|
|
cpt_cur_hour += cracked;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((timestamp + 86400) > now)
|
|
|
|
{
|
|
|
|
cpt_cur_day += cracked;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
double ms_real = ms_running - ms_paused;
|
|
|
|
|
2016-09-29 13:19:12 +00:00
|
|
|
double cpt_avg_min = (double) cpt_ctx->cpt_total / ((ms_real / 1000) / 60);
|
|
|
|
double cpt_avg_hour = (double) cpt_ctx->cpt_total / ((ms_real / 1000) / 3600);
|
|
|
|
double cpt_avg_day = (double) cpt_ctx->cpt_total / ((ms_real / 1000) / 86400);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-29 13:19:12 +00:00
|
|
|
if ((cpt_ctx->cpt_start + 86400) < now)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
log_info ("Recovered/Time.: CUR:%" PRIu64 ",%" PRIu64 ",%" PRIu64 " AVG:%0.2f,%0.2f,%0.2f (Min,Hour,Day)",
|
|
|
|
cpt_cur_min,
|
|
|
|
cpt_cur_hour,
|
|
|
|
cpt_cur_day,
|
|
|
|
cpt_avg_min,
|
|
|
|
cpt_avg_hour,
|
|
|
|
cpt_avg_day);
|
|
|
|
}
|
2016-09-29 13:19:12 +00:00
|
|
|
else if ((cpt_ctx->cpt_start + 3600) < now)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
log_info ("Recovered/Time.: CUR:%" PRIu64 ",%" PRIu64 ",N/A AVG:%0.2f,%0.2f,%0.2f (Min,Hour,Day)",
|
|
|
|
cpt_cur_min,
|
|
|
|
cpt_cur_hour,
|
|
|
|
cpt_avg_min,
|
|
|
|
cpt_avg_hour,
|
|
|
|
cpt_avg_day);
|
|
|
|
}
|
2016-09-29 13:19:12 +00:00
|
|
|
else if ((cpt_ctx->cpt_start + 60) < now)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
log_info ("Recovered/Time.: CUR:%" PRIu64 ",N/A,N/A AVG:%0.2f,%0.2f,%0.2f (Min,Hour,Day)",
|
|
|
|
cpt_cur_min,
|
|
|
|
cpt_avg_min,
|
|
|
|
cpt_avg_hour,
|
|
|
|
cpt_avg_day);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
log_info ("Recovered/Time.: CUR:N/A,N/A,N/A AVG:%0.2f,%0.2f,%0.2f (Min,Hour,Day)",
|
|
|
|
cpt_avg_min,
|
|
|
|
cpt_avg_hour,
|
|
|
|
cpt_avg_day);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Restore point
|
|
|
|
|
2016-09-24 23:02:44 +00:00
|
|
|
u64 restore_point = get_lowest_words_done (restore_ctx, opencl_ctx);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
u64 restore_total = data.words_base;
|
|
|
|
|
|
|
|
double percent_restore = 0;
|
|
|
|
|
|
|
|
if (restore_total != 0) percent_restore = (double) restore_point / (double) restore_total;
|
|
|
|
|
|
|
|
if (progress_end_relative_skip)
|
|
|
|
{
|
2016-09-22 10:45:48 +00:00
|
|
|
if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK))
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
double percent_finished = (double) progress_cur_relative_skip / (double) progress_end_relative_skip;
|
|
|
|
double percent_rejected = 0.0;
|
|
|
|
|
|
|
|
if (progress_cur)
|
|
|
|
{
|
|
|
|
percent_rejected = (double) (all_rejected) / (double) progress_cur;
|
|
|
|
}
|
|
|
|
|
|
|
|
log_info ("Progress.......: %" PRIu64 "/%" PRIu64 " (%.02f%%)", progress_cur_relative_skip, progress_end_relative_skip, percent_finished * 100);
|
|
|
|
log_info ("Rejected.......: %" PRIu64 "/%" PRIu64 " (%.02f%%)", all_rejected, progress_cur_relative_skip, percent_rejected * 100);
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options->restore_disable == false)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
if (percent_finished != 1)
|
|
|
|
{
|
|
|
|
log_info ("Restore.Point..: %" PRIu64 "/%" PRIu64 " (%.02f%%)", restore_point, restore_total, percent_restore * 100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-09-22 10:45:48 +00:00
|
|
|
if ((user_options_extra->wordlist_mode == WL_MODE_FILE) || (user_options_extra->wordlist_mode == WL_MODE_MASK))
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
log_info ("Progress.......: %" PRIu64 "/%" PRIu64 " (%.02f%%)", 0ull, 0ull, 100);
|
|
|
|
log_info ("Rejected.......: %" PRIu64 "/%" PRIu64 " (%.02f%%)", 0ull, 0ull, 100);
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options->restore_disable == false)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
log_info ("Restore.Point..: %" PRIu64 "/%" PRIu64 " (%.02f%%)", 0ull, 0ull, 100);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
log_info ("Progress.......: %" PRIu64 "", progress_cur_relative_skip);
|
|
|
|
log_info ("Rejected.......: %" PRIu64 "", all_rejected);
|
|
|
|
|
|
|
|
// --restore not allowed if stdin is used -- really? why?
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
//if (user_options->restore_disable == false)
|
2016-09-08 07:21:25 +00:00
|
|
|
//{
|
|
|
|
// log_info ("Restore.Point..: %" PRIu64 "", restore_point);
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
if (opencl_ctx->run_main_level1 == false) return;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options->gpu_temp_disable == false)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
hc_thread_mutex_lock (mux_hwmon);
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
2016-09-28 20:28:44 +00:00
|
|
|
const int num_temperature = hm_get_temperature_with_device_id (hwmon_ctx, opencl_ctx, device_id);
|
|
|
|
const int num_fanspeed = hm_get_fanspeed_with_device_id (hwmon_ctx, opencl_ctx, device_id);
|
|
|
|
const int num_utilization = hm_get_utilization_with_device_id (hwmon_ctx, opencl_ctx, device_id);
|
|
|
|
const int num_corespeed = hm_get_corespeed_with_device_id (hwmon_ctx, opencl_ctx, device_id);
|
|
|
|
const int num_memoryspeed = hm_get_memoryspeed_with_device_id (hwmon_ctx, opencl_ctx, device_id);
|
|
|
|
const int num_buslanes = hm_get_buslanes_with_device_id (hwmon_ctx, opencl_ctx, device_id);
|
|
|
|
const int num_throttle = hm_get_throttle_with_device_id (hwmon_ctx, opencl_ctx, device_id);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
char output_buf[256] = { 0 };
|
|
|
|
|
|
|
|
int output_len = 0;
|
|
|
|
|
|
|
|
if (num_temperature >= 0)
|
|
|
|
{
|
|
|
|
snprintf (output_buf + output_len, sizeof (output_buf) - output_len, " Temp:%3uc", num_temperature);
|
|
|
|
|
|
|
|
output_len = strlen (output_buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (num_fanspeed >= 0)
|
|
|
|
{
|
|
|
|
snprintf (output_buf + output_len, sizeof (output_buf) - output_len, " Fan:%3u%%", num_fanspeed);
|
|
|
|
|
|
|
|
output_len = strlen (output_buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (num_utilization >= 0)
|
|
|
|
{
|
|
|
|
snprintf (output_buf + output_len, sizeof (output_buf) - output_len, " Util:%3u%%", num_utilization);
|
|
|
|
|
|
|
|
output_len = strlen (output_buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (num_corespeed >= 0)
|
|
|
|
{
|
|
|
|
snprintf (output_buf + output_len, sizeof (output_buf) - output_len, " Core:%4uMhz", num_corespeed);
|
|
|
|
|
|
|
|
output_len = strlen (output_buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (num_memoryspeed >= 0)
|
|
|
|
{
|
|
|
|
snprintf (output_buf + output_len, sizeof (output_buf) - output_len, " Mem:%4uMhz", num_memoryspeed);
|
|
|
|
|
|
|
|
output_len = strlen (output_buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (num_buslanes >= 0)
|
|
|
|
{
|
|
|
|
snprintf (output_buf + output_len, sizeof (output_buf) - output_len, " Lanes:%u", num_buslanes);
|
|
|
|
|
|
|
|
output_len = strlen (output_buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (num_throttle == 1)
|
|
|
|
{
|
|
|
|
snprintf (output_buf + output_len, sizeof (output_buf) - output_len, " *Throttled*");
|
|
|
|
|
|
|
|
output_len = strlen (output_buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (output_len == 0)
|
|
|
|
{
|
|
|
|
snprintf (output_buf + output_len, sizeof (output_buf) - output_len, " N/A");
|
|
|
|
|
|
|
|
output_len = strlen (output_buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
log_info ("HWMon.Dev.#%d...:%s", device_id + 1, output_buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
hc_thread_mutex_unlock (mux_hwmon);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
void status_benchmark_automate (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-19 13:52:01 +00:00
|
|
|
if (opencl_ctx->devices_status == STATUS_INIT)
|
|
|
|
{
|
|
|
|
log_error ("ERROR: status view is not available during initialization phase");
|
2016-09-18 20:16:03 +00:00
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
return;
|
|
|
|
}
|
2016-09-18 20:16:03 +00:00
|
|
|
|
2016-09-08 07:21:25 +00:00
|
|
|
u64 speed_cnt[DEVICES_MAX] = { 0 };
|
|
|
|
double speed_ms[DEVICES_MAX] = { 0 };
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
speed_cnt[device_id] = device_param->speed_cnt[0];
|
|
|
|
speed_ms[device_id] = device_param->speed_ms[0];
|
|
|
|
}
|
|
|
|
|
2016-09-21 14:07:49 +00:00
|
|
|
u64 hashes_dev_ms[DEVICES_MAX] = { 0 };
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
hashes_dev_ms[device_id] = 0;
|
|
|
|
|
|
|
|
if (speed_ms[device_id] > 0)
|
|
|
|
{
|
|
|
|
hashes_dev_ms[device_id] = (double) speed_cnt[device_id] / speed_ms[device_id];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
2016-09-09 14:54:48 +00:00
|
|
|
log_info ("%u:%u:%" PRIu64 "", device_id + 1, hashconfig->hash_mode, (hashes_dev_ms[device_id] * 1000));
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
void status_benchmark (opencl_ctx_t *opencl_ctx, const hashconfig_t *hashconfig, const user_options_t *user_options)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-19 13:52:01 +00:00
|
|
|
if (opencl_ctx->devices_status == STATUS_INIT)
|
|
|
|
{
|
|
|
|
log_error ("ERROR: status view is not available during initialization phase");
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
return;
|
|
|
|
}
|
2016-09-18 20:16:03 +00:00
|
|
|
|
2016-09-28 11:51:00 +00:00
|
|
|
if (data.shutdown_inner == 1) return;
|
2016-09-08 07:21:25 +00:00
|
|
|
|
2016-09-22 10:45:48 +00:00
|
|
|
if (user_options->machine_readable == true)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-16 15:01:18 +00:00
|
|
|
status_benchmark_automate (opencl_ctx, hashconfig);
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
u64 speed_cnt[DEVICES_MAX] = { 0 };
|
|
|
|
double speed_ms[DEVICES_MAX] = { 0 };
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
speed_cnt[device_id] = device_param->speed_cnt[0];
|
|
|
|
speed_ms[device_id] = device_param->speed_ms[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
double hashes_all_ms = 0;
|
|
|
|
|
|
|
|
double hashes_dev_ms[DEVICES_MAX] = { 0 };
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
hashes_dev_ms[device_id] = 0;
|
|
|
|
|
|
|
|
if (speed_ms[device_id] > 0)
|
|
|
|
{
|
|
|
|
hashes_dev_ms[device_id] = (double) speed_cnt[device_id] / speed_ms[device_id];
|
|
|
|
|
|
|
|
hashes_all_ms += hashes_dev_ms[device_id];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* exec time
|
|
|
|
*/
|
|
|
|
|
|
|
|
double exec_all_ms[DEVICES_MAX] = { 0 };
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
double exec_ms_avg = get_avg_exec_time (device_param, EXEC_CACHE);
|
|
|
|
|
|
|
|
exec_all_ms[device_id] = exec_ms_avg;
|
|
|
|
}
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id];
|
2016-09-08 07:21:25 +00:00
|
|
|
|
|
|
|
if (device_param->skipped) continue;
|
|
|
|
|
|
|
|
char display_dev_cur[16] = { 0 };
|
|
|
|
|
|
|
|
strncpy (display_dev_cur, "0.00", 4);
|
|
|
|
|
|
|
|
format_speed_display (hashes_dev_ms[device_id] * 1000, display_dev_cur, sizeof (display_dev_cur));
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
if (opencl_ctx->devices_active >= 10)
|
2016-09-08 07:21:25 +00:00
|
|
|
{
|
|
|
|
log_info ("Speed.Dev.#%d: %9sH/s (%0.2fms)", device_id + 1, display_dev_cur, exec_all_ms[device_id]);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
log_info ("Speed.Dev.#%d.: %9sH/s (%0.2fms)", device_id + 1, display_dev_cur, exec_all_ms[device_id]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
char display_all_cur[16] = { 0 };
|
|
|
|
|
|
|
|
strncpy (display_all_cur, "0.00", 4);
|
|
|
|
|
|
|
|
format_speed_display (hashes_all_ms * 1000, display_all_cur, sizeof (display_all_cur));
|
|
|
|
|
2016-09-15 14:02:52 +00:00
|
|
|
if (opencl_ctx->devices_active > 1) log_info ("Speed.Dev.#*.: %9sH/s", display_all_cur);
|
2016-09-08 07:21:25 +00:00
|
|
|
}
|