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

Prepare "Net New" value for status, test initial status message format

This commit is contained in:
Chick3nman 2022-02-14 16:54:36 -06:00
parent 88dbbad6b3
commit 808e6fff2b
6 changed files with 84 additions and 20 deletions

View File

@ -39,6 +39,7 @@ char *status_get_guess_candidates_dev (const hashcat_ctx_t *hash
char *status_get_hash_name (const hashcat_ctx_t *hashcat_ctx);
char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx);
int status_get_digests_done (const hashcat_ctx_t *hashcat_ctx);
int status_get_digests_done_pot (const hashcat_ctx_t *hashcat_ctx);
int status_get_digests_cnt (const hashcat_ctx_t *hashcat_ctx);
double status_get_digests_percent (const hashcat_ctx_t *hashcat_ctx);
int status_get_salts_done (const hashcat_ctx_t *hashcat_ctx);

View File

@ -941,6 +941,7 @@ typedef struct hashes
u32 digests_cnt;
u32 digests_done;
u32 digests_done_pot;
u32 digests_saved;
void *digests_buf;

View File

@ -1927,6 +1927,7 @@ int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_st
hashcat_status->digests_cnt = status_get_digests_cnt (hashcat_ctx);
hashcat_status->digests_done = status_get_digests_done (hashcat_ctx);
hashcat_status->digests_done_pot = status_get_digests_done_pot (hashcat_ctx);
hashcat_status->digests_percent = status_get_digests_percent (hashcat_ctx);
hashcat_status->hash_target = status_get_hash_target (hashcat_ctx);
hashcat_status->hash_name = status_get_hash_name (hashcat_ctx);

View File

@ -406,18 +406,18 @@ static void main_potfile_num_cracked (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, M
if (user_options->quiet == true) return;
const int potfile_remove_cracks = hashes->digests_done;
const int hashes->digests_done_pot = hashes->digests_done;
if (potfile_remove_cracks > 0)
if (hashes->digests_done_pot > 0)
{
if (potfile_remove_cracks == 1)
if (hashes->digests_done_pot == 1)
{
event_log_info (hashcat_ctx, "INFO: Removed 1 hash found as potfile entry or as empty hash.");
event_log_info (hashcat_ctx, NULL);
}
else
{
event_log_info (hashcat_ctx, "INFO: Removed %d hashes found as potfile entries or as empty hashes.", potfile_remove_cracks);
event_log_info (hashcat_ctx, "INFO: Removed %d hashes found as potfile entries or as empty hashes.", hashes->digests_done_pot);
event_log_info (hashcat_ctx, NULL);
}
}

View File

@ -893,6 +893,13 @@ int status_get_digests_done (const hashcat_ctx_t *hashcat_ctx)
return hashes->digests_done;
}
int status_get_digests_done_pot (const hashcat_ctx_t *hashcat_ctx)
{
const hashes_t *hashes = hashcat_ctx->hashes;
return hashes->digests_done_pot;
}
int status_get_digests_cnt (const hashcat_ctx_t *hashcat_ctx)
{
const hashes_t *hashes = hashcat_ctx->hashes;

View File

@ -2090,7 +2090,61 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
"Speed.#*.........: %9sH/s",
hashcat_status->speed_sec_all);
}
if (hashes_status->digests_done_pot > 0)
{
if (hashcat_status->salts_cnt > 1)
{
const int digests_net_new = hashcat_status->digests_done - hashcat_status->digests_done_pot;
if (digests_net_new > 1)
{
event_log_info (hashcat_ctx,
"Recovered........: %d/%d (%.2f%%) Digests, %d/%d (%.2f%%) Salts, %d This Session",
hashcat_status->digests_done,
hashcat_status->digests_cnt,
hashcat_status->digests_percent,
hashcat_status->salts_done,
hashcat_status->salts_cnt,
hashcat_status->salts_percent,
digests_net_new);
}
else
{
event_log_info (hashcat_ctx,
"Recovered........: %d/%d (%.2f%%) Digests, %d/%d (%.2f%%) Salts",
hashcat_status->digests_done,
hashcat_status->digests_cnt,
hashcat_status->digests_percent,
hashcat_status->salts_done,
hashcat_status->salts_cnt,
hashcat_status->salts_percent);
}
}
else
{
const int digests_net_new = hashcat_status->digests_done - hashcat_status->digests_done_pot;
if (digests_net_new > 1)
{
event_log_info (hashcat_ctx,
"Recovered........: %d/%d (%.2f%%) Digests, %d This Session",
hashcat_status->digests_done,
hashcat_status->digests_cnt,
hashcat_status->digests_percent,
digests_net_new);
}
else
{
event_log_info (hashcat_ctx,
"Recovered........: %d/%d (%.2f%%) Digests",
hashcat_status->digests_done,
hashcat_status->digests_cnt,
hashcat_status->digests_percent);
}
}
}
else
{
if (hashcat_status->salts_cnt > 1)
{
event_log_info (hashcat_ctx,
@ -2110,7 +2164,7 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
hashcat_status->digests_cnt,
hashcat_status->digests_percent);
}
}
if (hashcat_status->digests_cnt > 1000)
{
const int digests_remain = hashcat_status->digests_cnt - hashcat_status->digests_done;