"Fossies" - the Fresh Open Source Software Archive

Member "hashcat-6.2.6/src/terminal.c" (2 Sep 2022, 91323 Bytes) of package /linux/privat/hashcat-6.2.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "terminal.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 6.2.5_vs_6.2.6.

    1 /**
    2  * Author......: See docs/credits.txt
    3  * License.....: MIT
    4  */
    5 
    6 #include "common.h"
    7 #include "types.h"
    8 #include "memory.h"
    9 #include "event.h"
   10 #include "convert.h"
   11 #include "thread.h"
   12 #include "status.h"
   13 #include "shared.h"
   14 #include "hwmon.h"
   15 #include "interface.h"
   16 #include "hashcat.h"
   17 #include "timer.h"
   18 #include "terminal.h"
   19 
   20 static const size_t MAXIMUM_EXAMPLE_HASH_LENGTH = 200;
   21 
   22 static const size_t TERMINAL_LINE_LENGTH = 79;
   23 
   24 static const char *const PROMPT_ACTIVE = "[s]tatus [p]ause [b]ypass [c]heckpoint [f]inish [q]uit => ";
   25 static const char *const PROMPT_PAUSED = "[s]tatus [r]esume [b]ypass [c]heckpoint [f]inish [q]uit => ";
   26 
   27 void welcome_screen (hashcat_ctx_t *hashcat_ctx, const char *version_tag)
   28 {
   29   const user_options_t *user_options = hashcat_ctx->user_options;
   30 
   31   if (user_options->quiet       == true) return;
   32   if (user_options->keyspace    == true) return;
   33   if (user_options->stdout_flag == true) return;
   34   if (user_options->show        == true) return;
   35   if (user_options->left        == true) return;
   36   if (user_options->identify    == true) return;
   37 
   38   if (user_options->usage == true)
   39   {
   40     event_log_info (hashcat_ctx, "%s (%s) starting in help mode", PROGNAME, version_tag);
   41     event_log_info (hashcat_ctx, NULL);
   42   }
   43   else if (user_options->benchmark == true)
   44   {
   45     if (user_options->machine_readable == false)
   46     {
   47       event_log_info (hashcat_ctx, "%s (%s) starting in benchmark mode", PROGNAME, version_tag);
   48 
   49       event_log_info (hashcat_ctx, NULL);
   50 
   51       if (user_options->workload_profile_chgd == false)
   52       {
   53         event_log_advice (hashcat_ctx, "Benchmarking uses hand-optimized kernel code by default.");
   54         event_log_advice (hashcat_ctx, "You can use it in your cracking session by setting the -O option.");
   55         event_log_advice (hashcat_ctx, "Note: Using optimized kernel code limits the maximum supported password length.");
   56         event_log_advice (hashcat_ctx, "To disable the optimized kernel code in benchmark mode, use the -w option.");
   57         event_log_advice (hashcat_ctx, NULL);
   58       }
   59     }
   60     else
   61     {
   62       event_log_info (hashcat_ctx, "# version: %s", version_tag);
   63     }
   64   }
   65   else if (user_options->restore == true)
   66   {
   67     event_log_info (hashcat_ctx, "%s (%s) starting in restore mode", PROGNAME, version_tag);
   68     event_log_info (hashcat_ctx, NULL);
   69   }
   70   else if (user_options->speed_only == true)
   71   {
   72     event_log_info (hashcat_ctx, "%s (%s) starting in speed-only mode", PROGNAME, version_tag);
   73     event_log_info (hashcat_ctx, NULL);
   74   }
   75   else if (user_options->progress_only == true)
   76   {
   77     event_log_info (hashcat_ctx, "%s (%s) starting in progress-only mode", PROGNAME, version_tag);
   78     event_log_info (hashcat_ctx, NULL);
   79   }
   80   else if (user_options->backend_info > 0)
   81   {
   82     event_log_info (hashcat_ctx, "%s (%s) starting in backend information mode", PROGNAME, version_tag);
   83     event_log_info (hashcat_ctx, NULL);
   84   }
   85   else if (user_options->hash_mode_chgd == false)
   86   {
   87     event_log_info (hashcat_ctx, "%s (%s) starting in autodetect mode", PROGNAME, version_tag);
   88     event_log_info (hashcat_ctx, NULL);
   89   }
   90   else if (user_options->hash_info == true)
   91   {
   92     event_log_info (hashcat_ctx, "%s (%s) starting in hash-info mode", PROGNAME, version_tag);
   93     event_log_info (hashcat_ctx, NULL);
   94   }
   95   else
   96   {
   97     event_log_info (hashcat_ctx, "%s (%s) starting", PROGNAME, version_tag);
   98     event_log_info (hashcat_ctx, NULL);
   99   }
  100 
  101   if (user_options->force == true)
  102   {
  103     event_log_warning (hashcat_ctx, "You have enabled --force to bypass dangerous warnings and errors!");
  104     event_log_warning (hashcat_ctx, "This can hide serious problems and should only be done when debugging.");
  105     event_log_warning (hashcat_ctx, "Do not report hashcat issues encountered when using --force.");
  106     event_log_warning (hashcat_ctx, NULL);
  107   }
  108 }
  109 
  110 void goodbye_screen (hashcat_ctx_t *hashcat_ctx, const time_t proc_start, const time_t proc_stop)
  111 {
  112   const user_options_t *user_options = hashcat_ctx->user_options;
  113 
  114   if (user_options->quiet       == true) return;
  115   if (user_options->keyspace    == true) return;
  116   if (user_options->stdout_flag == true) return;
  117   if (user_options->show        == true) return;
  118   if (user_options->left        == true) return;
  119   if (user_options->identify    == true) return;
  120 
  121   char start_buf[32]; memset (start_buf, 0, sizeof (start_buf));
  122   char stop_buf[32];  memset (stop_buf,  0, sizeof (stop_buf));
  123 
  124   event_log_info_nn (hashcat_ctx, "Started: %s", ctime_r (&proc_start, start_buf));
  125   event_log_info_nn (hashcat_ctx, "Stopped: %s", ctime_r (&proc_stop,  stop_buf));
  126 }
  127 
  128 int setup_console ()
  129 {
  130   #if defined (_WIN)
  131   SetConsoleWindowSize (132);
  132 
  133   if (_setmode (_fileno (stdin), _O_BINARY) == -1)
  134   {
  135     __mingw_fprintf (stderr, "%s: %m", "stdin");
  136 
  137     return -1;
  138   }
  139 
  140   if (_setmode (_fileno (stdout), _O_BINARY) == -1)
  141   {
  142     __mingw_fprintf (stderr, "%s: %m", "stdin"); // stdout ?
  143 
  144     return -1;
  145   }
  146 
  147   if (_setmode (_fileno (stderr), _O_BINARY) == -1)
  148   {
  149     __mingw_fprintf (stderr, "%s: %m", "stdin"); // stderr ?
  150 
  151     return -1;
  152   }
  153   #endif
  154 
  155   return 0;
  156 }
  157 
  158 void send_prompt (hashcat_ctx_t *hashcat_ctx)
  159 {
  160   const status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
  161 
  162   if (status_ctx->devices_status == STATUS_PAUSED)
  163   {
  164     fprintf (stdout, "%s", PROMPT_PAUSED);
  165   }
  166   else
  167   {
  168     fprintf (stdout, "%s", PROMPT_ACTIVE);
  169   }
  170 
  171   fflush (stdout);
  172 }
  173 
  174 void clear_prompt (hashcat_ctx_t *hashcat_ctx)
  175 {
  176   const status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
  177 
  178   size_t prompt_sz = 0;
  179 
  180   if (status_ctx->devices_status == STATUS_PAUSED)
  181   {
  182     prompt_sz = strlen (PROMPT_PAUSED);
  183   }
  184   else
  185   {
  186     prompt_sz = strlen (PROMPT_ACTIVE);
  187   }
  188 
  189   fputc ('\r', stdout);
  190 
  191   for (size_t i = 0; i < prompt_sz; i++)
  192   {
  193     fputc (' ', stdout);
  194   }
  195 
  196   fputc ('\r', stdout);
  197 
  198   fflush (stdout);
  199 }
  200 
  201 static void keypress (hashcat_ctx_t *hashcat_ctx)
  202 {
  203   status_ctx_t   *status_ctx   = hashcat_ctx->status_ctx;
  204   user_options_t *user_options = hashcat_ctx->user_options;
  205 
  206   // this is required, because some of the variables down there are not initialized at that point
  207   while (status_ctx->devices_status == STATUS_INIT) usleep (100000);
  208 
  209   const bool quiet = user_options->quiet;
  210 
  211   tty_break ();
  212 
  213   while (status_ctx->shutdown_outer == false)
  214   {
  215     int ch = tty_getchar ();
  216 
  217     if (ch == -1) break;
  218 
  219     if (ch ==  0) continue;
  220 
  221     //https://github.com/hashcat/hashcat/issues/302
  222     //#if defined (_POSIX)
  223     //if (ch != '\n')
  224     //#endif
  225 
  226     hc_thread_mutex_lock (status_ctx->mux_display);
  227 
  228     event_log_info (hashcat_ctx, NULL);
  229 
  230     switch (ch)
  231     {
  232       case 's':
  233       case '\r':
  234       case '\n':
  235 
  236         event_log_info (hashcat_ctx, NULL);
  237 
  238         status_display (hashcat_ctx);
  239 
  240         event_log_info (hashcat_ctx, NULL);
  241 
  242         if (quiet == false) send_prompt (hashcat_ctx);
  243 
  244         break;
  245 
  246       case 'b':
  247 
  248         event_log_info (hashcat_ctx, NULL);
  249 
  250         bypass (hashcat_ctx);
  251 
  252         event_log_info (hashcat_ctx, "Next dictionary / mask in queue selected. Bypassing current one.");
  253 
  254         event_log_info (hashcat_ctx, NULL);
  255 
  256         if (quiet == false) send_prompt (hashcat_ctx);
  257 
  258         break;
  259 
  260       case 'p':
  261 
  262         if (status_ctx->devices_status != STATUS_PAUSED)
  263         {
  264           event_log_info (hashcat_ctx, NULL);
  265 
  266           time_t now;
  267 
  268           time (&now);
  269 
  270           SuspendThreads (hashcat_ctx);
  271 
  272           if (status_ctx->devices_status == STATUS_PAUSED)
  273           {
  274             char buf[32] = { 0 };
  275 
  276             char *pause_time = ctime_r (&now, buf);
  277 
  278             const size_t pause_time_len = strlen (pause_time);
  279 
  280             if (pause_time[pause_time_len - 1] == '\n') pause_time[pause_time_len - 1] = 0;
  281             if (pause_time[pause_time_len - 2] == '\r') pause_time[pause_time_len - 2] = 0;
  282 
  283             event_log_info (hashcat_ctx, "Paused at %s", pause_time);
  284           }
  285 
  286           event_log_info (hashcat_ctx, NULL);
  287         }
  288 
  289         if (quiet == false) send_prompt (hashcat_ctx);
  290 
  291         break;
  292 
  293       case 'r':
  294 
  295         if (status_ctx->devices_status == STATUS_PAUSED)
  296         {
  297           event_log_info (hashcat_ctx, NULL);
  298 
  299           time_t now;
  300 
  301           time (&now);
  302 
  303           const double msec_paused = hc_timer_get (status_ctx->timer_paused);
  304 
  305           ResumeThreads (hashcat_ctx);
  306 
  307           if (status_ctx->devices_status != STATUS_PAUSED)
  308           {
  309             char buf[32] = { 0 };
  310 
  311             char *resume_time = ctime_r (&now, buf);
  312 
  313             const size_t resume_time_len = strlen (resume_time);
  314 
  315             if (resume_time[resume_time_len - 1] == '\n') resume_time[resume_time_len - 1] = 0;
  316             if (resume_time[resume_time_len - 2] == '\r') resume_time[resume_time_len - 2] = 0;
  317 
  318             struct tm *tmp;
  319             struct tm  tm;
  320 
  321             time_t sec_run = msec_paused / 1000;
  322 
  323             tmp = gmtime_r (&sec_run, &tm);
  324 
  325             char *display_pause = (char *) hcmalloc (HCBUFSIZ_TINY);
  326 
  327             format_timer_display (tmp, display_pause, HCBUFSIZ_TINY);
  328 
  329             event_log_info (hashcat_ctx, "Resumed at %s (paused for %s)", resume_time, display_pause);
  330 
  331             hcfree (display_pause);
  332           }
  333 
  334           event_log_info (hashcat_ctx, NULL);
  335         }
  336 
  337         if (quiet == false) send_prompt (hashcat_ctx);
  338 
  339         break;
  340 
  341       case 'c':
  342 
  343         event_log_info (hashcat_ctx, NULL);
  344 
  345         stop_at_checkpoint (hashcat_ctx);
  346 
  347         if (status_ctx->checkpoint_shutdown == true)
  348         {
  349           event_log_info (hashcat_ctx, "Checkpoint enabled. Will quit at next restore-point update.");
  350         }
  351         else
  352         {
  353           event_log_info (hashcat_ctx, "Checkpoint disabled. Restore-point updates will no longer be monitored.");
  354         }
  355 
  356         event_log_info (hashcat_ctx, NULL);
  357 
  358         if (quiet == false) send_prompt (hashcat_ctx);
  359 
  360         break;
  361 
  362       case 'f':
  363 
  364         event_log_info (hashcat_ctx, NULL);
  365 
  366         finish_after_attack (hashcat_ctx);
  367 
  368         if (status_ctx->finish_shutdown == true)
  369         {
  370           event_log_info (hashcat_ctx, "Finish enabled. Will quit after this attack.");
  371         }
  372         else
  373         {
  374           event_log_info (hashcat_ctx, "Finish disabled. Will continue after this attack.");
  375         }
  376 
  377         event_log_info (hashcat_ctx, NULL);
  378 
  379         if (quiet == false) send_prompt (hashcat_ctx);
  380 
  381         break;
  382 
  383       case 'q':
  384 
  385         event_log_info (hashcat_ctx, NULL);
  386 
  387         myquit (hashcat_ctx);
  388 
  389         break;
  390 
  391       default:
  392 
  393         if (quiet == false) send_prompt (hashcat_ctx);
  394 
  395         break;
  396     }
  397 
  398     //https://github.com/hashcat/hashcat/issues/302
  399     //#if defined (_POSIX)
  400     //if (ch != '\n')
  401     //#endif
  402 
  403     hc_thread_mutex_unlock (status_ctx->mux_display);
  404   }
  405 
  406   tty_fix ();
  407 }
  408 
  409 HC_API_CALL void *thread_keypress (void *p)
  410 {
  411   hashcat_ctx_t *hashcat_ctx = (hashcat_ctx_t *) p;
  412 
  413   keypress (hashcat_ctx);
  414 
  415   return NULL;
  416 }
  417 
  418 #if defined (_WIN)
  419 void SetConsoleWindowSize (const int x)
  420 {
  421   HANDLE h = GetStdHandle (STD_OUTPUT_HANDLE);
  422 
  423   if (h == INVALID_HANDLE_VALUE) return;
  424 
  425   CONSOLE_SCREEN_BUFFER_INFO bufferInfo;
  426 
  427   if (!GetConsoleScreenBufferInfo (h, &bufferInfo)) return;
  428 
  429   SMALL_RECT *sr = &bufferInfo.srWindow;
  430 
  431   sr->Right = MAX (sr->Right, x - 1);
  432 
  433   COORD co;
  434 
  435   co.X = sr->Right + 1;
  436   co.Y = 9999;
  437 
  438   if (!SetConsoleScreenBufferSize (h, co)) return;
  439 
  440   if (!SetConsoleWindowInfo (h, TRUE, sr)) return;
  441 }
  442 #endif
  443 
  444 #if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__linux__) || defined (__CYGWIN__)
  445 static struct termios savemodes;
  446 static int havemodes = 0;
  447 
  448 int tty_break ()
  449 {
  450   struct termios modmodes;
  451 
  452   if (tcgetattr (fileno (stdin), &savemodes) < 0) return -1;
  453 
  454   havemodes = 1;
  455 
  456   modmodes = savemodes;
  457   modmodes.c_lflag &= ~ICANON;
  458   modmodes.c_cc[VMIN] = 1;
  459   modmodes.c_cc[VTIME] = 0;
  460 
  461   return tcsetattr (fileno (stdin), TCSANOW, &modmodes);
  462 }
  463 
  464 int tty_getchar ()
  465 {
  466   fd_set rfds;
  467 
  468   FD_ZERO (&rfds);
  469 
  470   FD_SET (fileno (stdin), &rfds);
  471 
  472   struct timeval tv;
  473 
  474   tv.tv_sec  = 1;
  475   tv.tv_usec = 0;
  476 
  477   int retval = select (1, &rfds, NULL, NULL, &tv);
  478 
  479   if (retval ==  0) return  0;
  480   if (retval == -1) return -1;
  481 
  482   return getchar ();
  483 }
  484 
  485 int tty_fix ()
  486 {
  487   if (!havemodes) return 0;
  488 
  489   return tcsetattr (fileno (stdin), TCSADRAIN, &savemodes);
  490 }
  491 #endif
  492 
  493 #if defined (__APPLE__) || defined (__FreeBSD__)
  494 static struct termios savemodes;
  495 static int havemodes = 0;
  496 
  497 int tty_break ()
  498 {
  499   struct termios modmodes;
  500 
  501   if (ioctl (fileno (stdin), TIOCGETA, &savemodes) < 0) return -1;
  502 
  503   havemodes = 1;
  504 
  505   modmodes = savemodes;
  506   modmodes.c_lflag &= ~ICANON;
  507   modmodes.c_cc[VMIN] = 1;
  508   modmodes.c_cc[VTIME] = 0;
  509 
  510   return ioctl (fileno (stdin), TIOCSETAW, &modmodes);
  511 }
  512 
  513 int tty_getchar ()
  514 {
  515   fd_set rfds;
  516 
  517   FD_ZERO (&rfds);
  518 
  519   FD_SET (fileno (stdin), &rfds);
  520 
  521   struct timeval tv;
  522 
  523   tv.tv_sec  = 1;
  524   tv.tv_usec = 0;
  525 
  526   int retval = select (1, &rfds, NULL, NULL, &tv);
  527 
  528   if (retval ==  0) return  0;
  529   if (retval == -1) return -1;
  530 
  531   return getchar ();
  532 }
  533 
  534 int tty_fix ()
  535 {
  536   if (!havemodes) return 0;
  537 
  538   return ioctl (fileno (stdin), TIOCSETAW, &savemodes);
  539 }
  540 #endif
  541 
  542 #if defined (_WIN)
  543 static DWORD saveMode = 0;
  544 
  545 int tty_break ()
  546 {
  547   HANDLE stdinHandle = GetStdHandle (STD_INPUT_HANDLE);
  548 
  549   GetConsoleMode (stdinHandle, &saveMode);
  550   SetConsoleMode (stdinHandle, ENABLE_PROCESSED_INPUT);
  551 
  552   return 0;
  553 }
  554 
  555 int tty_getchar ()
  556 {
  557   HANDLE stdinHandle = GetStdHandle (STD_INPUT_HANDLE);
  558 
  559   DWORD rc = WaitForSingleObject (stdinHandle, 1000);
  560 
  561   if (rc == WAIT_TIMEOUT)   return  0;
  562   if (rc == WAIT_ABANDONED) return -1;
  563   if (rc == WAIT_FAILED)    return -1;
  564 
  565   // The whole ReadConsoleInput () part is a workaround.
  566   // For some unknown reason, maybe a mingw bug, a random signal
  567   // is sent to stdin which unblocks WaitForSingleObject () and sets rc 0.
  568   // Then it wants to read with getche () a keyboard input
  569   // which has never been made.
  570 
  571   INPUT_RECORD buf[100];
  572 
  573   DWORD num = 0;
  574 
  575   memset (buf, 0, sizeof (buf));
  576 
  577   ReadConsoleInput (stdinHandle, buf, 100, &num);
  578 
  579   FlushConsoleInputBuffer (stdinHandle);
  580 
  581   for (DWORD i = 0; i < num; i++)
  582   {
  583     if (buf[i].EventType != KEY_EVENT) continue;
  584 
  585     KEY_EVENT_RECORD KeyEvent = buf[i].Event.KeyEvent;
  586 
  587     if (KeyEvent.bKeyDown != TRUE) continue;
  588 
  589     return KeyEvent.uChar.AsciiChar;
  590   }
  591 
  592   return 0;
  593 }
  594 
  595 int tty_fix ()
  596 {
  597   HANDLE stdinHandle = GetStdHandle (STD_INPUT_HANDLE);
  598 
  599   SetConsoleMode (stdinHandle, saveMode);
  600 
  601   return 0;
  602 }
  603 #endif
  604 
  605 bool is_stdout_terminal (void)
  606 {
  607 #if defined(_WIN)
  608   return _isatty(_fileno (stdout));
  609 #else
  610   return isatty (fileno (stdout));
  611 #endif
  612 }
  613 
  614 void compress_terminal_line_length (char *out_buf, const size_t keep_from_beginning, const size_t keep_from_end)
  615 {
  616   const size_t target_len = TERMINAL_LINE_LENGTH - keep_from_beginning;
  617 
  618   const size_t out_len = strlen (out_buf);
  619 
  620   if (out_len < target_len) return;
  621 
  622   char *ptr1 = out_buf + target_len - 3 - keep_from_end;
  623   char *ptr2 = out_buf + out_len - keep_from_end;
  624 
  625   *ptr1++ = '.';
  626   *ptr1++ = '.';
  627   *ptr1++ = '.';
  628 
  629   for (size_t i = 0; i < keep_from_end; i++)
  630   {
  631     *ptr1++ = *ptr2++;
  632   }
  633 
  634   *ptr1 = 0;
  635 }
  636 
  637 void hash_info_single_json (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *user_options_extra)
  638 {
  639   if (hashconfig_init (hashcat_ctx) == 0)
  640   {
  641     hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
  642 
  643     printf ("\"%u\": { ", hashconfig->hash_mode);
  644     printf ("\"name\": \"%s\", ", hashconfig->hash_name);
  645     printf ("\"category\": \"%s\", ", strhashcategory (hashconfig->hash_category));
  646     printf ("\"slow_hash\": %s, ", (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) ? "false" : "true");
  647 
  648     printf ("\"password_len_min\": %u, ", hashconfig->pw_min);
  649     printf ("\"password_len_max\": %u, ", hashconfig->pw_max);
  650 
  651     printf ("\"is_salted\": %s, ", (hashconfig->is_salted == true) ? "true" : "false");
  652 
  653     if (hashconfig->is_salted == true)
  654     {
  655       u32 t = hashconfig->salt_type;
  656       const char *t_desc = (t == SALT_TYPE_EMBEDDED) ? "embedded" : (t == SALT_TYPE_GENERIC) ? "generic" : "virtual";
  657       printf ("\"salt_type\": \"%s\", ", t_desc);
  658       printf ("\"salt_len_min\": %u, ", hashconfig->salt_min);
  659       printf ("\"salt_len_max\": %u, ", hashconfig->salt_max);
  660     }
  661 
  662     if ((hashconfig->has_pure_kernel) && (hashconfig->has_optimized_kernel))
  663     {
  664       printf ("\"kernel_type\": %s, ", "[ \"pure\", \"optimized\" ]");
  665     }
  666     else if (hashconfig->has_pure_kernel)
  667     {
  668       printf ("\"kernel_type\": %s, ", "[ \"pure\" ]");
  669     }
  670     else if (hashconfig->has_optimized_kernel)
  671     {
  672       printf ("\"kernel_type\": %s, ", "[ \"optimized\" ]");
  673     }
  674 
  675     if ((hashconfig->st_hash != NULL) && (hashconfig->st_pass != NULL))
  676     {
  677       if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE)
  678       {
  679         if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE_OPTIONAL)
  680         {
  681           printf ("\"example_hash_format\": \"%s\", ", "hex-encoded");
  682         }
  683         else
  684         {
  685           printf ("\"example_hash_format\": \"%s\", ", "hex-encoded (binary file only)");
  686         }
  687         printf ("\"example_hash\": \"%s\", ", hashconfig->st_hash);
  688       }
  689       else
  690       {
  691         printf ("\"example_hash_format\": \"%s\", ", "plain");
  692         printf ("\"example_hash\": \"%s\", ", hashconfig->st_hash);
  693       }
  694 
  695       if (need_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), user_options_extra->separator, false))
  696       {
  697         char *tmp_buf = (char *) hcmalloc (HCBUFSIZ_LARGE);
  698 
  699         int tmp_len = 0;
  700 
  701         tmp_buf[tmp_len++] = '$';
  702         tmp_buf[tmp_len++] = 'H';
  703         tmp_buf[tmp_len++] = 'E';
  704         tmp_buf[tmp_len++] = 'X';
  705         tmp_buf[tmp_len++] = '[';
  706 
  707         exec_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), (u8 *) tmp_buf + tmp_len);
  708 
  709         tmp_len += strlen (hashconfig->st_pass) * 2;
  710 
  711         tmp_buf[tmp_len++] = ']';
  712         tmp_buf[tmp_len++] = 0;
  713 
  714         printf ("\"example_pass\": \"%s\", ", tmp_buf);
  715 
  716         hcfree (tmp_buf);
  717       }
  718       else if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
  719       {
  720         size_t st_pass_len = strlen (hashconfig->st_pass);
  721 
  722         char *tmp_buf = (char *) hcmalloc (st_pass_len + 1);
  723 
  724         strncpy (tmp_buf, hashconfig->st_pass, st_pass_len);
  725 
  726         uppercase ((u8 *) tmp_buf, st_pass_len);
  727 
  728         printf ("\"example_pass\": \"%s\", ", tmp_buf);
  729 
  730         hcfree (tmp_buf);
  731       }
  732       else
  733       {
  734         printf ("\"example_pass\": \"%s\", ", hashconfig->st_pass);
  735       }
  736     }
  737     else
  738     {
  739       printf ("\"example_hash_format\": \"%s\", ", "N/A");
  740       printf ("\"example_hash\": \"%s\", ", "N/A");
  741       printf ("\"example_pass\": \"%s\", ", "N/A");
  742     }
  743 
  744     if (hashconfig->benchmark_mask != NULL)
  745     {
  746       printf ("\"benchmark_mask\": \"%s\", ", hashconfig->benchmark_mask);
  747     }
  748     else
  749     {
  750       printf ("\"benchmark_mask\": \"%s\", ", "N/A");
  751     }
  752 
  753     if (hashconfig->benchmark_charset != NULL)
  754     {
  755       printf ("\"benchmark_charset1\": \"%s\", ", hashconfig->benchmark_charset);
  756     }
  757     else
  758     {
  759       printf ("\"benchmark_charset1\": \"%s\", ", "N/A");
  760     }
  761 
  762     printf ("\"autodetect_enabled\": %s, ", (hashconfig->opts_type & OPTS_TYPE_AUTODETECT_DISABLE) ? "false" : "true");
  763     printf ("\"self_test_enabled\": %s, ", (hashconfig->opts_type & OPTS_TYPE_SELF_TEST_DISABLE) ? "false" : "true");
  764     printf ("\"potfile_enabled\": %s, ", (hashconfig->opts_type & OPTS_TYPE_POTFILE_NOPASS) ? "false" : "true");
  765     printf ("\"custom_plugin\": %s, ", (hashconfig->opts_type & OPTS_TYPE_STOCK_MODULE) ? "false" : "true");
  766 
  767     if (hashconfig->opts_type & OPTS_TYPE_PT_ALWAYS_ASCII)
  768     {
  769       printf ("\"plaintext_encoding\": %s", "[ \"ASCII\" ]");
  770     }
  771     else if (hashconfig->opts_type & OPTS_TYPE_PT_ALWAYS_HEXIFY)
  772     {
  773       printf ("\"plaintext_encoding\": %s", "[ \"HEX\" ]");
  774     }
  775     else
  776     {
  777       printf ("\"plaintext_encoding\": %s", "[ \"ASCII\", \"HEX\" ]");
  778     }
  779 
  780     event_log_info (hashcat_ctx, NULL);
  781   }
  782 
  783   printf (" }");
  784 
  785   hashconfig_destroy (hashcat_ctx);
  786 }
  787 
  788 void hash_info_single (hashcat_ctx_t *hashcat_ctx, user_options_extra_t *user_options_extra)
  789 {
  790   if (hashconfig_init (hashcat_ctx) == 0)
  791   {
  792     hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
  793 
  794     event_log_info (hashcat_ctx, "Hash mode #%u", hashconfig->hash_mode);
  795     event_log_info (hashcat_ctx, "  Name................: %s", hashconfig->hash_name);
  796     event_log_info (hashcat_ctx, "  Category............: %s", strhashcategory (hashconfig->hash_category));
  797     event_log_info (hashcat_ctx, "  Slow.Hash...........: %s", (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) ? "No" : "Yes");
  798 
  799     event_log_info (hashcat_ctx, "  Password.Len.Min....: %u", hashconfig->pw_min);
  800     event_log_info (hashcat_ctx, "  Password.Len.Max....: %u", hashconfig->pw_max);
  801 
  802     if (hashconfig->is_salted == true)
  803     {
  804       u32 t = hashconfig->salt_type;
  805       const char *t_desc = (t == SALT_TYPE_EMBEDDED) ? "Embedded\0" : (t == SALT_TYPE_GENERIC) ? "Generic\0" : "Virtual\0";
  806       event_log_info (hashcat_ctx, "  Salt.Type...........: %s", t_desc);
  807       event_log_info (hashcat_ctx, "  Salt.Len.Min........: %u", hashconfig->salt_min);
  808       event_log_info (hashcat_ctx, "  Salt.Len.Max........: %u", hashconfig->salt_max);
  809     }
  810 
  811     // almost always 1 and -1
  812     //event_log_info (hashcat_ctx, "  Hashes.Count.Min....: %d", hashconfig->hashes_count_min);
  813     //event_log_info (hashcat_ctx, "  Hashes.Count.Max....: %u", hashconfig->hashes_count_max);
  814 
  815     if ((hashconfig->has_pure_kernel) && (hashconfig->has_optimized_kernel))
  816     {
  817       event_log_info (hashcat_ctx, "  Kernel.Type(s)......: pure, optimized");
  818     }
  819     else if (hashconfig->has_pure_kernel)
  820     {
  821       event_log_info (hashcat_ctx, "  Kernel.Type(s)......: pure");
  822     }
  823     else if (hashconfig->has_optimized_kernel)
  824     {
  825       event_log_info (hashcat_ctx, "  Kernel.Type(s)......: optimized");
  826     }
  827 
  828     if ((hashconfig->st_hash != NULL) && (hashconfig->st_pass != NULL))
  829     {
  830       if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE)
  831       {
  832         if (hashconfig->opts_type & OPTS_TYPE_BINARY_HASHFILE_OPTIONAL)
  833         {
  834           event_log_info (hashcat_ctx, "  Example.Hash.Format.: hex-encoded");
  835         }
  836         else
  837         {
  838           event_log_info (hashcat_ctx, "  Example.Hash.Format.: hex-encoded (binary file only)");
  839         }
  840       }
  841       else
  842       {
  843         event_log_info (hashcat_ctx, "  Example.Hash.Format.: plain");
  844       }
  845 
  846       if (strlen (hashconfig->st_hash) > MAXIMUM_EXAMPLE_HASH_LENGTH)
  847       {
  848         char *st_hash = hcstrdup (hashconfig->st_hash);
  849 
  850         compress_terminal_line_length (st_hash, 24, 5);
  851 
  852         event_log_info (hashcat_ctx, "  Example.Hash........: %s [Truncated, use --mach for full length]", st_hash);
  853 
  854         hcfree (st_hash);
  855       }
  856       else
  857       {
  858         event_log_info (hashcat_ctx, "  Example.Hash........: %s", hashconfig->st_hash);
  859       }
  860 
  861       if (need_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), user_options_extra->separator, false))
  862       {
  863         char *tmp_buf = (char *) hcmalloc (HCBUFSIZ_LARGE);
  864 
  865         int tmp_len = 0;
  866 
  867         tmp_buf[tmp_len++] = '$';
  868         tmp_buf[tmp_len++] = 'H';
  869         tmp_buf[tmp_len++] = 'E';
  870         tmp_buf[tmp_len++] = 'X';
  871         tmp_buf[tmp_len++] = '[';
  872 
  873         exec_hexify ((const u8 *) hashconfig->st_pass, strlen (hashconfig->st_pass), (u8 *) tmp_buf + tmp_len);
  874 
  875         tmp_len += strlen (hashconfig->st_pass) * 2;
  876 
  877         tmp_buf[tmp_len++] = ']';
  878         tmp_buf[tmp_len++] = 0;
  879 
  880         event_log_info (hashcat_ctx, "  Example.Pass........: %s", tmp_buf);
  881 
  882         hcfree (tmp_buf);
  883       }
  884       else if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER)
  885       {
  886         size_t st_pass_len = strlen (hashconfig->st_pass);
  887 
  888         char *tmp_buf = (char *) hcmalloc (st_pass_len + 1);
  889 
  890         strncpy (tmp_buf, hashconfig->st_pass, st_pass_len);
  891 
  892         uppercase ((u8 *) tmp_buf, st_pass_len);
  893 
  894         event_log_info (hashcat_ctx, "  Example.Pass........: %s", tmp_buf);
  895 
  896         hcfree (tmp_buf);
  897       }
  898       else
  899       {
  900         event_log_info (hashcat_ctx, "  Example.Pass........: %s", hashconfig->st_pass);
  901       }
  902     }
  903     else
  904     {
  905       event_log_info (hashcat_ctx, "  Example.Hash.Format.: N/A");
  906       event_log_info (hashcat_ctx, "  Example.Hash........: N/A");
  907       event_log_info (hashcat_ctx, "  Example.Pass........: N/A");
  908     }
  909 
  910     if (hashconfig->benchmark_mask != NULL)
  911     {
  912       event_log_info (hashcat_ctx, "  Benchmark.Mask......: %s", hashconfig->benchmark_mask);
  913     }
  914     else
  915     {
  916       event_log_info (hashcat_ctx, "  Benchmark.Mask......: N/A");
  917     }
  918 
  919     if (hashconfig->benchmark_charset != NULL)
  920     {
  921       event_log_info (hashcat_ctx, "  Benchmark.Charset1..: %s", hashconfig->benchmark_charset);
  922     }
  923     // else // almost always empty
  924     // {
  925     //   event_log_info (hashcat_ctx, "  Benchmark.Charset1..: N/A");
  926     // }
  927 
  928     event_log_info (hashcat_ctx, "  Autodetect.Enabled..: %s", (hashconfig->opts_type & OPTS_TYPE_AUTODETECT_DISABLE) ? "No" : "Yes");
  929     event_log_info (hashcat_ctx, "  Self.Test.Enabled...: %s", (hashconfig->opts_type & OPTS_TYPE_SELF_TEST_DISABLE) ? "No" : "Yes");
  930     event_log_info (hashcat_ctx, "  Potfile.Enabled.....: %s", (hashconfig->opts_type & OPTS_TYPE_POTFILE_NOPASS) ? "No" : "Yes");
  931     event_log_info (hashcat_ctx, "  Custom.Plugin.......: %s", (hashconfig->opts_type & OPTS_TYPE_STOCK_MODULE) ? "No" : "Yes");
  932 
  933     if (hashconfig->opts_type & OPTS_TYPE_PT_ALWAYS_ASCII)
  934     {
  935       event_log_info (hashcat_ctx, "  Plaintext.Encoding..: ASCII only");
  936     }
  937     else if (hashconfig->opts_type & OPTS_TYPE_PT_ALWAYS_HEXIFY)
  938     {
  939       event_log_info (hashcat_ctx, "  Plaintext.Encoding..: HEX only");
  940     }
  941     else
  942     {
  943       event_log_info (hashcat_ctx, "  Plaintext.Encoding..: ASCII, HEX");
  944     }
  945 
  946     event_log_info (hashcat_ctx, NULL);
  947   }
  948 
  949   hashconfig_destroy (hashcat_ctx);
  950 }
  951 
  952 void hash_info (hashcat_ctx_t *hashcat_ctx)
  953 {
  954   folder_config_t      *folder_config      = hashcat_ctx->folder_config;
  955   user_options_t       *user_options       = hashcat_ctx->user_options;
  956   user_options_extra_t *user_options_extra = hashcat_ctx->user_options_extra;
  957 
  958   if (user_options->machine_readable == false)
  959   {
  960     event_log_info (hashcat_ctx, "Hash Info:");
  961     event_log_info (hashcat_ctx, "==========");
  962     event_log_info (hashcat_ctx, NULL);
  963   }
  964 
  965   if (user_options->hash_mode_chgd == true)
  966   {
  967     if (user_options->machine_readable == true)
  968     {
  969       printf ("{ ");
  970       hash_info_single_json (hashcat_ctx, user_options_extra);
  971       printf (" }");
  972     }
  973     else
  974     {
  975       hash_info_single (hashcat_ctx, user_options_extra);
  976     }
  977   }
  978   else
  979   {
  980     char *modulefile = (char *) hcmalloc (HCBUFSIZ_TINY);
  981 
  982     if (user_options->machine_readable == true) printf ("{ ");
  983 
  984     for (int i = 0; i < MODULE_HASH_MODES_MAXIMUM; i++)
  985     {
  986       user_options->hash_mode = i;
  987 
  988       module_filename (folder_config, i, modulefile, HCBUFSIZ_TINY);
  989 
  990       if (hc_path_exist (modulefile) == false) continue;
  991 
  992       if (user_options->machine_readable == true)
  993       {
  994         if (i != 0)
  995         {
  996           printf (", ");
  997         }
  998 
  999         hash_info_single_json (hashcat_ctx, user_options_extra);
 1000       }
 1001       else
 1002       {
 1003         hash_info_single (hashcat_ctx, user_options_extra);
 1004       }
 1005     }
 1006 
 1007     if (user_options->machine_readable == true) printf (" }");
 1008 
 1009     hcfree (modulefile);
 1010   }
 1011 }
 1012 
 1013 void backend_info (hashcat_ctx_t *hashcat_ctx)
 1014 {
 1015   const backend_ctx_t   *backend_ctx   = hashcat_ctx->backend_ctx;
 1016   const user_options_t  *user_options  = hashcat_ctx->user_options;
 1017   const folder_config_t *folder_config = hashcat_ctx->folder_config;
 1018 
 1019   if (user_options->backend_info > 1)
 1020   {
 1021     event_log_info (hashcat_ctx, "System Info:");
 1022     event_log_info (hashcat_ctx, "============");
 1023     event_log_info (hashcat_ctx, NULL);
 1024 
 1025     #if defined (_WIN) || defined (__CYGWIN__) || defined (__MSYS__)
 1026     // TODO
 1027     event_log_info (hashcat_ctx, "OS.Name......: Windows");
 1028     event_log_info (hashcat_ctx, "OS.Release...: N/A");
 1029     event_log_info (hashcat_ctx, "HW.Platform..: N/A");
 1030     event_log_info (hashcat_ctx, "HW.Model.....: N/A");
 1031     #else
 1032 
 1033     struct utsname utsbuf;
 1034 
 1035     bool rc_uname  = false;
 1036     bool rc_sysctl = false;
 1037 
 1038     char *hw_model_buf = NULL;
 1039 
 1040     #if !defined (__linux__)
 1041 
 1042     size_t hw_model_len = 0;
 1043 
 1044     if (sysctlbyname ("hw.model", NULL, &hw_model_len, NULL, 0) == 0 && hw_model_len > 0)
 1045     {
 1046       hw_model_buf = (char *) hcmalloc (hw_model_len);
 1047 
 1048       if (sysctlbyname ("hw.model", hw_model_buf, &hw_model_len, NULL, 0) != 0)
 1049       {
 1050         hw_model_buf = NULL;
 1051         hw_model_len = 0;
 1052 
 1053         hcfree (hw_model_buf);
 1054       }
 1055       else
 1056       {
 1057         rc_sysctl = true;
 1058       }
 1059     }
 1060     #endif // ! __linux__
 1061 
 1062     if (uname (&utsbuf) == 0)
 1063     {
 1064       rc_uname = true;
 1065     }
 1066 
 1067     event_log_info (hashcat_ctx, "OS.Name......: %s", (rc_uname  == true) ? utsbuf.sysname : "N/A");
 1068     event_log_info (hashcat_ctx, "OS.Release...: %s", (rc_uname  == true) ? utsbuf.release : "N/A");
 1069     event_log_info (hashcat_ctx, "HW.Model.....: %s", (rc_sysctl == true) ? hw_model_buf   : "N/A");
 1070     event_log_info (hashcat_ctx, "HW.Platform..: %s", (rc_uname  == true) ? utsbuf.machine : "N/A");
 1071 
 1072     if (rc_sysctl == true)
 1073     {
 1074       hcfree (hw_model_buf);
 1075     }
 1076     #endif // _WIN || __CYGWIN__ || __MSYS__
 1077 
 1078     event_log_info (hashcat_ctx, NULL);
 1079 
 1080     event_log_info (hashcat_ctx, "Environment Info:");
 1081     event_log_info (hashcat_ctx, "=================");
 1082     event_log_info (hashcat_ctx, NULL);
 1083 
 1084     event_log_info (hashcat_ctx, "Cur.Work.Dir.: %s", folder_config->cwd);
 1085     event_log_info (hashcat_ctx, "Install.Dir..: %s", folder_config->install_dir);
 1086     event_log_info (hashcat_ctx, "Profile.Dir..: %s", folder_config->profile_dir);
 1087     event_log_info (hashcat_ctx, "Cache.Dir....: %s", folder_config->cache_dir);
 1088     // uninitialized at this point, for instance if the user uses --session
 1089     //event_log_info (hashcat_ctx, "Session.Dir..: %s", folder_config->session_dir);
 1090     event_log_info (hashcat_ctx, "Shared.Dir...: %s", folder_config->shared_dir);
 1091     event_log_info (hashcat_ctx, "CL.Inc.Path..: %s", folder_config->cpath_real);
 1092 
 1093     event_log_info (hashcat_ctx, NULL);
 1094   }
 1095 
 1096   if (backend_ctx->cuda)
 1097   {
 1098     event_log_info (hashcat_ctx, "CUDA Info:");
 1099     event_log_info (hashcat_ctx, "==========");
 1100     event_log_info (hashcat_ctx, NULL);
 1101 
 1102     int cuda_devices_cnt    = backend_ctx->cuda_devices_cnt;
 1103     int cuda_driver_version = backend_ctx->cuda_driver_version;
 1104 
 1105     event_log_info (hashcat_ctx, "CUDA.Version.: %u.%u", cuda_driver_version / 1000, (cuda_driver_version % 100) / 10);
 1106     event_log_info (hashcat_ctx, NULL);
 1107 
 1108     for (int cuda_devices_idx = 0; cuda_devices_idx < cuda_devices_cnt; cuda_devices_idx++)
 1109     {
 1110       const int backend_devices_idx = backend_ctx->backend_device_from_cuda[cuda_devices_idx];
 1111 
 1112       const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
 1113 
 1114       int   device_id                 = device_param->device_id;
 1115       char *device_name               = device_param->device_name;
 1116       u32   device_processors         = device_param->device_processors;
 1117       u32   device_maxclock_frequency = device_param->device_maxclock_frequency;
 1118       u64   device_local_mem_size     = device_param->device_local_mem_size;
 1119       u64   device_available_mem      = device_param->device_available_mem;
 1120       u64   device_global_mem         = device_param->device_global_mem;
 1121       u8    pcie_domain               = device_param->pcie_domain;
 1122       u8    pcie_bus                  = device_param->pcie_bus;
 1123       u8    pcie_device               = device_param->pcie_device;
 1124       u8    pcie_function             = device_param->pcie_function;
 1125 
 1126       if (device_param->device_id_alias_cnt)
 1127       {
 1128         event_log_info (hashcat_ctx, "Backend Device ID #%u (Alias: #%u)", device_id + 1, device_param->device_id_alias_buf[0] + 1);
 1129       }
 1130       else
 1131       {
 1132         event_log_info (hashcat_ctx, "Backend Device ID #%u", device_id + 1);
 1133       }
 1134 
 1135       event_log_info (hashcat_ctx, "  Name...........: %s", device_name);
 1136       event_log_info (hashcat_ctx, "  Processor(s)...: %u", device_processors);
 1137       event_log_info (hashcat_ctx, "  Clock..........: %u", device_maxclock_frequency);
 1138       event_log_info (hashcat_ctx, "  Memory.Total...: %" PRIu64 " MB", device_global_mem / 1024 / 1024);
 1139       event_log_info (hashcat_ctx, "  Memory.Free....: %" PRIu64 " MB", device_available_mem / 1024 / 1024);
 1140       event_log_info (hashcat_ctx, "  Local.Memory...: %" PRIu64 " KB", device_local_mem_size / 1024);
 1141       event_log_info (hashcat_ctx, "  PCI.Addr.BDFe..: %04x:%02x:%02x.%u", (u16) pcie_domain, pcie_bus, pcie_device, pcie_function);
 1142       event_log_info (hashcat_ctx, NULL);
 1143     }
 1144   }
 1145 
 1146   if (backend_ctx->hip)
 1147   {
 1148     event_log_info (hashcat_ctx, "HIP Info:");
 1149     event_log_info (hashcat_ctx, "=========");
 1150     event_log_info (hashcat_ctx, NULL);
 1151 
 1152     int hip_devices_cnt    = backend_ctx->hip_devices_cnt;
 1153     int hip_runtimeVersion = backend_ctx->hip_runtimeVersion;
 1154 
 1155     if (hip_runtimeVersion > 1000)
 1156     {
 1157       int hip_version_major = (hip_runtimeVersion - 0) / 10000000;
 1158       int hip_version_minor = (hip_runtimeVersion - (hip_version_major * 10000000)) / 100000;
 1159       int hip_version_patch = (hip_runtimeVersion - (hip_version_major * 10000000) - (hip_version_minor * 100000));
 1160 
 1161       event_log_info (hashcat_ctx, "HIP.Version.: %u.%u.%u", hip_version_major, hip_version_minor, hip_version_patch);
 1162       event_log_info (hashcat_ctx, NULL);
 1163     }
 1164     else
 1165     {
 1166       event_log_info (hashcat_ctx, "HIP.Version.: %u.%u", hip_runtimeVersion / 100, hip_runtimeVersion % 10);
 1167       event_log_info (hashcat_ctx, NULL);
 1168     }
 1169 
 1170     for (int hip_devices_idx = 0; hip_devices_idx < hip_devices_cnt; hip_devices_idx++)
 1171     {
 1172       const int backend_devices_idx = backend_ctx->backend_device_from_hip[hip_devices_idx];
 1173 
 1174       const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
 1175 
 1176       int   device_id                 = device_param->device_id;
 1177       char *device_name               = device_param->device_name;
 1178       u32   device_processors         = device_param->device_processors;
 1179       u32   device_maxclock_frequency = device_param->device_maxclock_frequency;
 1180       u64   device_local_mem_size     = device_param->device_local_mem_size;
 1181       u64   device_available_mem      = device_param->device_available_mem;
 1182       u64   device_global_mem         = device_param->device_global_mem;
 1183       u8    pcie_domain               = device_param->pcie_domain;
 1184       u8    pcie_bus                  = device_param->pcie_bus;
 1185       u8    pcie_device               = device_param->pcie_device;
 1186       u8    pcie_function             = device_param->pcie_function;
 1187 
 1188       if (device_param->device_id_alias_cnt)
 1189       {
 1190         event_log_info (hashcat_ctx, "Backend Device ID #%u (Alias: #%u)", device_id + 1, device_param->device_id_alias_buf[0] + 1);
 1191       }
 1192       else
 1193       {
 1194         event_log_info (hashcat_ctx, "Backend Device ID #%u", device_id + 1);
 1195       }
 1196 
 1197       event_log_info (hashcat_ctx, "  Name...........: %s", device_name);
 1198       event_log_info (hashcat_ctx, "  Processor(s)...: %u", device_processors);
 1199       event_log_info (hashcat_ctx, "  Clock..........: %u", device_maxclock_frequency);
 1200       event_log_info (hashcat_ctx, "  Memory.Total...: %" PRIu64 " MB", device_global_mem / 1024 / 1024);
 1201       event_log_info (hashcat_ctx, "  Memory.Free....: %" PRIu64 " MB", device_available_mem / 1024 / 1024);
 1202       event_log_info (hashcat_ctx, "  Local.Memory...: %" PRIu64 " KB", device_local_mem_size / 1024);
 1203       event_log_info (hashcat_ctx, "  PCI.Addr.BDFe..: %04x:%02x:%02x.%u", (u16) pcie_domain, pcie_bus, pcie_device, pcie_function);
 1204       event_log_info (hashcat_ctx, NULL);
 1205     }
 1206   }
 1207 
 1208   #if defined (__APPLE__)
 1209   if (backend_ctx->mtl)
 1210   {
 1211     event_log_info (hashcat_ctx, "Metal Info:");
 1212     event_log_info (hashcat_ctx, "===========");
 1213     event_log_info (hashcat_ctx, NULL);
 1214 
 1215     int metal_devices_cnt = backend_ctx->metal_devices_cnt;
 1216     int metal_runtimeVersion = backend_ctx->metal_runtimeVersion;
 1217     char *metal_runtimeVersionStr = backend_ctx->metal_runtimeVersionStr;
 1218 
 1219     if (metal_runtimeVersionStr != NULL)
 1220     {
 1221       event_log_info (hashcat_ctx, "Metal.Version.: %s", metal_runtimeVersionStr);
 1222     }
 1223     else
 1224     {
 1225       event_log_info (hashcat_ctx, "Metal.Version.: %u", metal_runtimeVersion);
 1226     }
 1227 
 1228     event_log_info (hashcat_ctx, NULL);
 1229 
 1230     for (int metal_devices_idx = 0; metal_devices_idx < metal_devices_cnt; metal_devices_idx++)
 1231     {
 1232       const int backend_devices_idx = backend_ctx->backend_device_from_metal[metal_devices_idx];
 1233 
 1234       const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
 1235 
 1236       int   device_id                 = device_param->device_id;
 1237       int   device_mtl_maj            = device_param->mtl_major;
 1238       int   device_mtl_min            = device_param->mtl_minor;
 1239       int   device_max_transfer_rate  = device_param->device_max_transfer_rate;
 1240       int   device_physical_location  = device_param->device_physical_location;
 1241       int   device_location_number    = device_param->device_location_number;
 1242       int   device_registryID         = device_param->device_registryID;
 1243       int   device_is_headless        = device_param->device_is_headless;
 1244       int   device_is_low_power       = device_param->device_is_low_power;
 1245       int   device_is_removable       = device_param->device_is_removable;
 1246 
 1247       char *device_name               = device_param->device_name;
 1248 
 1249       u32   device_processors         = device_param->device_processors;
 1250 
 1251       u64   device_global_mem         = device_param->device_global_mem;
 1252       u64   device_maxmem_alloc       = device_param->device_maxmem_alloc;
 1253       u64   device_available_mem      = device_param->device_available_mem;
 1254       u64   device_local_mem_size     = device_param->device_local_mem_size;
 1255 
 1256       cl_device_type opencl_device_type         = device_param->opencl_device_type;
 1257       cl_uint        opencl_device_vendor_id    = device_param->opencl_device_vendor_id;
 1258       char          *opencl_device_vendor       = device_param->opencl_device_vendor;
 1259 
 1260       if (device_param->device_id_alias_cnt)
 1261       {
 1262         event_log_info (hashcat_ctx, "Backend Device ID #%u (Alias: #%u)", device_id + 1, device_param->device_id_alias_buf[0] + 1);
 1263       }
 1264       else
 1265       {
 1266         event_log_info (hashcat_ctx, "Backend Device ID #%u", device_id + 1);
 1267       }
 1268 
 1269       event_log_info (hashcat_ctx, "  Type...........: %s", ((opencl_device_type & CL_DEVICE_TYPE_CPU) ? "CPU" : ((opencl_device_type & CL_DEVICE_TYPE_GPU) ? "GPU" : "Accelerator")));
 1270       event_log_info (hashcat_ctx, "  Vendor.ID......: %u", opencl_device_vendor_id);
 1271       event_log_info (hashcat_ctx, "  Vendor.........: %s", opencl_device_vendor);
 1272       event_log_info (hashcat_ctx, "  Name...........: %s", device_name);
 1273       event_log_info (hashcat_ctx, "  Processor(s)...: %u", device_processors);
 1274       event_log_info (hashcat_ctx, "  Clock..........: N/A");
 1275       event_log_info (hashcat_ctx, "  Memory.Total...: %" PRIu64 " MB (limited to %" PRIu64 " MB allocatable in one block)", device_global_mem / 1024 / 1024, device_maxmem_alloc / 1024 / 1024);
 1276       event_log_info (hashcat_ctx, "  Memory.Free....: %" PRIu64 " MB", device_available_mem / 1024 / 1024);
 1277       event_log_info (hashcat_ctx, "  Local.Memory...: %" PRIu64 " KB", device_local_mem_size / 1024);
 1278 
 1279       switch (device_physical_location)
 1280       {
 1281         case MTL_DEVICE_LOCATION_BUILTIN:     event_log_info (hashcat_ctx, "  Phys.Location..: built-in"); break;
 1282         case MTL_DEVICE_LOCATION_SLOT:        event_log_info (hashcat_ctx, "  Phys.Location..: connected to slot %u", device_location_number); break;
 1283         case MTL_DEVICE_LOCATION_EXTERNAL:    event_log_info (hashcat_ctx, "  Phys.Location..: connected via an external interface (port %u)", device_location_number); break;
 1284         case MTL_DEVICE_LOCATION_UNSPECIFIED: event_log_info (hashcat_ctx, "  Phys.Location..: unspecified"); break;
 1285         default:                              event_log_info (hashcat_ctx, "  Phys.Location..: N/A"); break;
 1286       }
 1287 
 1288       if (device_mtl_maj > 0 && device_mtl_min > 0)
 1289       {
 1290         event_log_info (hashcat_ctx, "  Feature.Set....: macOS GPU Family %u v%u", device_mtl_maj, device_mtl_min);
 1291       }
 1292       else
 1293       {
 1294         event_log_info (hashcat_ctx, "  Feature.Set....: N/A");
 1295       }
 1296 
 1297       event_log_info (hashcat_ctx, "  Registry.ID....: %u", device_registryID);
 1298 
 1299       if (device_physical_location != MTL_DEVICE_LOCATION_BUILTIN)
 1300       {
 1301         event_log_info (hashcat_ctx, "  Max.TX.Rate....: %u MB/sec", device_max_transfer_rate);
 1302       }
 1303       else
 1304       {
 1305         event_log_info (hashcat_ctx, "  Max.TX.Rate....: N/A");
 1306       }
 1307 
 1308       event_log_info (hashcat_ctx, "  GPU.Properties.: headless %u, low-power %u, removable %u", device_is_headless, device_is_low_power, device_is_removable);
 1309       event_log_info (hashcat_ctx, NULL);
 1310     }
 1311   }
 1312   #endif
 1313 
 1314   if (backend_ctx->ocl)
 1315   {
 1316     event_log_info (hashcat_ctx, "OpenCL Info:");
 1317     event_log_info (hashcat_ctx, "============");
 1318     event_log_info (hashcat_ctx, NULL);
 1319 
 1320     cl_uint   opencl_platforms_cnt         = backend_ctx->opencl_platforms_cnt;
 1321     cl_uint  *opencl_platforms_devices_cnt = backend_ctx->opencl_platforms_devices_cnt;
 1322     char    **opencl_platforms_name        = backend_ctx->opencl_platforms_name;
 1323     char    **opencl_platforms_vendor      = backend_ctx->opencl_platforms_vendor;
 1324     char    **opencl_platforms_version     = backend_ctx->opencl_platforms_version;
 1325 
 1326     for (cl_uint opencl_platforms_idx = 0; opencl_platforms_idx < opencl_platforms_cnt; opencl_platforms_idx++)
 1327     {
 1328       char     *opencl_platform_vendor       = opencl_platforms_vendor[opencl_platforms_idx];
 1329       char     *opencl_platform_name         = opencl_platforms_name[opencl_platforms_idx];
 1330       char     *opencl_platform_version      = opencl_platforms_version[opencl_platforms_idx];
 1331       cl_uint   opencl_platform_devices_cnt  = opencl_platforms_devices_cnt[opencl_platforms_idx];
 1332 
 1333       event_log_info (hashcat_ctx, "OpenCL Platform ID #%u", opencl_platforms_idx + 1);
 1334       event_log_info (hashcat_ctx, "  Vendor..: %s",  opencl_platform_vendor);
 1335       event_log_info (hashcat_ctx, "  Name....: %s",  opencl_platform_name);
 1336       event_log_info (hashcat_ctx, "  Version.: %s",  opencl_platform_version);
 1337       event_log_info (hashcat_ctx, NULL);
 1338 
 1339       for (cl_uint opencl_platform_devices_idx = 0; opencl_platform_devices_idx < opencl_platform_devices_cnt; opencl_platform_devices_idx++)
 1340       {
 1341         const int backend_devices_idx = backend_ctx->backend_device_from_opencl_platform[opencl_platforms_idx][opencl_platform_devices_idx];
 1342 
 1343         const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
 1344 
 1345         int            device_id                  = device_param->device_id;
 1346         char          *device_name                = device_param->device_name;
 1347         u32            device_processors          = device_param->device_processors;
 1348         u32            device_maxclock_frequency  = device_param->device_maxclock_frequency;
 1349         u64            device_maxmem_alloc        = device_param->device_maxmem_alloc;
 1350         u64            device_local_mem_size      = device_param->device_local_mem_size;
 1351         u64            device_available_mem       = device_param->device_available_mem;
 1352         u64            device_global_mem          = device_param->device_global_mem;
 1353         cl_device_type opencl_device_type         = device_param->opencl_device_type;
 1354         cl_uint        opencl_device_vendor_id    = device_param->opencl_device_vendor_id;
 1355         char          *opencl_device_vendor       = device_param->opencl_device_vendor;
 1356         char          *opencl_device_c_version    = device_param->opencl_device_c_version;
 1357         char          *opencl_device_version      = device_param->opencl_device_version;
 1358         char          *opencl_driver_version      = device_param->opencl_driver_version;
 1359 
 1360         if (device_param->device_id_alias_cnt)
 1361         {
 1362           event_log_info (hashcat_ctx, "  Backend Device ID #%u (Alias: #%u)", device_id + 1, device_param->device_id_alias_buf[0] + 1);
 1363         }
 1364         else
 1365         {
 1366           event_log_info (hashcat_ctx, "  Backend Device ID #%u", device_id + 1);
 1367         }
 1368 
 1369         event_log_info (hashcat_ctx, "    Type...........: %s", ((opencl_device_type & CL_DEVICE_TYPE_CPU) ? "CPU" : ((opencl_device_type & CL_DEVICE_TYPE_GPU) ? "GPU" : "Accelerator")));
 1370         event_log_info (hashcat_ctx, "    Vendor.ID......: %u", opencl_device_vendor_id);
 1371         event_log_info (hashcat_ctx, "    Vendor.........: %s", opencl_device_vendor);
 1372         event_log_info (hashcat_ctx, "    Name...........: %s", device_name);
 1373         event_log_info (hashcat_ctx, "    Version........: %s", opencl_device_version);
 1374         event_log_info (hashcat_ctx, "    Processor(s)...: %u", device_processors);
 1375         event_log_info (hashcat_ctx, "    Clock..........: %u", device_maxclock_frequency);
 1376         event_log_info (hashcat_ctx, "    Memory.Total...: %" PRIu64 " MB (limited to %" PRIu64 " MB allocatable in one block)", device_global_mem / 1024 / 1024, device_maxmem_alloc / 1024 / 1024);
 1377         event_log_info (hashcat_ctx, "    Memory.Free....: %" PRIu64 " MB", device_available_mem / 1024 / 1024);
 1378         event_log_info (hashcat_ctx, "    Local.Memory...: %" PRIu64 " KB", device_local_mem_size / 1024);
 1379         event_log_info (hashcat_ctx, "    OpenCL.Version.: %s", opencl_device_c_version);
 1380         event_log_info (hashcat_ctx, "    Driver.Version.: %s", opencl_driver_version);
 1381 
 1382         if (device_param->opencl_device_type & CL_DEVICE_TYPE_GPU)
 1383         {
 1384           u8 pcie_bus      = device_param->pcie_bus;
 1385           u8 pcie_device   = device_param->pcie_device;
 1386           u8 pcie_function = device_param->pcie_function;
 1387 
 1388           if ((device_param->opencl_platform_vendor_id == VENDOR_ID_AMD) && (device_param->opencl_device_vendor_id == VENDOR_ID_AMD))
 1389           {
 1390             event_log_info (hashcat_ctx, "    PCI.Addr.BDF...: %02x:%02x.%u", pcie_bus, pcie_device, pcie_function);
 1391           }
 1392 
 1393           if ((device_param->opencl_platform_vendor_id == VENDOR_ID_NV) && (device_param->opencl_device_vendor_id == VENDOR_ID_NV))
 1394           {
 1395             event_log_info (hashcat_ctx, "    PCI.Addr.BDF...: %02x:%02x.%u", pcie_bus, pcie_device, pcie_function);
 1396           }
 1397         }
 1398 
 1399         event_log_info (hashcat_ctx, NULL);
 1400       }
 1401     }
 1402   }
 1403 }
 1404 
 1405 void backend_info_compact (hashcat_ctx_t *hashcat_ctx)
 1406 {
 1407   const backend_ctx_t  *backend_ctx  = hashcat_ctx->backend_ctx;
 1408   const user_options_t *user_options = hashcat_ctx->user_options;
 1409 
 1410   if (user_options->quiet            == true) return;
 1411   if (user_options->machine_readable == true) return;
 1412   if (user_options->status_json      == true) return;
 1413 
 1414   /**
 1415    * CUDA
 1416    */
 1417 
 1418   if (backend_ctx->cuda)
 1419   {
 1420     int cuda_devices_cnt    = backend_ctx->cuda_devices_cnt;
 1421     int cuda_driver_version = backend_ctx->cuda_driver_version;
 1422 
 1423     const size_t len = event_log_info (hashcat_ctx, "CUDA API (CUDA %u.%u)", cuda_driver_version / 1000, (cuda_driver_version % 100) / 10);
 1424 
 1425     char line[HCBUFSIZ_TINY] = { 0 };
 1426 
 1427     memset (line, '=', len);
 1428 
 1429     line[len] = 0;
 1430 
 1431     event_log_info (hashcat_ctx, "%s", line);
 1432 
 1433     for (int cuda_devices_idx = 0; cuda_devices_idx < cuda_devices_cnt; cuda_devices_idx++)
 1434     {
 1435       const int backend_devices_idx = backend_ctx->backend_device_from_cuda[cuda_devices_idx];
 1436 
 1437       const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
 1438 
 1439       int   device_id            = device_param->device_id;
 1440       char *device_name          = device_param->device_name;
 1441       u32   device_processors    = device_param->device_processors;
 1442       u64   device_global_mem    = device_param->device_global_mem;
 1443       u64   device_available_mem = device_param->device_available_mem;
 1444 
 1445       if ((device_param->skipped == false) && (device_param->skipped_warning == false))
 1446       {
 1447         event_log_info (hashcat_ctx, "* Device #%u: %s, %" PRIu64 "/%" PRIu64 " MB, %uMCU",
 1448                   device_id + 1,
 1449                   device_name,
 1450                   device_available_mem / 1024 / 1024,
 1451                   device_global_mem    / 1024 / 1024,
 1452                   device_processors);
 1453       }
 1454       else
 1455       {
 1456         event_log_info (hashcat_ctx, "* Device #%u: %s, skipped",
 1457                   device_id + 1,
 1458                   device_name);
 1459       }
 1460     }
 1461 
 1462     event_log_info (hashcat_ctx, NULL);
 1463   }
 1464 
 1465   /**
 1466    * HIP
 1467    */
 1468 
 1469   if (backend_ctx->hip)
 1470   {
 1471     int hip_devices_cnt    = backend_ctx->hip_devices_cnt;
 1472     int hip_runtimeVersion = backend_ctx->hip_runtimeVersion;
 1473 
 1474     size_t len;
 1475 
 1476     if (hip_runtimeVersion > 1000)
 1477     {
 1478       int hip_version_major = (hip_runtimeVersion - 0) / 10000000;
 1479       int hip_version_minor = (hip_runtimeVersion - (hip_version_major * 10000000)) / 100000;
 1480       int hip_version_patch = (hip_runtimeVersion - (hip_version_major * 10000000) - (hip_version_minor * 100000));
 1481 
 1482       len = event_log_info (hashcat_ctx, "HIP API (HIP %u.%u.%u)", hip_version_major, hip_version_minor, hip_version_patch);
 1483     }
 1484     else
 1485     {
 1486       len = event_log_info (hashcat_ctx, "HIP API (HIP %u.%u)", hip_runtimeVersion / 100, hip_runtimeVersion % 10);
 1487     }
 1488 
 1489     char line[HCBUFSIZ_TINY] = { 0 };
 1490 
 1491     memset (line, '=', len);
 1492 
 1493     line[len] = 0;
 1494 
 1495     event_log_info (hashcat_ctx, "%s", line);
 1496 
 1497     for (int hip_devices_idx = 0; hip_devices_idx < hip_devices_cnt; hip_devices_idx++)
 1498     {
 1499       const int backend_devices_idx = backend_ctx->backend_device_from_hip[hip_devices_idx];
 1500 
 1501       const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
 1502 
 1503       int   device_id            = device_param->device_id;
 1504       char *device_name          = device_param->device_name;
 1505       u32   device_processors    = device_param->device_processors;
 1506       u64   device_global_mem    = device_param->device_global_mem;
 1507       u64   device_available_mem = device_param->device_available_mem;
 1508 
 1509       if ((device_param->skipped == false) && (device_param->skipped_warning == false))
 1510       {
 1511         event_log_info (hashcat_ctx, "* Device #%u: %s, %" PRIu64 "/%" PRIu64 " MB, %uMCU",
 1512                   device_id + 1,
 1513                   device_name,
 1514                   device_available_mem / 1024 / 1024,
 1515                   device_global_mem    / 1024 / 1024,
 1516                   device_processors);
 1517       }
 1518       else
 1519       {
 1520         event_log_info (hashcat_ctx, "* Device #%u: %s, skipped",
 1521                   device_id + 1,
 1522                   device_name);
 1523       }
 1524     }
 1525 
 1526     event_log_info (hashcat_ctx, NULL);
 1527   }
 1528 
 1529   #if defined (__APPLE__)
 1530   /**
 1531    * Metal
 1532    */
 1533 
 1534   if (backend_ctx->mtl)
 1535   {
 1536     int metal_devices_cnt    = backend_ctx->metal_devices_cnt;
 1537     char *metal_runtimeVersionStr = backend_ctx->metal_runtimeVersionStr;
 1538 
 1539     size_t len = event_log_info (hashcat_ctx, "METAL API (Metal %s)", metal_runtimeVersionStr);
 1540 
 1541     char line[HCBUFSIZ_TINY] = { 0 };
 1542 
 1543     memset (line, '=', len);
 1544 
 1545     line[len] = 0;
 1546 
 1547     event_log_info (hashcat_ctx, "%s", line);
 1548 
 1549     for (int metal_devices_idx = 0; metal_devices_idx < metal_devices_cnt; metal_devices_idx++)
 1550     {
 1551       const int backend_devices_idx = backend_ctx->backend_device_from_metal[metal_devices_idx];
 1552 
 1553       const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
 1554 
 1555       int   device_id            = device_param->device_id;
 1556       char *device_name          = device_param->device_name;
 1557       u32   device_processors    = device_param->device_processors;
 1558       u64   device_global_mem    = device_param->device_global_mem;
 1559       u64   device_available_mem = device_param->device_available_mem;
 1560 
 1561       if ((device_param->skipped == false) && (device_param->skipped_warning == false))
 1562       {
 1563         event_log_info (hashcat_ctx, "* Device #%u: %s, %" PRIu64 "/%" PRIu64 " MB, %uMCU",
 1564                   device_id + 1,
 1565                   device_name,
 1566                   device_available_mem / 1024 / 1024,
 1567                   device_global_mem    / 1024 / 1024,
 1568                   device_processors);
 1569       }
 1570       else
 1571       {
 1572         event_log_info (hashcat_ctx, "* Device #%u: %s, skipped",
 1573                   device_id + 1,
 1574                   device_name);
 1575       }
 1576     }
 1577 
 1578     event_log_info (hashcat_ctx, NULL);
 1579   }
 1580   #endif
 1581 
 1582   /**
 1583    * OpenCL
 1584    */
 1585 
 1586   if (backend_ctx->ocl)
 1587   {
 1588     cl_uint   opencl_platforms_cnt         = backend_ctx->opencl_platforms_cnt;
 1589     cl_uint  *opencl_platforms_devices_cnt = backend_ctx->opencl_platforms_devices_cnt;
 1590     char    **opencl_platforms_vendor      = backend_ctx->opencl_platforms_vendor;
 1591     char    **opencl_platforms_version     = backend_ctx->opencl_platforms_version;
 1592 
 1593     for (cl_uint opencl_platforms_idx = 0; opencl_platforms_idx < opencl_platforms_cnt; opencl_platforms_idx++)
 1594     {
 1595       char     *opencl_platform_vendor       = opencl_platforms_vendor[opencl_platforms_idx];
 1596       char     *opencl_platform_version      = opencl_platforms_version[opencl_platforms_idx];
 1597       cl_uint   opencl_platform_devices_cnt  = opencl_platforms_devices_cnt[opencl_platforms_idx];
 1598 
 1599       // hide empty OpenCL platforms
 1600       if (opencl_platform_devices_cnt == 0) continue;
 1601 
 1602       const size_t len = event_log_info (hashcat_ctx, "OpenCL API (%s) - Platform #%u [%s]", opencl_platform_version, opencl_platforms_idx + 1, opencl_platform_vendor);
 1603 
 1604       char line[HCBUFSIZ_TINY] = { 0 };
 1605 
 1606       memset (line, '=', len);
 1607 
 1608       line[len] = 0;
 1609 
 1610       event_log_info (hashcat_ctx, "%s", line);
 1611 
 1612       for (cl_uint opencl_platform_devices_idx = 0; opencl_platform_devices_idx < opencl_platform_devices_cnt; opencl_platform_devices_idx++)
 1613       {
 1614         const int backend_devices_idx = backend_ctx->backend_device_from_opencl_platform[opencl_platforms_idx][opencl_platform_devices_idx];
 1615 
 1616         const hc_device_param_t *device_param = backend_ctx->devices_param + backend_devices_idx;
 1617 
 1618         int   device_id            = device_param->device_id;
 1619         char *device_name          = device_param->device_name;
 1620         u32   device_processors    = device_param->device_processors;
 1621         u64   device_maxmem_alloc  = device_param->device_maxmem_alloc;
 1622         u64   device_global_mem    = device_param->device_global_mem;
 1623         u64   device_available_mem = device_param->device_available_mem;
 1624 
 1625         if ((device_param->skipped == false) && (device_param->skipped_warning == false))
 1626         {
 1627           if (strncmp (device_name, "Apple M", 7) == 0)
 1628           {
 1629             cl_device_type opencl_device_type = device_param->opencl_device_type;
 1630 
 1631             const char *device_type_desc = ((opencl_device_type & CL_DEVICE_TYPE_CPU) ? "CPU" : ((opencl_device_type & CL_DEVICE_TYPE_GPU) ? "GPU" : "Accelerator"));
 1632 
 1633             event_log_info (hashcat_ctx, "* Device #%u: %s, %s, %" PRIu64 "/%" PRIu64 " MB (%" PRIu64 " MB allocatable), %uMCU",
 1634                       device_id + 1,
 1635                       device_name,
 1636                       device_type_desc,
 1637                       device_available_mem / 1024 / 1024,
 1638                       device_global_mem    / 1024 / 1024,
 1639                       device_maxmem_alloc  / 1024 / 1024,
 1640                       device_processors);
 1641           }
 1642           else
 1643           {
 1644             event_log_info (hashcat_ctx, "* Device #%u: %s, %" PRIu64 "/%" PRIu64 " MB (%" PRIu64 " MB allocatable), %uMCU",
 1645                       device_id + 1,
 1646                       device_name,
 1647                       device_available_mem / 1024 / 1024,
 1648                       device_global_mem    / 1024 / 1024,
 1649                       device_maxmem_alloc  / 1024 / 1024,
 1650                       device_processors);
 1651           }
 1652         }
 1653         else
 1654         {
 1655           event_log_info (hashcat_ctx, "* Device #%u: %s, skipped",
 1656                     device_id + 1,
 1657                     device_name);
 1658         }
 1659       }
 1660 
 1661       event_log_info (hashcat_ctx, NULL);
 1662     }
 1663   }
 1664 }
 1665 
 1666 void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx)
 1667 {
 1668   const hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx;
 1669 
 1670   hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
 1671 
 1672   if (hashcat_get_status (hashcat_ctx, hashcat_status) == -1)
 1673   {
 1674     hcfree (hashcat_status);
 1675 
 1676     return;
 1677   }
 1678 
 1679   printf ("STATUS\t%d\t", hashcat_status->status_number);
 1680 
 1681   printf ("SPEED\t");
 1682 
 1683   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 1684   {
 1685     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 1686 
 1687     if (device_info->skipped_dev == true) continue;
 1688     if (device_info->skipped_warning_dev == true) continue;
 1689 
 1690     printf ("%" PRIu64 "\t", (u64) (device_info->hashes_msec_dev * 1000));
 1691 
 1692     // that 1\t is for backward compatibility
 1693     printf ("1000\t");
 1694   }
 1695 
 1696   printf ("EXEC_RUNTIME\t");
 1697 
 1698   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 1699   {
 1700     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 1701 
 1702     if (device_info->skipped_dev == true) continue;
 1703     if (device_info->skipped_warning_dev == true) continue;
 1704 
 1705     printf ("%f\t", device_info->exec_msec_dev);
 1706   }
 1707 
 1708   printf ("CURKU\t%" PRIu64 "\t", hashcat_status->restore_point);
 1709 
 1710   printf ("PROGRESS\t%" PRIu64 "\t%" PRIu64 "\t", hashcat_status->progress_cur_relative_skip, hashcat_status->progress_end_relative_skip);
 1711 
 1712   printf ("RECHASH\t%u\t%u\t", hashcat_status->digests_done, hashcat_status->digests_cnt);
 1713 
 1714   printf ("RECSALT\t%u\t%u\t", hashcat_status->salts_done, hashcat_status->salts_cnt);
 1715 
 1716   if (hwmon_ctx->enabled == true)
 1717   {
 1718     printf ("TEMP\t");
 1719 
 1720     for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 1721     {
 1722       const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 1723 
 1724       if (device_info->skipped_dev == true) continue;
 1725       if (device_info->skipped_warning_dev == true) continue;
 1726 
 1727       const int temp = hm_get_temperature_with_devices_idx (hashcat_ctx, device_id);
 1728 
 1729       printf ("%d\t", temp);
 1730     }
 1731   }
 1732 
 1733   printf ("REJECTED\t%" PRIu64 "\t", hashcat_status->progress_rejected);
 1734 
 1735   printf ("UTIL\t");
 1736 
 1737   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 1738   {
 1739     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 1740 
 1741     if (device_info->skipped_dev == true) continue;
 1742     if (device_info->skipped_warning_dev == true) continue;
 1743 
 1744     // ok, little cheat here again...
 1745 
 1746     const int util = hm_get_utilization_with_devices_idx (hashcat_ctx, device_id);
 1747 
 1748     printf ("%d\t", util);
 1749   }
 1750 
 1751   fwrite (EOL, strlen (EOL), 1, stdout);
 1752 
 1753   fflush (stdout);
 1754 
 1755   status_status_destroy (hashcat_ctx, hashcat_status);
 1756 
 1757   hcfree (hashcat_status);
 1758 }
 1759 
 1760 void json_encode (char *text, char *escaped)
 1761 {
 1762   /*
 1763    * Based on https://www.freeformatter.com/json-escape.html, below these 7 different chars
 1764    * are getting escaped before being printed.
 1765    */
 1766 
 1767   size_t len = strlen (text);
 1768   unsigned long i, j;
 1769 
 1770   for (i = 0, j = 0; i < len; i++, j++)
 1771   {
 1772     char c = text[i];
 1773 
 1774     switch (c)
 1775     {
 1776       case '\b': c =  'b'; escaped[j] = '\\'; j++; break;
 1777       case '\t': c =  't'; escaped[j] = '\\'; j++; break;
 1778       case '\n': c =  'n'; escaped[j] = '\\'; j++; break;
 1779       case '\f': c =  'f'; escaped[j] = '\\'; j++; break;
 1780       case '\r': c =  'r'; escaped[j] = '\\'; j++; break;
 1781       case '\\': c = '\\'; escaped[j] = '\\'; j++; break;
 1782       case  '"': c =  '"'; escaped[j] = '\\'; j++; break;
 1783     }
 1784 
 1785     escaped[j] = c;
 1786   }
 1787 
 1788   escaped[j] = 0;
 1789 }
 1790 
 1791 void status_display_status_json (hashcat_ctx_t *hashcat_ctx)
 1792 {
 1793   const hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx;
 1794 
 1795   const status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
 1796 
 1797   hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
 1798 
 1799   if (hashcat_get_status (hashcat_ctx, hashcat_status) == -1)
 1800   {
 1801     hcfree (hashcat_status);
 1802 
 1803     return;
 1804   }
 1805 
 1806   time_t time_now;
 1807 
 1808   time (&time_now);
 1809 
 1810   time_t end;
 1811 
 1812   time_t sec_etc = status_get_sec_etc (hashcat_ctx);
 1813 
 1814   if (overflow_check_u64_add (time_now, sec_etc) == false)
 1815   {
 1816     end = 1;
 1817   }
 1818   else
 1819   {
 1820     end = time_now + sec_etc;
 1821   }
 1822 
 1823   printf ("{ \"session\": \"%s\",", hashcat_status->session);
 1824   printf (" \"guess\": {");
 1825   if (hashcat_status->guess_base)
 1826   {
 1827     printf (" \"guess_base\": \"%s\",", hashcat_status->guess_base);
 1828   }
 1829   else
 1830   {
 1831     printf (" \"guess_base\": null,");
 1832   }
 1833 
 1834   printf (" \"guess_base_count\": %u,", hashcat_status->guess_base_count);
 1835   printf (" \"guess_base_offset\": %u,", hashcat_status->guess_base_offset);
 1836   printf (" \"guess_base_percent\": %.02f,", hashcat_status->guess_base_percent);
 1837   printf (" \"guess_mask_length\": %u,", hashcat_status->guess_mask_length);
 1838 
 1839   if (hashcat_status->guess_mod)
 1840   {
 1841     printf (" \"guess_mod\": \"%s\",", hashcat_status->guess_mod);
 1842   }
 1843   else
 1844   {
 1845     printf (" \"guess_mod\": null,");
 1846   }
 1847 
 1848   printf (" \"guess_mod_count\": %u,", hashcat_status->guess_mod_count);
 1849   printf (" \"guess_mod_offset\": %u,", hashcat_status->guess_mod_offset);
 1850   printf (" \"guess_mod_percent\": %.02f,", hashcat_status->guess_mod_percent);
 1851   printf (" \"guess_mode\": %u", hashcat_status->guess_mode);
 1852   printf (" },");
 1853   printf (" \"status\": %d,", hashcat_status->status_number);
 1854 
 1855   /*
 1856    * As the hash target can contain the hash (in case of a single attacked hash), especially
 1857    * some salts can contain chars which need to be escaped to not break the JSON encoding.
 1858    */
 1859   char *target_json_encoded = (char *) hcmalloc (strlen (hashcat_status->hash_target) * 2);
 1860   json_encode (hashcat_status->hash_target, target_json_encoded);
 1861   printf (" \"target\": \"%s\",", target_json_encoded);
 1862   hcfree (target_json_encoded);
 1863 
 1864   printf (" \"progress\": [%" PRIu64 ", %" PRIu64 "],", hashcat_status->progress_cur_relative_skip, hashcat_status->progress_end_relative_skip);
 1865   printf (" \"restore_point\": %" PRIu64 ",", hashcat_status->restore_point);
 1866   printf (" \"recovered_hashes\": [%u, %u],", hashcat_status->digests_done, hashcat_status->digests_cnt);
 1867   printf (" \"recovered_salts\": [%u, %u],", hashcat_status->salts_done, hashcat_status->salts_cnt);
 1868   printf (" \"rejected\": %" PRIu64 ",", hashcat_status->progress_rejected);
 1869   printf (" \"devices\": [");
 1870 
 1871   int device_num = 0;
 1872 
 1873   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 1874   {
 1875     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 1876 
 1877     if (device_info->skipped_dev == true) continue;
 1878     if (device_info->skipped_warning_dev == true) continue;
 1879 
 1880     if (device_num != 0)
 1881     {
 1882       printf (",");
 1883     }
 1884 
 1885     printf (" { \"device_id\": %u,", device_id + 1);
 1886 
 1887     char *device_name_json_encoded = (char *) hcmalloc (strlen (device_info->device_name) * 2);
 1888     json_encode (device_info->device_name, device_name_json_encoded);
 1889     printf (" \"device_name\": \"%s\",", device_name_json_encoded);
 1890     hcfree (device_name_json_encoded);
 1891 
 1892     const char *device_type_desc = ((device_info->device_type & CL_DEVICE_TYPE_CPU) ? "CPU" :
 1893                                    ((device_info->device_type & CL_DEVICE_TYPE_GPU) ? "GPU" : "Accelerator"));
 1894     printf (" \"device_type\": \"%s\",", device_type_desc);
 1895 
 1896     printf (" \"speed\": %" PRIu64 ",", (u64) (device_info->hashes_msec_dev * 1000));
 1897 
 1898     if (hwmon_ctx->enabled == true)
 1899     {
 1900       const int temp = hm_get_temperature_with_devices_idx (hashcat_ctx, device_id);
 1901 
 1902       printf (" \"temp\": %d,", temp);
 1903     }
 1904 
 1905     const int util = hm_get_utilization_with_devices_idx (hashcat_ctx, device_id);
 1906 
 1907     printf (" \"util\": %d }", util);
 1908 
 1909     device_num++;
 1910   }
 1911   printf (" ],");
 1912   printf (" \"time_start\": %" PRIu64 ",", (u64) status_ctx->runtime_start);
 1913   printf (" \"estimated_stop\": %" PRIu64 " }", (u64) end);
 1914 
 1915   fwrite (EOL, strlen (EOL), 1, stdout);
 1916 
 1917   fflush (stdout);
 1918 
 1919   status_status_destroy (hashcat_ctx, hashcat_status);
 1920 
 1921   hcfree (hashcat_status);
 1922 }
 1923 
 1924 void status_display (hashcat_ctx_t *hashcat_ctx)
 1925 {
 1926   const hashconfig_t   *hashconfig   = hashcat_ctx->hashconfig;
 1927   const hwmon_ctx_t    *hwmon_ctx    = hashcat_ctx->hwmon_ctx;
 1928   const user_options_t *user_options = hashcat_ctx->user_options;
 1929 
 1930   if (user_options->machine_readable == true)
 1931   {
 1932     status_display_machine_readable (hashcat_ctx);
 1933 
 1934     return;
 1935   }
 1936 
 1937   if (user_options->status_json == true)
 1938   {
 1939     status_display_status_json (hashcat_ctx);
 1940 
 1941     return;
 1942   }
 1943 
 1944   hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
 1945 
 1946   if (hashcat_get_status (hashcat_ctx, hashcat_status) == -1)
 1947   {
 1948     hcfree (hashcat_status);
 1949 
 1950     return;
 1951   }
 1952 
 1953   /**
 1954    * show something
 1955    */
 1956 
 1957   #ifdef WITH_BRAIN
 1958   if (user_options->brain_client == true)
 1959   {
 1960     event_log_info (hashcat_ctx,
 1961       "Session..........: %s (Brain Session/Attack:0x%08x/0x%08x)",
 1962       hashcat_status->session,
 1963       hashcat_status->brain_session,
 1964       hashcat_status->brain_attack);
 1965   }
 1966   else
 1967   {
 1968     event_log_info (hashcat_ctx,
 1969       "Session..........: %s",
 1970       hashcat_status->session);
 1971   }
 1972   #else
 1973   event_log_info (hashcat_ctx,
 1974     "Session..........: %s",
 1975     hashcat_status->session);
 1976   #endif
 1977 
 1978   event_log_info (hashcat_ctx,
 1979     "Status...........: %s",
 1980     hashcat_status->status_string);
 1981 
 1982   event_log_info (hashcat_ctx,
 1983     "Hash.Mode........: %u (%s)",
 1984     hashconfig->hash_mode,
 1985     hashcat_status->hash_name);
 1986 
 1987   event_log_info (hashcat_ctx,
 1988     "Hash.Target......: %s",
 1989     hashcat_status->hash_target);
 1990 
 1991   if (user_options->force == true)
 1992   {
 1993     event_log_info (hashcat_ctx,
 1994     "Time.Started.....: %s, (%s)",
 1995     hashcat_status->time_started_absolute,
 1996     hashcat_status->time_started_relative);
 1997   }
 1998   else
 1999   {
 2000     event_log_info (hashcat_ctx,
 2001     "Time.Started.....: %s (%s)",
 2002     hashcat_status->time_started_absolute,
 2003     hashcat_status->time_started_relative);
 2004   }
 2005 
 2006   if (user_options->force == true)
 2007   {
 2008     event_log_info (hashcat_ctx,
 2009     "Time.Estimated...: %s, (%s)",
 2010     hashcat_status->time_estimated_absolute,
 2011     hashcat_status->time_estimated_relative);
 2012   }
 2013   else
 2014   {
 2015     event_log_info (hashcat_ctx,
 2016     "Time.Estimated...: %s (%s)",
 2017     hashcat_status->time_estimated_absolute,
 2018     hashcat_status->time_estimated_relative);
 2019   }
 2020 
 2021   if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
 2022   {
 2023     event_log_info (hashcat_ctx, "Kernel.Feature...: Optimized Kernel");
 2024   }
 2025   else
 2026   {
 2027     event_log_info (hashcat_ctx, "Kernel.Feature...: Pure Kernel");
 2028   }
 2029 
 2030   switch (hashcat_status->guess_mode)
 2031   {
 2032     case GUESS_MODE_STRAIGHT_FILE:
 2033 
 2034       event_log_info (hashcat_ctx,
 2035         "Guess.Base.......: File (%s)",
 2036         hashcat_status->guess_base);
 2037 
 2038       break;
 2039 
 2040     case GUESS_MODE_STRAIGHT_FILE_RULES_FILE:
 2041 
 2042       event_log_info (hashcat_ctx,
 2043         "Guess.Base.......: File (%s)",
 2044         hashcat_status->guess_base);
 2045 
 2046       event_log_info (hashcat_ctx,
 2047         "Guess.Mod........: Rules (%s)",
 2048         hashcat_status->guess_mod);
 2049 
 2050       break;
 2051 
 2052     case GUESS_MODE_STRAIGHT_FILE_RULES_GEN:
 2053 
 2054       event_log_info (hashcat_ctx,
 2055         "Guess.Base.......: File (%s)",
 2056         hashcat_status->guess_base);
 2057 
 2058       event_log_info (hashcat_ctx,
 2059         "Guess.Mod........: Rules (Generated)");
 2060 
 2061       break;
 2062 
 2063     case GUESS_MODE_STRAIGHT_STDIN:
 2064 
 2065       event_log_info (hashcat_ctx,
 2066         "Guess.Base.......: Pipe");
 2067 
 2068       break;
 2069 
 2070     case GUESS_MODE_STRAIGHT_STDIN_RULES_FILE:
 2071 
 2072       event_log_info (hashcat_ctx,
 2073         "Guess.Base.......: Pipe");
 2074 
 2075       event_log_info (hashcat_ctx,
 2076         "Guess.Mod........: Rules (%s)",
 2077         hashcat_status->guess_mod);
 2078 
 2079       break;
 2080 
 2081     case GUESS_MODE_STRAIGHT_STDIN_RULES_GEN:
 2082 
 2083       event_log_info (hashcat_ctx,
 2084         "Guess.Base.......: Pipe");
 2085 
 2086       event_log_info (hashcat_ctx,
 2087         "Guess.Mod........: Rules (Generated)");
 2088 
 2089       break;
 2090 
 2091     case GUESS_MODE_COMBINATOR_BASE_LEFT:
 2092 
 2093       event_log_info (hashcat_ctx,
 2094         "Guess.Base.......: File (%s), Left Side",
 2095         hashcat_status->guess_base);
 2096 
 2097       event_log_info (hashcat_ctx,
 2098         "Guess.Mod........: File (%s), Right Side",
 2099         hashcat_status->guess_mod);
 2100 
 2101       break;
 2102 
 2103     case GUESS_MODE_COMBINATOR_BASE_RIGHT:
 2104 
 2105       event_log_info (hashcat_ctx,
 2106         "Guess.Base.......: File (%s), Right Side",
 2107         hashcat_status->guess_base);
 2108 
 2109       event_log_info (hashcat_ctx,
 2110         "Guess.Mod........: File (%s), Left Side",
 2111         hashcat_status->guess_mod);
 2112 
 2113       break;
 2114 
 2115     case GUESS_MODE_MASK:
 2116 
 2117       event_log_info (hashcat_ctx,
 2118         "Guess.Mask.......: %s [%u]",
 2119         hashcat_status->guess_base,
 2120         hashcat_status->guess_mask_length);
 2121 
 2122       break;
 2123 
 2124     case GUESS_MODE_MASK_CS:
 2125 
 2126       event_log_info (hashcat_ctx,
 2127         "Guess.Mask.......: %s [%u]",
 2128         hashcat_status->guess_base,
 2129         hashcat_status->guess_mask_length);
 2130 
 2131       event_log_info (hashcat_ctx,
 2132         "Guess.Charset....: %s ",
 2133         hashcat_status->guess_charset);
 2134 
 2135       break;
 2136 
 2137     case GUESS_MODE_HYBRID1:
 2138 
 2139       event_log_info (hashcat_ctx,
 2140         "Guess.Base.......: File (%s), Left Side",
 2141         hashcat_status->guess_base);
 2142 
 2143       event_log_info (hashcat_ctx,
 2144         "Guess.Mod........: Mask (%s) [%u], Right Side",
 2145         hashcat_status->guess_mod,
 2146         hashcat_status->guess_mask_length);
 2147 
 2148       break;
 2149 
 2150     case GUESS_MODE_HYBRID1_CS:
 2151 
 2152       event_log_info (hashcat_ctx,
 2153         "Guess.Base.......: File (%s), Left Side",
 2154         hashcat_status->guess_base);
 2155 
 2156       event_log_info (hashcat_ctx,
 2157         "Guess.Mod........: Mask (%s) [%u], Right Side",
 2158         hashcat_status->guess_mod,
 2159         hashcat_status->guess_mask_length);
 2160 
 2161       event_log_info (hashcat_ctx,
 2162         "Guess.Charset....: %s",
 2163         hashcat_status->guess_charset);
 2164 
 2165       break;
 2166 
 2167     case GUESS_MODE_HYBRID2:
 2168 
 2169       if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
 2170       {
 2171         event_log_info (hashcat_ctx,
 2172           "Guess.Base.......: Mask (%s) [%u], Left Side",
 2173           hashcat_status->guess_base,
 2174           hashcat_status->guess_mask_length);
 2175 
 2176         event_log_info (hashcat_ctx,
 2177           "Guess.Mod........: File (%s), Right Side",
 2178           hashcat_status->guess_mod);
 2179       }
 2180       else
 2181       {
 2182         event_log_info (hashcat_ctx,
 2183           "Guess.Base.......: File (%s), Right Side",
 2184           hashcat_status->guess_base);
 2185 
 2186         event_log_info (hashcat_ctx,
 2187           "Guess.Mod........: Mask (%s) [%u], Left Side",
 2188           hashcat_status->guess_mod,
 2189           hashcat_status->guess_mask_length);
 2190       }
 2191 
 2192       break;
 2193 
 2194     case GUESS_MODE_HYBRID2_CS:
 2195 
 2196       if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
 2197       {
 2198         event_log_info (hashcat_ctx,
 2199           "Guess.Base.......: Mask (%s) [%u], Left Side",
 2200           hashcat_status->guess_base,
 2201           hashcat_status->guess_mask_length);
 2202 
 2203         event_log_info (hashcat_ctx,
 2204           "Guess.Mod........: File (%s), Right Side",
 2205           hashcat_status->guess_mod);
 2206 
 2207         event_log_info (hashcat_ctx,
 2208           "Guess.Charset....: %s",
 2209           hashcat_status->guess_charset);
 2210       }
 2211       else
 2212       {
 2213         event_log_info (hashcat_ctx,
 2214           "Guess.Base.......: File (%s), Right Side",
 2215           hashcat_status->guess_base);
 2216 
 2217         event_log_info (hashcat_ctx,
 2218           "Guess.Mod........: Mask (%s) [%u], Left Side",
 2219           hashcat_status->guess_mod,
 2220           hashcat_status->guess_mask_length);
 2221 
 2222         event_log_info (hashcat_ctx,
 2223           "Guess.Charset....: %s",
 2224           hashcat_status->guess_charset);
 2225       }
 2226 
 2227       break;
 2228   }
 2229 
 2230   switch (hashcat_status->guess_mode)
 2231   {
 2232     case GUESS_MODE_STRAIGHT_FILE:
 2233 
 2234       event_log_info (hashcat_ctx,
 2235         "Guess.Queue......: %u/%u (%.02f%%)",
 2236         hashcat_status->guess_base_offset,
 2237         hashcat_status->guess_base_count,
 2238         hashcat_status->guess_base_percent);
 2239 
 2240       break;
 2241 
 2242     case GUESS_MODE_STRAIGHT_FILE_RULES_FILE:
 2243 
 2244       event_log_info (hashcat_ctx,
 2245         "Guess.Queue......: %u/%u (%.02f%%)",
 2246         hashcat_status->guess_base_offset,
 2247         hashcat_status->guess_base_count,
 2248         hashcat_status->guess_base_percent);
 2249 
 2250       break;
 2251 
 2252     case GUESS_MODE_STRAIGHT_FILE_RULES_GEN:
 2253 
 2254       event_log_info (hashcat_ctx,
 2255         "Guess.Queue......: %u/%u (%.02f%%)",
 2256         hashcat_status->guess_base_offset,
 2257         hashcat_status->guess_base_count,
 2258         hashcat_status->guess_base_percent);
 2259 
 2260       break;
 2261 
 2262     case GUESS_MODE_MASK:
 2263 
 2264       event_log_info (hashcat_ctx,
 2265         "Guess.Queue......: %u/%u (%.02f%%)",
 2266         hashcat_status->guess_base_offset,
 2267         hashcat_status->guess_base_count,
 2268         hashcat_status->guess_base_percent);
 2269 
 2270       break;
 2271 
 2272     case GUESS_MODE_MASK_CS:
 2273 
 2274       event_log_info (hashcat_ctx,
 2275         "Guess.Queue......: %u/%u (%.02f%%)",
 2276         hashcat_status->guess_base_offset,
 2277         hashcat_status->guess_base_count,
 2278         hashcat_status->guess_base_percent);
 2279 
 2280       break;
 2281 
 2282     case GUESS_MODE_HYBRID1:
 2283 
 2284       event_log_info (hashcat_ctx,
 2285         "Guess.Queue.Base.: %u/%u (%.02f%%)",
 2286         hashcat_status->guess_base_offset,
 2287         hashcat_status->guess_base_count,
 2288         hashcat_status->guess_base_percent);
 2289 
 2290       event_log_info (hashcat_ctx,
 2291         "Guess.Queue.Mod..: %u/%u (%.02f%%)",
 2292         hashcat_status->guess_mod_offset,
 2293         hashcat_status->guess_mod_count,
 2294         hashcat_status->guess_mod_percent);
 2295 
 2296       break;
 2297 
 2298     case GUESS_MODE_HYBRID2:
 2299 
 2300       event_log_info (hashcat_ctx,
 2301         "Guess.Queue.Base.: %u/%u (%.02f%%)",
 2302         hashcat_status->guess_base_offset,
 2303         hashcat_status->guess_base_count,
 2304         hashcat_status->guess_base_percent);
 2305 
 2306       event_log_info (hashcat_ctx,
 2307         "Guess.Queue.Mod..: %u/%u (%.02f%%)",
 2308         hashcat_status->guess_mod_offset,
 2309         hashcat_status->guess_mod_count,
 2310         hashcat_status->guess_mod_percent);
 2311 
 2312       break;
 2313   }
 2314 
 2315   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2316   {
 2317     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2318 
 2319     if (device_info->skipped_dev == true) continue;
 2320     if (device_info->skipped_warning_dev == true) continue;
 2321 
 2322     event_log_info (hashcat_ctx,
 2323       "Speed.#%u.........: %9sH/s (%0.2fms) @ Accel:%u Loops:%u Thr:%u Vec:%u", device_id + 1,
 2324       device_info->speed_sec_dev,
 2325       device_info->exec_msec_dev,
 2326       device_info->kernel_accel_dev,
 2327       device_info->kernel_loops_dev,
 2328       device_info->kernel_threads_dev,
 2329       device_info->vector_width_dev);
 2330   }
 2331 
 2332   if (hashcat_status->device_info_active > 1)
 2333   {
 2334     event_log_info (hashcat_ctx,
 2335       "Speed.#*.........: %9sH/s",
 2336       hashcat_status->speed_sec_all);
 2337   }
 2338 
 2339   if (hashcat_status->salts_cnt > 1)
 2340   {
 2341     event_log_info (hashcat_ctx,
 2342       "Recovered........: %u/%u (%.2f%%) Digests (total), %u/%u (%.2f%%) Digests (new), %u/%u (%.2f%%) Salts",
 2343       hashcat_status->digests_done,
 2344       hashcat_status->digests_cnt,
 2345       hashcat_status->digests_percent,
 2346       hashcat_status->digests_done_new,
 2347       hashcat_status->digests_cnt,
 2348       hashcat_status->digests_percent_new,
 2349       hashcat_status->salts_done,
 2350       hashcat_status->salts_cnt,
 2351       hashcat_status->salts_percent);
 2352   }
 2353   else
 2354   {
 2355     event_log_info (hashcat_ctx,
 2356       "Recovered........: %u/%u (%.2f%%) Digests (total), %u/%u (%.2f%%) Digests (new)",
 2357       hashcat_status->digests_done,
 2358       hashcat_status->digests_cnt,
 2359       hashcat_status->digests_percent,
 2360       hashcat_status->digests_done_new,
 2361       hashcat_status->digests_cnt,
 2362       hashcat_status->digests_percent_new);
 2363   }
 2364 
 2365   if (hashcat_status->digests_cnt > 1000)
 2366   {
 2367     const int    digests_remain         = hashcat_status->digests_cnt - hashcat_status->digests_done;
 2368     const double digests_remain_percent = (double) digests_remain / (double) hashcat_status->digests_cnt * 100;
 2369 
 2370     const int    salts_remain           = hashcat_status->salts_cnt - hashcat_status->salts_done;
 2371     const double salts_remain_percent   = (double) salts_remain / (double) hashcat_status->salts_cnt * 100;
 2372 
 2373     if (hashcat_status->salts_cnt > 1)
 2374     {
 2375       event_log_info (hashcat_ctx,
 2376         "Remaining........: %u (%.2f%%) Digests, %u (%.2f%%) Salts",
 2377         digests_remain,
 2378         digests_remain_percent,
 2379         salts_remain,
 2380         salts_remain_percent);
 2381     }
 2382     else
 2383     {
 2384       event_log_info (hashcat_ctx,
 2385         "Remaining........: %u (%.2f%%) Digests",
 2386         digests_remain,
 2387         digests_remain_percent);
 2388     }
 2389   }
 2390 
 2391   if (hashcat_status->digests_cnt > 1000)
 2392   {
 2393     event_log_info (hashcat_ctx,
 2394       "Recovered/Time...: %s",
 2395       hashcat_status->cpt);
 2396   }
 2397 
 2398   switch (hashcat_status->progress_mode)
 2399   {
 2400     case PROGRESS_MODE_KEYSPACE_KNOWN:
 2401 
 2402       event_log_info (hashcat_ctx,
 2403         "Progress.........: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
 2404         hashcat_status->progress_cur_relative_skip,
 2405         hashcat_status->progress_end_relative_skip,
 2406         hashcat_status->progress_finished_percent);
 2407 
 2408       event_log_info (hashcat_ctx,
 2409         "Rejected.........: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
 2410         hashcat_status->progress_rejected,
 2411         hashcat_status->progress_cur_relative_skip,
 2412         hashcat_status->progress_rejected_percent);
 2413 
 2414       break;
 2415 
 2416     case PROGRESS_MODE_KEYSPACE_UNKNOWN:
 2417 
 2418       event_log_info (hashcat_ctx,
 2419         "Progress.........: %" PRIu64,
 2420         hashcat_status->progress_cur_relative_skip);
 2421 
 2422       event_log_info (hashcat_ctx,
 2423         "Rejected.........: %" PRIu64,
 2424         hashcat_status->progress_rejected);
 2425 
 2426       break;
 2427   }
 2428 
 2429   #ifdef WITH_BRAIN
 2430   if (user_options->brain_client == true)
 2431   {
 2432     event_log_info (hashcat_ctx,
 2433       "Brain.Link.All...: RX: %sB, TX: %sB",
 2434       hashcat_status->brain_rx_all,
 2435       hashcat_status->brain_tx_all);
 2436 
 2437     for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2438     {
 2439       const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2440 
 2441       if (device_info->skipped_dev == true) continue;
 2442       if (device_info->skipped_warning_dev == true) continue;
 2443 
 2444       if (device_info->brain_link_status_dev == BRAIN_LINK_STATUS_CONNECTED)
 2445       {
 2446         event_log_info (hashcat_ctx,
 2447           "Brain.Link.#%u....: RX: %sB (%sbps), TX: %sB (%sbps), idle", device_id + 1,
 2448           device_info->brain_link_recv_bytes_dev,
 2449           device_info->brain_link_recv_bytes_sec_dev,
 2450           device_info->brain_link_send_bytes_dev,
 2451           device_info->brain_link_send_bytes_sec_dev);
 2452       }
 2453       else if (device_info->brain_link_status_dev == BRAIN_LINK_STATUS_RECEIVING)
 2454       {
 2455         event_log_info (hashcat_ctx,
 2456           "Brain.Link.#%u....: RX: %sB (%sbps), TX: %sB (%sbps), receiving", device_id + 1,
 2457           device_info->brain_link_recv_bytes_dev,
 2458           device_info->brain_link_recv_bytes_sec_dev,
 2459           device_info->brain_link_send_bytes_dev,
 2460           device_info->brain_link_send_bytes_sec_dev);
 2461       }
 2462       else if (device_info->brain_link_status_dev == BRAIN_LINK_STATUS_SENDING)
 2463       {
 2464         event_log_info (hashcat_ctx,
 2465           "Brain.Link.#%u....: RX: %sB (%sbps), TX: %sB (%sbps), sending", device_id + 1,
 2466           device_info->brain_link_recv_bytes_dev,
 2467           device_info->brain_link_recv_bytes_sec_dev,
 2468           device_info->brain_link_send_bytes_dev,
 2469           device_info->brain_link_send_bytes_sec_dev);
 2470       }
 2471       else
 2472       {
 2473         if ((device_info->brain_link_time_recv_dev > 0) && (device_info->brain_link_time_send_dev > 0))
 2474         {
 2475           event_log_info (hashcat_ctx,
 2476             "Brain.Link.#%u....: RX: %sB (%sbps), TX: %sB (%sbps)", device_id + 1,
 2477             device_info->brain_link_recv_bytes_dev,
 2478             device_info->brain_link_recv_bytes_sec_dev,
 2479             device_info->brain_link_send_bytes_dev,
 2480             device_info->brain_link_send_bytes_sec_dev);
 2481         }
 2482         else
 2483         {
 2484           event_log_info (hashcat_ctx,
 2485             "Brain.Link.#%u....: N/A", device_id + 1);
 2486         }
 2487       }
 2488     }
 2489   }
 2490   #endif
 2491 
 2492   switch (hashcat_status->progress_mode)
 2493   {
 2494     case PROGRESS_MODE_KEYSPACE_KNOWN:
 2495 
 2496       event_log_info (hashcat_ctx,
 2497         "Restore.Point....: %" PRIu64 "/%" PRIu64 " (%.02f%%)",
 2498         hashcat_status->restore_point,
 2499         hashcat_status->restore_total,
 2500         hashcat_status->restore_percent);
 2501 
 2502       break;
 2503 
 2504     case PROGRESS_MODE_KEYSPACE_UNKNOWN:
 2505 
 2506       event_log_info (hashcat_ctx,
 2507         "Restore.Point....: %" PRIu64,
 2508         hashcat_status->restore_point);
 2509 
 2510       break;
 2511   }
 2512 
 2513   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2514   {
 2515     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2516 
 2517     if (device_info->skipped_dev == true) continue;
 2518     if (device_info->skipped_warning_dev == true) continue;
 2519 
 2520     event_log_info (hashcat_ctx,
 2521       "Restore.Sub.#%u...: Salt:%u Amplifier:%u-%u Iteration:%u-%u", device_id + 1,
 2522       device_info->salt_pos_dev,
 2523       device_info->innerloop_pos_dev,
 2524       device_info->innerloop_pos_dev + device_info->innerloop_left_dev,
 2525       device_info->iteration_pos_dev,
 2526       device_info->iteration_pos_dev + device_info->iteration_left_dev);
 2527   }
 2528 
 2529   //if (hashconfig->opts_type & OPTS_TYPE_SLOW_CANDIDATES)
 2530   if (user_options->slow_candidates == true)
 2531   {
 2532     event_log_info (hashcat_ctx, "Candidate.Engine.: Host Generator + PCIe");
 2533   }
 2534   else
 2535   {
 2536     event_log_info (hashcat_ctx, "Candidate.Engine.: Device Generator");
 2537   }
 2538 
 2539   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2540   {
 2541     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2542 
 2543     if (device_info->skipped_dev == true) continue;
 2544     if (device_info->skipped_warning_dev == true) continue;
 2545 
 2546     if (device_info->guess_candidates_dev == NULL) continue;
 2547 
 2548     event_log_info (hashcat_ctx,
 2549       "Candidates.#%u....: %s", device_id + 1,
 2550       device_info->guess_candidates_dev);
 2551   }
 2552 
 2553   if (hwmon_ctx->enabled == true)
 2554   {
 2555     #if defined(__APPLE__)
 2556     bool first_dev = true;
 2557     #endif
 2558 
 2559     for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2560     {
 2561       const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2562 
 2563       if (device_info->skipped_dev == true) continue;
 2564       if (device_info->skipped_warning_dev == true) continue;
 2565 
 2566       if (device_info->hwmon_dev == NULL) continue;
 2567 
 2568       #if defined(__APPLE__)
 2569       if (first_dev && strlen (device_info->hwmon_fan_dev) > 0)
 2570       {
 2571         event_log_info (hashcat_ctx, "Hardware.Mon.SMC.: %s", device_info->hwmon_fan_dev);
 2572         first_dev = false;
 2573       }
 2574       #endif
 2575 
 2576       event_log_info (hashcat_ctx,
 2577         "Hardware.Mon.#%u..: %s", device_id + 1,
 2578         device_info->hwmon_dev);
 2579     }
 2580   }
 2581 
 2582   status_status_destroy (hashcat_ctx, hashcat_status);
 2583 
 2584   hcfree (hashcat_status);
 2585 }
 2586 
 2587 void status_benchmark_machine_readable (hashcat_ctx_t *hashcat_ctx)
 2588 {
 2589   hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
 2590 
 2591   const u32 hash_mode = hashconfig->hash_mode;
 2592 
 2593   hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
 2594 
 2595   if (hashcat_get_status (hashcat_ctx, hashcat_status) == -1)
 2596   {
 2597     hcfree (hashcat_status);
 2598 
 2599     return;
 2600   }
 2601 
 2602   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2603   {
 2604     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2605 
 2606     if (device_info->skipped_dev == true) continue;
 2607     if (device_info->skipped_warning_dev == true) continue;
 2608 
 2609     event_log_info (hashcat_ctx, "%u:%u:%u:%u:%.2f:%" PRIu64, device_id + 1, hash_mode, device_info->corespeed_dev, device_info->memoryspeed_dev, device_info->exec_msec_dev, (u64) (device_info->hashes_msec_dev_benchmark * 1000));
 2610   }
 2611 
 2612   status_status_destroy (hashcat_ctx, hashcat_status);
 2613 
 2614   hcfree (hashcat_status);
 2615 }
 2616 
 2617 void status_benchmark (hashcat_ctx_t *hashcat_ctx)
 2618 {
 2619   const user_options_t *user_options = hashcat_ctx->user_options;
 2620 
 2621   if (user_options->machine_readable == true)
 2622   {
 2623     status_benchmark_machine_readable (hashcat_ctx);
 2624 
 2625     return;
 2626   }
 2627 
 2628   hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
 2629 
 2630   if (hashcat_get_status (hashcat_ctx, hashcat_status) == -1)
 2631   {
 2632     hcfree (hashcat_status);
 2633 
 2634     return;
 2635   }
 2636 
 2637   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2638   {
 2639     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2640 
 2641     if (device_info->skipped_dev == true) continue;
 2642     if (device_info->skipped_warning_dev == true) continue;
 2643 
 2644     event_log_info (hashcat_ctx,
 2645       "Speed.#%u.........: %9sH/s (%0.2fms) @ Accel:%u Loops:%u Thr:%u Vec:%u", device_id + 1,
 2646       device_info->speed_sec_dev,
 2647       device_info->exec_msec_dev,
 2648       device_info->kernel_accel_dev,
 2649       device_info->kernel_loops_dev,
 2650       device_info->kernel_threads_dev,
 2651       device_info->vector_width_dev);
 2652   }
 2653 
 2654   if (hashcat_status->device_info_active > 1)
 2655   {
 2656     event_log_info (hashcat_ctx,
 2657       "Speed.#*.........: %9sH/s",
 2658       hashcat_status->speed_sec_all);
 2659   }
 2660 
 2661   status_status_destroy (hashcat_ctx, hashcat_status);
 2662 
 2663   hcfree (hashcat_status);
 2664 }
 2665 
 2666 void status_speed_machine_readable (hashcat_ctx_t *hashcat_ctx)
 2667 {
 2668   hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
 2669 
 2670   if (hashcat_get_status (hashcat_ctx, hashcat_status) == -1)
 2671   {
 2672     hcfree (hashcat_status);
 2673 
 2674     return;
 2675   }
 2676 
 2677   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2678   {
 2679     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2680 
 2681     if (device_info->skipped_dev == true) continue;
 2682     if (device_info->skipped_warning_dev == true) continue;
 2683 
 2684     event_log_info (hashcat_ctx, "%d:%" PRIu64, device_id + 1, (u64) (device_info->hashes_msec_dev_benchmark * 1000));
 2685   }
 2686 
 2687   status_status_destroy (hashcat_ctx, hashcat_status);
 2688 
 2689   hcfree (hashcat_status);
 2690 }
 2691 
 2692 void status_speed_json (hashcat_ctx_t *hashcat_ctx)
 2693 {
 2694   hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
 2695 
 2696   if (hashcat_get_status (hashcat_ctx, hashcat_status) == -1)
 2697   {
 2698     hcfree (hashcat_status);
 2699 
 2700     return;
 2701   }
 2702 
 2703   printf ("{ \"devices\": [");
 2704 
 2705   int device_num = 0;
 2706 
 2707   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2708   {
 2709     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2710 
 2711     if (device_info->skipped_dev == true) continue;
 2712     if (device_info->skipped_warning_dev == true) continue;
 2713 
 2714     if (device_num != 0)
 2715     {
 2716       printf (",");
 2717     }
 2718 
 2719     printf (" { \"device_id\": %u,", device_id + 1);
 2720     printf (" \"speed\": %" PRIu64 " }", (u64) (device_info->hashes_msec_dev_benchmark * 1000));
 2721     device_num++;
 2722   }
 2723 
 2724   printf (" ] }");
 2725 
 2726   status_status_destroy (hashcat_ctx, hashcat_status);
 2727 
 2728   hcfree (hashcat_status);
 2729 }
 2730 
 2731 void status_speed (hashcat_ctx_t *hashcat_ctx)
 2732 {
 2733   const user_options_t *user_options = hashcat_ctx->user_options;
 2734 
 2735   if (user_options->machine_readable == true)
 2736   {
 2737     status_speed_machine_readable (hashcat_ctx);
 2738 
 2739     return;
 2740   }
 2741 
 2742   if (user_options->status_json == true)
 2743   {
 2744     status_speed_json (hashcat_ctx);
 2745 
 2746     return;
 2747   }
 2748 
 2749   hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
 2750 
 2751   if (hashcat_get_status (hashcat_ctx, hashcat_status) == -1)
 2752   {
 2753     hcfree (hashcat_status);
 2754 
 2755     return;
 2756   }
 2757 
 2758   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2759   {
 2760     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2761 
 2762     if (device_info->skipped_dev == true) continue;
 2763     if (device_info->skipped_warning_dev == true) continue;
 2764 
 2765     event_log_info (hashcat_ctx,
 2766       "Speed.#%u.........: %9sH/s (%0.2fms)", device_id + 1,
 2767       device_info->speed_sec_dev,
 2768       device_info->exec_msec_dev);
 2769   }
 2770 
 2771   if (hashcat_status->device_info_active > 1)
 2772   {
 2773     event_log_info (hashcat_ctx,
 2774       "Speed.#*.........: %9sH/s",
 2775       hashcat_status->speed_sec_all);
 2776   }
 2777 
 2778   status_status_destroy (hashcat_ctx, hashcat_status);
 2779 
 2780   hcfree (hashcat_status);
 2781 }
 2782 
 2783 void status_progress_machine_readable (hashcat_ctx_t *hashcat_ctx)
 2784 {
 2785   hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
 2786 
 2787   if (hashcat_get_status (hashcat_ctx, hashcat_status) == -1)
 2788   {
 2789     hcfree (hashcat_status);
 2790 
 2791     return;
 2792   }
 2793 
 2794   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2795   {
 2796     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2797 
 2798     if (device_info->skipped_dev == true) continue;
 2799     if (device_info->skipped_warning_dev == true) continue;
 2800 
 2801     event_log_info (hashcat_ctx, "%u:%" PRIu64 ":%0.2f", device_id + 1, device_info->progress_dev, device_info->runtime_msec_dev);
 2802   }
 2803 
 2804   status_status_destroy (hashcat_ctx, hashcat_status);
 2805 
 2806   hcfree (hashcat_status);
 2807 }
 2808 
 2809 void status_progress_json (hashcat_ctx_t *hashcat_ctx)
 2810 {
 2811   hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
 2812 
 2813   if (hashcat_get_status (hashcat_ctx, hashcat_status) == -1)
 2814   {
 2815     hcfree (hashcat_status);
 2816 
 2817     return;
 2818   }
 2819 
 2820   printf ("{ \"devices\": [");
 2821 
 2822   int device_num = 0;
 2823 
 2824   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2825   {
 2826     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2827 
 2828     if (device_info->skipped_dev == true) continue;
 2829     if (device_info->skipped_warning_dev == true) continue;
 2830 
 2831     if (device_num != 0)
 2832     {
 2833       printf (",");
 2834     }
 2835 
 2836     printf (" { \"device_id\": %u,", device_id + 1);
 2837     printf (" \"progress\": %" PRIu64 ",", device_info->progress_dev);
 2838     printf (" \"runtime\": %0.2f }", device_info->runtime_msec_dev);
 2839     device_num++;
 2840   }
 2841 
 2842   printf (" ] }");
 2843 
 2844   status_status_destroy (hashcat_ctx, hashcat_status);
 2845 
 2846   hcfree (hashcat_status);
 2847 }
 2848 
 2849 void status_progress (hashcat_ctx_t *hashcat_ctx)
 2850 {
 2851   const user_options_t *user_options = hashcat_ctx->user_options;
 2852 
 2853   if (user_options->machine_readable == true)
 2854   {
 2855     status_progress_machine_readable (hashcat_ctx);
 2856 
 2857     return;
 2858   }
 2859 
 2860   if (user_options->status_json == true)
 2861   {
 2862     status_progress_json (hashcat_ctx);
 2863 
 2864     return;
 2865   }
 2866 
 2867   hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
 2868 
 2869   if (hashcat_get_status (hashcat_ctx, hashcat_status) == -1)
 2870   {
 2871     hcfree (hashcat_status);
 2872 
 2873     return;
 2874   }
 2875 
 2876   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2877   {
 2878     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2879 
 2880     if (device_info->skipped_dev == true) continue;
 2881     if (device_info->skipped_warning_dev == true) continue;
 2882 
 2883     event_log_info (hashcat_ctx,
 2884       "Progress.#%u......: %" PRIu64, device_id + 1,
 2885       device_info->progress_dev);
 2886   }
 2887 
 2888   for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
 2889   {
 2890     const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
 2891 
 2892     if (device_info->skipped_dev == true) continue;
 2893     if (device_info->skipped_warning_dev == true) continue;
 2894 
 2895     event_log_info (hashcat_ctx,
 2896       "Runtime.#%u.......: %0.2fms", device_id + 1,
 2897       device_info->runtime_msec_dev);
 2898   }
 2899 
 2900   status_status_destroy (hashcat_ctx, hashcat_status);
 2901 
 2902   hcfree (hashcat_status);
 2903 }