1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 16:18:09 +00:00

Bring back mask length of mask as number to status screen

This commit is contained in:
jsteube 2016-10-29 22:44:01 +02:00
parent 87aed3482f
commit 9e156321ef
7 changed files with 41 additions and 22 deletions

View File

@ -20,6 +20,8 @@
#define INCR_MASKS 1000
u32 mp_get_length (char *mask);
void sp_exec (u64 ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, u32 start, u32 stop);
int mask_ctx_update_loop (hashcat_ctx_t *hashcat_ctx);

View File

@ -26,6 +26,7 @@ int status_get_input_mode (const hashcat_ctx_t *hashcat_ctx)
char *status_get_input_base (const hashcat_ctx_t *hashcat_ctx);
char *status_get_input_mod (const hashcat_ctx_t *hashcat_ctx);
char *status_get_input_charset (const hashcat_ctx_t *hashcat_ctx);
int status_get_input_mask_length (const hashcat_ctx_t *hashcat_ctx);
char *status_get_input_candidates_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id);
char *status_get_hash_type (const hashcat_ctx_t *hashcat_ctx);
char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx);

View File

@ -1568,9 +1568,11 @@ 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;
@ -1584,7 +1586,6 @@ typedef struct
int digests_cnt;
int digests_done;
double digests_percent;
int input_mode;
int salts_cnt;
int salts_done;
double salts_percent;

View File

@ -1182,6 +1182,7 @@ int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_st
hashcat_status->hash_type = status_get_hash_type (hashcat_ctx);
hashcat_status->input_base = status_get_input_base (hashcat_ctx);
hashcat_status->input_charset = status_get_input_charset (hashcat_ctx);
hashcat_status->input_mask_length = status_get_input_mask_length (hashcat_ctx);
hashcat_status->input_mode = status_get_input_mode (hashcat_ctx);
hashcat_status->input_mod = status_get_input_mod (hashcat_ctx);
hashcat_status->msec_paused = status_get_msec_paused (hashcat_ctx);

View File

@ -30,22 +30,6 @@ static int sp_comp_val (const void *p1, const void *p2)
return b2->val - b1->val;
}
static u32 mp_get_length (char *mask)
{
u32 len = 0;
u32 mask_len = strlen (mask);
for (u32 i = 0; i < mask_len; i++)
{
if (mask[i] == '?') i++;
len++;
}
return len;
}
static void mp_css_split_cnt (hashcat_ctx_t *hashcat_ctx, const u32 css_cnt_orig, u32 css_cnt_lr[2])
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
@ -947,6 +931,22 @@ static int mask_append (hashcat_ctx_t *hashcat_ctx, const char *mask)
return 0;
}
u32 mp_get_length (char *mask)
{
u32 len = 0;
u32 mask_len = strlen (mask);
for (u32 i = 0; i < mask_len; i++)
{
if (mask[i] == '?') i++;
len++;
}
return len;
}
int mask_ctx_update_loop (hashcat_ctx_t *hashcat_ctx)
{
combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx;

View File

@ -15,6 +15,7 @@
#include "hwmon.h"
#include "outfile.h"
#include "monitor.h"
#include "mpsp.h"
#include "status.h"
static const char ST_0000[] = "Initializing";
@ -524,6 +525,17 @@ char *status_get_input_charset (const hashcat_ctx_t *hashcat_ctx)
return NULL;
}
int status_get_input_mask_length (const hashcat_ctx_t *hashcat_ctx)
{
const mask_ctx_t *mask_ctx = hashcat_ctx->mask_ctx;
if (mask_ctx == NULL) return -1;
if (mask_ctx->mask == NULL) return -1;
return mp_get_length (mask_ctx->mask);
}
char *status_get_input_candidates_dev (const hashcat_ctx_t *hashcat_ctx, const int device_id)
{
const opencl_ctx_t *opencl_ctx = hashcat_ctx->opencl_ctx;

View File

@ -800,19 +800,21 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
case INPUT_MODE_MASK:
event_log_info (hashcat_ctx,
"Input.Mask.....: %s",
hashcat_status->input_base);
"Input.Mask.....: %s [%d]",
hashcat_status->input_base,
hashcat_status->input_mask_length);
break;
case INPUT_MODE_MASK_CS:
event_log_info (hashcat_ctx,
"Input.Mask.....: %s",
hashcat_status->input_base);
"Input.Mask.....: %s [%d]",
hashcat_status->input_base,
hashcat_status->input_mask_length);
event_log_info (hashcat_ctx,
"Input.Charset..: %s",
"Input.Charset..: %s ",
hashcat_status->input_charset);
break;