>From ab8f8e6859cae21b4c2b1629f834096e4db26d4f Mon Sep 17 00:00:00 2001 From: Frank Dittrich Date: Fri, 15 Jun 2012 18:18:57 +0200 Subject: [PATCH 4/4] Markov: improved logging $ ./john pw --markov Loaded 1 password hash (dummy [N/A]) MKV start (stats=$JOHN/stats, lvl=200 len=12 pwd=259356431) 0:00:00:00 Proceeding with Markov mode 0:00:00:00 - Statsfile: $JOHN/stats 0:00:00:00 - Markov level: 0 - 200 0:00:00:00 - Length: 0 - 12 0:00:00:00 - Start-End: 0 - 259356431 $ ./john pw --markov=100-200:0:25935643:6-10 Loaded 1 password hash (dummy [N/A]) MKV start (stats=$JOHN/stats, lvl=100-200 len=6-10 pwd=25935643) 0:00:00:00 Proceeding with Markov mode 100-200:0:25935643:6-10 0:00:00:00 - Statsfile: $JOHN/stats 0:00:00:00 - Markov level: 100 - 200 0:00:00:00 - Length: 6 - 10 0:00:00:00 - Start-End: 0 - 25935643 --- src/mkv.c | 22 ++++++++++++++++++++-- 1 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/mkv.c b/src/mkv.c index 04c8c37..bd8fe9c 100644 --- a/src/mkv.c +++ b/src/mkv.c @@ -388,6 +388,7 @@ void get_markov_options(struct db_main *db, void do_markov_crack(struct db_main *db, char *mkv_param) { char *statfile = NULL; + char *param = NULL; unsigned int mkv_minlevel, mkv_level, mkv_maxlen, mkv_minlen; unsigned long long mkv_start, mkv_end; @@ -395,6 +396,13 @@ void do_markov_crack(struct db_main *db, char *mkv_param) unsigned long long mkv_size; #endif + if(mkv_param != NULL) + { + param = str_alloc_copy(mkv_param); + if(param == NULL) + param = mkv_param; + } + get_markov_options(db, mkv_param, &mkv_minlevel, &mkv_level, &mkv_start, &mkv_end, @@ -444,7 +452,7 @@ void do_markov_crack(struct db_main *db, char *mkv_param) #ifdef HAVE_MPI if (mpi_id == 0) { - fprintf(stderr, "MKV start (lvl="); + fprintf(stderr, "MKV start (stats=%s, lvl=", statfile); if(mkv_minlevel>0) fprintf(stderr, "%d-", mkv_minlevel); fprintf(stderr, "%d len=", mkv_level); if(mkv_minlen>0) fprintf(stderr, "%d-", mkv_minlen); @@ -463,13 +471,23 @@ void do_markov_crack(struct db_main *db, char *mkv_param) gend = mkv_end + 10; /* omg !! */ #ifndef HAVE_MPI - fprintf(stderr, "MKV start (lvl="); + fprintf(stderr, "MKV start (stats=%s, lvl=", statfile); if(mkv_minlevel>0) fprintf(stderr, "%d-", mkv_minlevel); fprintf(stderr, "%d len=", mkv_level); if(mkv_minlen>0) fprintf(stderr, "%d-", mkv_minlen); fprintf(stderr, "%d pwd="LLd")\n", mkv_maxlen, mkv_end-mkv_start); #endif + if(param) + log_event("Proceeding with Markov mode %s", param); + else + log_event("Proceeding with Markov mode"); + + log_event("- Statsfile: %s", statfile); + log_event("- Markov level: %d - %d", mkv_minlevel, mkv_level); + log_event("- Length: %d - %d", mkv_minlen, mkv_maxlen); + log_event("- Start-End: "LLd" - "LLd, mkv_start, mkv_end); + show_pwd(mkv_start); if (!event_abort) -- 1.7.7.6