Skip to content

Commit

Permalink
Incremental: Do not print length figures until they are final
Browse files Browse the repository at this point in the history
  • Loading branch information
magnumripper authored and solardiz committed Apr 25, 2021
1 parent e2f5690 commit 14467d3
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions src/inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,20 +496,6 @@ void do_incremental_crack(struct db_main *db, const char *mode)
if (john_main_process)
log_event("Proceeding with \"incremental\" mode: %.100s", mode);

if ((options.flags & FLG_BATCH_CHK || rec_restored) && john_main_process) {
fprintf(stderr, "Proceeding with incremental:%s", mode);
if (options.flags & FLG_MASK_CHK)
fprintf(stderr, ", hybrid mask:%s", options.mask ?
options.mask : options.eff_mask);
if (options.rule_stack)
fprintf(stderr, ", rules-stack:%s", options.rule_stack);
if (options.req_minlength >= 0 || options.req_maxlength)
fprintf(stderr, ", lengths: %d-%d",
options.eff_minlength + mask_add_len,
options.eff_maxlength + mask_add_len);
fprintf(stderr, "\n");
}

if (!(charset = cfg_get_param(SECTION_INC, mode, "File"))) {
if (cfg_get_section(SECTION_INC, mode) == NULL) {
log_event("! Unknown incremental mode: %s", mode);
Expand Down Expand Up @@ -542,7 +528,6 @@ void do_incremental_crack(struct db_main *db, const char *mode)
max_length = our_fmt_len;
}


max_count = options.charcount ?
options.charcount : cfg_get_int(SECTION_INC, mode, "CharCount");

Expand Down Expand Up @@ -578,6 +563,20 @@ void do_incremental_crack(struct db_main *db, const char *mode)
max_length = min_length;
}

if (((options.flags & FLG_BATCH_CHK) || rec_restored) && john_main_process) {
fprintf(stderr, "Proceeding with incremental:%s", mode);
if (options.flags & FLG_MASK_CHK)
fprintf(stderr, ", hybrid mask:%s", options.mask ?
options.mask : options.eff_mask);
if (options.rule_stack)
fprintf(stderr, ", rules-stack:%s", options.rule_stack);
if (min_length > 0 || options.req_maxlength)
fprintf(stderr, ", lengths: %d-%d",
min_length + mask_add_len,
max_length + mask_add_len);
fprintf(stderr, "\n");
}

if (min_length > max_length) {
log_event("! MinLen = %d exceeds MaxLen = %d",
min_length, max_length);
Expand Down

0 comments on commit 14467d3

Please sign in to comment.