Added CPT functions for later use in status.c

This commit is contained in:
jsteube
2016-10-17 15:19:25 +02:00
parent df521d664b
commit 86c1c7ef10
5 changed files with 259 additions and 103 deletions

View File

@@ -16,6 +16,9 @@ double get_avg_exec_time (hc_device_param_t *device_param, const int last_num_en
void format_timer_display (struct tm *tm, char *buf, size_t len);
void format_speed_display (double val, char *buf, size_t len);
int status_get_device_info_cnt (const hashcat_ctx_t *hashcat_ctx);
int status_get_device_info_active (const hashcat_ctx_t *hashcat_ctx);
bool status_get_skipped_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
char *status_get_session (const hashcat_ctx_t *hashcat_ctx);
char *status_get_status_string (const hashcat_ctx_t *hashcat_ctx);
int status_get_input_mode (const hashcat_ctx_t *hashcat_ctx);
@@ -32,6 +35,7 @@ int status_get_salts_cnt (const hashcat_ctx_t *hashcat_ctx)
double status_get_salts_percent (const hashcat_ctx_t *hashcat_ctx);
double status_get_msec_running (const hashcat_ctx_t *hashcat_ctx);
double status_get_msec_paused (const hashcat_ctx_t *hashcat_ctx);
double status_get_msec_real (const hashcat_ctx_t *hashcat_ctx);
char *status_get_time_started_absolute (const hashcat_ctx_t *hashcat_ctx);
char *status_get_time_started_relative (const hashcat_ctx_t *hashcat_ctx);
char *status_get_time_estimated_absolute (const hashcat_ctx_t *hashcat_ctx);
@@ -49,11 +53,18 @@ u64 status_get_progress_skip (const hashcat_ctx_t *hashcat_ctx)
u64 status_get_progress_cur_relative_skip (const hashcat_ctx_t *hashcat_ctx);
u64 status_get_progress_end_relative_skip (const hashcat_ctx_t *hashcat_ctx);
double status_get_hashes_msec_all (const hashcat_ctx_t *hashcat_ctx);
double status_get_hashes_msec_dev (const hashcat_ctx_t *hashcat_ctx, const u32 device_id);
double status_get_hashes_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
double status_get_exec_msec_all (const hashcat_ctx_t *hashcat_ctx);
double status_get_exec_msec_dev (const hashcat_ctx_t *hashcat_ctx, const u32 device_id);
double status_get_exec_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
char *status_get_speed_sec_all (const hashcat_ctx_t *hashcat_ctx);
char *status_get_speed_sec_dev (const hashcat_ctx_t *hashcat_ctx, const u32 device_id);
char *status_get_speed_sec_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
int status_get_cpt_cur_min (const hashcat_ctx_t *hashcat_ctx);
int status_get_cpt_cur_hour (const hashcat_ctx_t *hashcat_ctx);
int status_get_cpt_cur_day (const hashcat_ctx_t *hashcat_ctx);
double status_get_cpt_avg_min (const hashcat_ctx_t *hashcat_ctx);
double status_get_cpt_avg_hour (const hashcat_ctx_t *hashcat_ctx);
double status_get_cpt_avg_day (const hashcat_ctx_t *hashcat_ctx);
char *status_get_cpt (const hashcat_ctx_t *hashcat_ctx);
int status_progress_init (hashcat_ctx_t *hashcat_ctx);
void status_progress_destroy (hashcat_ctx_t *hashcat_ctx);

View File

@@ -1452,13 +1452,6 @@ typedef struct hashcat_ctx
} hashcat_ctx_t;
typedef struct
{
bool skipped;
} device_info_t;
typedef enum input_mode
{
INPUT_MODE_NONE = 0,
@@ -1479,6 +1472,15 @@ typedef enum input_mode
} input_mode_t;
typedef struct
{
bool skipped_dev;
double hashes_msec_dev;
double exec_msec_dev;
char *speed_sec_dev;
} device_info_t;
typedef struct
{
char *hash_target;
@@ -1494,6 +1496,7 @@ typedef struct
char *time_started_relative;
double msec_paused;
double msec_running;
double msec_real;
int digests_cnt;
int digests_done;
double digests_percent;
@@ -1513,9 +1516,21 @@ typedef struct
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;