mirror of
https://github.com/hashcat/hashcat.git
synced 2025-04-27 04:29:07 +00:00
Change logic for formatting with multiple devices when some are skipped
This commit is contained in:
parent
1cf2a4fea6
commit
fc1aa83541
@ -931,6 +931,9 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx)
|
|||||||
printf (" \"recovered_salts\": [%d, %d],", hashcat_status->salts_done, hashcat_status->salts_cnt);
|
printf (" \"recovered_salts\": [%d, %d],", hashcat_status->salts_done, hashcat_status->salts_cnt);
|
||||||
printf (" \"rejected\": %" PRIu64 ",", hashcat_status->progress_rejected);
|
printf (" \"rejected\": %" PRIu64 ",", hashcat_status->progress_rejected);
|
||||||
printf (" \"devices\": [");
|
printf (" \"devices\": [");
|
||||||
|
|
||||||
|
int device_num = 0;
|
||||||
|
|
||||||
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
||||||
{
|
{
|
||||||
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
||||||
@ -938,7 +941,8 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx)
|
|||||||
if (device_info->skipped_dev == true) continue;
|
if (device_info->skipped_dev == true) continue;
|
||||||
|
|
||||||
if (device_info->skipped_warning_dev == true) continue;
|
if (device_info->skipped_warning_dev == true) continue;
|
||||||
if (device_id != 0)
|
|
||||||
|
if (device_num != 0)
|
||||||
{
|
{
|
||||||
printf(",");
|
printf(",");
|
||||||
}
|
}
|
||||||
@ -955,6 +959,8 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx)
|
|||||||
const int util = hm_get_utilization_with_device_id (hashcat_ctx, device_id);
|
const int util = hm_get_utilization_with_device_id (hashcat_ctx, device_id);
|
||||||
|
|
||||||
printf (" \"util\": %d }", util);
|
printf (" \"util\": %d }", util);
|
||||||
|
|
||||||
|
device_num++;
|
||||||
}
|
}
|
||||||
printf (" ],");
|
printf (" ],");
|
||||||
printf (" \"time_start\": %" PRIu64 ",", status_ctx->runtime_start);
|
printf (" \"time_start\": %" PRIu64 ",", status_ctx->runtime_start);
|
||||||
@ -1668,6 +1674,8 @@ void status_speed_json (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
printf ("{ \"devices\": [");
|
printf ("{ \"devices\": [");
|
||||||
|
|
||||||
|
int device_num = 0;
|
||||||
|
|
||||||
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
||||||
{
|
{
|
||||||
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
||||||
@ -1676,14 +1684,14 @@ void status_speed_json (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
if (device_info->skipped_warning_dev == true) continue;
|
if (device_info->skipped_warning_dev == true) continue;
|
||||||
|
|
||||||
if (device_id != 0)
|
if (device_num != 0)
|
||||||
{
|
{
|
||||||
printf(",");
|
printf(",");
|
||||||
}
|
}
|
||||||
|
|
||||||
printf (" { \"device_id\": %d,", device_id + 1);
|
printf (" { \"device_id\": %d,", device_id + 1);
|
||||||
printf (" \"speed\": %" PRIu64 " }", (u64) (device_info->hashes_msec_dev_benchmark * 1000));
|
printf (" \"speed\": %" PRIu64 " }", (u64) (device_info->hashes_msec_dev_benchmark * 1000));
|
||||||
|
device_num++;
|
||||||
}
|
}
|
||||||
printf(" ] }");
|
printf(" ] }");
|
||||||
|
|
||||||
@ -1791,6 +1799,8 @@ void status_progress_json (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
printf ("{ \"devices\": [");
|
printf ("{ \"devices\": [");
|
||||||
|
|
||||||
|
int device_num = 0;
|
||||||
|
|
||||||
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
|
||||||
{
|
{
|
||||||
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
const device_info_t *device_info = hashcat_status->device_info_buf + device_id;
|
||||||
@ -1799,7 +1809,7 @@ void status_progress_json (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
if (device_info->skipped_warning_dev == true) continue;
|
if (device_info->skipped_warning_dev == true) continue;
|
||||||
|
|
||||||
if (device_id != 0)
|
if (device_num != 0)
|
||||||
{
|
{
|
||||||
printf(",");
|
printf(",");
|
||||||
}
|
}
|
||||||
@ -1807,7 +1817,7 @@ void status_progress_json (hashcat_ctx_t *hashcat_ctx)
|
|||||||
printf (" { \"device_id\": %d,", device_id + 1);
|
printf (" { \"device_id\": %d,", device_id + 1);
|
||||||
printf (" \"progress\": %" PRIu64 ",", device_info->progress_dev);
|
printf (" \"progress\": %" PRIu64 ",", device_info->progress_dev);
|
||||||
printf (" \"runtime\": %0.2f }", device_info->runtime_msec_dev);
|
printf (" \"runtime\": %0.2f }", device_info->runtime_msec_dev);
|
||||||
|
device_num++;
|
||||||
}
|
}
|
||||||
printf(" ] }");
|
printf(" ] }");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user