1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 22:58:30 +00:00

status-json: also print device name

This commit is contained in:
Dávid Bolvanský 2022-03-18 09:42:01 +01:00
parent 881d336a78
commit 100cd5fea4
5 changed files with 13 additions and 0 deletions

View File

@ -87,6 +87,7 @@ int status_get_innerloop_pos_dev (const hashcat_ctx_t *hash
int status_get_innerloop_left_dev (const hashcat_ctx_t *hashcat_ctx, const int backend_devices_idx);
int status_get_iteration_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int backend_devices_idx);
int status_get_iteration_left_dev (const hashcat_ctx_t *hashcat_ctx, const int backend_devices_idx);
char *status_get_device_name (const hashcat_ctx_t *hashcat_ctx, const int backend_devices_idx);
#ifdef WITH_BRAIN
int status_get_brain_session (const hashcat_ctx_t *hashcat_ctx);
int status_get_brain_attack (const hashcat_ctx_t *hashcat_ctx);

View File

@ -2586,6 +2586,7 @@ typedef struct device_info
int innerloop_left_dev;
int iteration_pos_dev;
int iteration_left_dev;
char *device_name;
#ifdef WITH_BRAIN
int brain_link_client_id_dev;
int brain_link_status_dev;

View File

@ -2017,6 +2017,7 @@ int hashcat_get_status (hashcat_ctx_t *hashcat_ctx, hashcat_status_t *hashcat_st
device_info->innerloop_left_dev = status_get_innerloop_left_dev (hashcat_ctx, device_id);
device_info->iteration_pos_dev = status_get_iteration_pos_dev (hashcat_ctx, device_id);
device_info->iteration_left_dev = status_get_iteration_left_dev (hashcat_ctx, device_id);
device_info->device_name = status_get_device_name (hashcat_ctx, device_id);
#ifdef WITH_BRAIN
device_info->brain_link_client_id_dev = status_get_brain_link_client_id_dev (hashcat_ctx, device_id);
device_info->brain_link_status_dev = status_get_brain_link_status_dev (hashcat_ctx, device_id);

View File

@ -1829,6 +1829,15 @@ int status_get_iteration_left_dev (const hashcat_ctx_t *hashcat_ctx, const int b
return iteration_left;
}
char *status_get_device_name (const hashcat_ctx_t *hashcat_ctx, const int backend_devices_idx)
{
const backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx;
hc_device_param_t *device_param = &backend_ctx->devices_param[backend_devices_idx];
return device_param->device_name;
}
#ifdef WITH_BRAIN
int status_get_brain_link_client_id_dev (const hashcat_ctx_t *hashcat_ctx, const int backend_devices_idx)
{

View File

@ -1660,6 +1660,7 @@ void status_display_status_json (hashcat_ctx_t *hashcat_ctx)
}
printf (" { \"device_id\": %d,", device_id + 1);
printf (" { \"device_name\": \"%s\",", device_info->device_name);
printf (" \"speed\": %" PRIu64 ",", (u64) (device_info->hashes_msec_dev * 1000));
if (hwmon_ctx->enabled == true)