1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-06-26 18:02:39 +00:00

Fix formatting

This commit is contained in:
Chick3nman 2019-04-02 16:06:18 -05:00
parent 64f0931301
commit 5e307603d6

View File

@ -922,15 +922,15 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx)
end = time_now + sec_etc; end = time_now + sec_etc;
} }
printf ("\{ \"session\": \"%s\",", hashcat_status->session); printf ("{ \"session\": \"%s\",", hashcat_status->session);
printf (" \"status\": %d,", hashcat_status->status_number); printf (" \"status\": %d,", hashcat_status->status_number);
printf (" \"target\": \"%s\",", hashcat_status->hash_target); printf (" \"target\": \"%s\",", hashcat_status->hash_target);
printf (" \"progress\": \[%" PRIu64 ", %" PRIu64 "\],", hashcat_status->progress_cur_relative_skip, hashcat_status->progress_end_relative_skip); printf (" \"progress\": [%" PRIu64 ", %" PRIu64 "\],", hashcat_status->progress_cur_relative_skip, hashcat_status->progress_end_relative_skip);
printf (" \"restore_point\": %" PRIu64 ",", hashcat_status->restore_point); printf (" \"restore_point\": %" PRIu64 ",", hashcat_status->restore_point);
printf (" \"recovered_hashes\": \[%d, %d\],", hashcat_status->digests_done, hashcat_status->digests_cnt); printf (" \"recovered_hashes\": [%d, %d],", hashcat_status->digests_done, hashcat_status->digests_cnt);
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\": [");
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;
@ -942,7 +942,7 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx)
{ {
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 * 1000)); printf (" \"speed\": %" PRIu64 ",", (u64) (device_info->hashes_msec_dev * 1000));
if (hwmon_ctx->enabled == true) if (hwmon_ctx->enabled == true)
@ -956,9 +956,9 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx)
printf (" \"util\": %d \}", util); printf (" \"util\": %d \}", util);
} }
printf (" \]"); printf (" \],");
printf (" \"time_start\": %" PRIu64 ",", status_ctx->runtime_start); printf (" \"time_start\": %" PRIu64 ",", status_ctx->runtime_start);
printf (" \"estimated_stop\": %" PRIu64 " \}", end); printf (" \"estimated_stop\": %" PRIu64 " }", end);
hc_fwrite (EOL, strlen (EOL), 1, stdout); hc_fwrite (EOL, strlen (EOL), 1, stdout);
@ -1666,7 +1666,7 @@ void status_speed_json (hashcat_ctx_t *hashcat_ctx)
return; return;
} }
printf ("\{ \"devices\": ["); printf ("{ \"devices\": [");
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++)
{ {
@ -1681,11 +1681,11 @@ void status_speed_json (hashcat_ctx_t *hashcat_ctx)
printf(","); printf(",");
} }
printf (" \{ \"device\": %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));
} }
printf(" \] \}"); printf(" ] }");
status_status_destroy (hashcat_ctx, hashcat_status); status_status_destroy (hashcat_ctx, hashcat_status);
@ -1789,7 +1789,7 @@ void status_progress_json (hashcat_ctx_t *hashcat_ctx)
return; return;
} }
printf ("\{ \"devices\": ["); printf ("{ \"devices\": [");
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++)
{ {
@ -1804,12 +1804,12 @@ void status_progress_json (hashcat_ctx_t *hashcat_ctx)
printf(","); printf(",");
} }
printf (" \{ \"device\": %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);
} }
printf(" \] \}"); printf(" ] }");
status_status_destroy (hashcat_ctx, hashcat_status); status_status_destroy (hashcat_ctx, hashcat_status);