@ -202,30 +202,30 @@ int status_get_device_info_cnt (const hashcat_ctx_t *hashcat_ctx)
{
const backend_ctx_t * backend_ctx = hashcat_ctx - > backend_ctx ;
return backend_ctx - > devices_cnt;
return backend_ctx - > backend_ devices_cnt;
}
int status_get_device_info_active ( const hashcat_ctx_t * hashcat_ctx )
{
const backend_ctx_t * backend_ctx = hashcat_ctx - > backend_ctx ;
return backend_ctx - > devices_active;
return backend_ctx - > backend_ devices_active;
}
bool status_get_skipped_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
bool status_get_skipped_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
return device_param - > skipped ;
}
bool status_get_skipped_warning_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
bool status_get_skipped_warning_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
return device_param - > skipped_warning ;
}
@ -833,7 +833,7 @@ int status_get_guess_mask_length (const hashcat_ctx_t *hashcat_ctx)
return mp_get_length ( mask_ctx - > mask ) ;
}
char * status_get_guess_candidates_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
char * status_get_guess_candidates_dev ( const hashcat_ctx_t * hashcat_ctx , const int backend_ devices _idx )
{
const hashconfig_t * hashconfig = hashcat_ctx - > hashconfig ;
const backend_ctx_t * backend_ctx = hashcat_ctx - > backend_ctx ;
@ -842,7 +842,7 @@ char *status_get_guess_candidates_dev (const hashcat_ctx_t *hashcat_ctx, const i
if ( status_ctx - > accessible = = false ) return NULL ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
char * display = ( char * ) hcmalloc ( HCBUFSIZ_TINY ) ;
@ -1414,22 +1414,22 @@ double status_get_hashes_msec_all (const hashcat_ctx_t *hashcat_ctx)
double hashes_all_msec = 0 ;
for ( u32 device_id = 0 ; device_id < backend_ctx - > devices_cnt; device_id+ + )
for ( int backend_devices_idx = 0 ; backend_devices_idx < backend_ctx - > backend_ devices_cnt; backend_ devices _idx + + )
{
hashes_all_msec + = status_get_hashes_msec_dev ( hashcat_ctx , device_id) ;
hashes_all_msec + = status_get_hashes_msec_dev ( hashcat_ctx , backend_ devices _idx ) ;
}
return hashes_all_msec ;
}
double status_get_hashes_msec_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
double status_get_hashes_msec_dev ( const hashcat_ctx_t * hashcat_ctx , const int backend_ devices _idx )
{
const backend_ctx_t * backend_ctx = hashcat_ctx - > backend_ctx ;
u64 speed_cnt = 0 ;
double speed_msec = 0 ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
if ( ( device_param - > skipped = = false ) & & ( device_param - > skipped_warning = = false ) )
{
@ -1455,7 +1455,7 @@ double status_get_hashes_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int d
return hashes_dev_msec ;
}
double status_get_hashes_msec_dev_benchmark ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
double status_get_hashes_msec_dev_benchmark ( const hashcat_ctx_t * hashcat_ctx , const int backend_ devices _idx )
{
// this function increases accuracy for benchmark modes
@ -1464,7 +1464,7 @@ double status_get_hashes_msec_dev_benchmark (const hashcat_ctx_t *hashcat_ctx, c
u64 speed_cnt = 0 ;
double speed_msec = 0 ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
if ( ( device_param - > skipped = = false ) & & ( device_param - > skipped_warning = = false ) )
{
@ -1490,19 +1490,19 @@ double status_get_exec_msec_all (const hashcat_ctx_t *hashcat_ctx)
double exec_all_msec = 0 ;
for ( u32 device_id = 0 ; device_id < backend_ctx - > devices_cnt; device_id+ + )
for ( int backend_devices_idx = 0 ; backend_devices_idx < backend_ctx - > backend_ devices_cnt; backend_ devices _idx + + )
{
exec_all_msec + = status_get_exec_msec_dev ( hashcat_ctx , device_id) ;
exec_all_msec + = status_get_exec_msec_dev ( hashcat_ctx , backend_ devices _idx ) ;
}
return exec_all_msec ;
}
double status_get_exec_msec_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
double status_get_exec_msec_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
double exec_dev_msec = 0 ;
@ -1525,9 +1525,9 @@ char *status_get_speed_sec_all (const hashcat_ctx_t *hashcat_ctx)
return display ;
}
char * status_get_speed_sec_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
char * status_get_speed_sec_dev ( const hashcat_ctx_t * hashcat_ctx , const int backend_ devices _idx )
{
const double hashes_msec_dev = status_get_hashes_msec_dev ( hashcat_ctx , device_id) ;
const double hashes_msec_dev = status_get_hashes_msec_dev ( hashcat_ctx , backend_ devices _idx ) ;
char * display = ( char * ) hcmalloc ( HCBUFSIZ_TINY ) ;
@ -1698,11 +1698,11 @@ char *status_get_cpt (const hashcat_ctx_t *hashcat_ctx)
return cpt ;
}
int status_get_salt_pos_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_salt_pos_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
int salt_pos = 0 ;
@ -1714,11 +1714,11 @@ int status_get_salt_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int device_
return salt_pos ;
}
int status_get_innerloop_pos_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_innerloop_pos_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
int innerloop_pos = 0 ;
@ -1730,11 +1730,11 @@ int status_get_innerloop_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int de
return innerloop_pos ;
}
int status_get_innerloop_left_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_innerloop_left_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
int innerloop_left = 0 ;
@ -1746,11 +1746,11 @@ int status_get_innerloop_left_dev (const hashcat_ctx_t *hashcat_ctx, const int d
return innerloop_left ;
}
int status_get_iteration_pos_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_iteration_pos_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
int iteration_pos = 0 ;
@ -1762,11 +1762,11 @@ int status_get_iteration_pos_dev (const hashcat_ctx_t *hashcat_ctx, const int de
return iteration_pos ;
}
int status_get_iteration_left_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_iteration_left_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
int iteration_left = 0 ;
@ -1779,11 +1779,11 @@ int status_get_iteration_left_dev (const hashcat_ctx_t *hashcat_ctx, const int d
}
# ifdef WITH_BRAIN
int status_get_brain_link_client_id_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_brain_link_client_id_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
int brain_client_id = - 1 ;
@ -1795,11 +1795,11 @@ int status_get_brain_link_client_id_dev (const hashcat_ctx_t *hashcat_ctx, const
return brain_client_id ;
}
int status_get_brain_link_status_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_brain_link_status_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
int brain_link_status_dev = 0 ;
@ -1813,11 +1813,11 @@ int status_get_brain_link_status_dev (const hashcat_ctx_t *hashcat_ctx, const in
return brain_link_status_dev ;
}
char * status_get_brain_link_recv_bytes_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
char * status_get_brain_link_recv_bytes_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
u64 brain_link_recv_bytes = 0 ;
@ -1833,11 +1833,11 @@ char *status_get_brain_link_recv_bytes_dev (const hashcat_ctx_t *hashcat_ctx, co
return display ;
}
char * status_get_brain_link_send_bytes_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
char * status_get_brain_link_send_bytes_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
u64 brain_link_send_bytes = 0 ;
@ -1853,11 +1853,11 @@ char *status_get_brain_link_send_bytes_dev (const hashcat_ctx_t *hashcat_ctx, co
return display ;
}
char * status_get_brain_link_recv_bytes_sec_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
char * status_get_brain_link_recv_bytes_sec_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
u64 brain_link_recv_bytes = 0 ;
@ -1880,11 +1880,11 @@ char *status_get_brain_link_recv_bytes_sec_dev (const hashcat_ctx_t *hashcat_ctx
return display ;
}
char * status_get_brain_link_send_bytes_sec_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
char * status_get_brain_link_send_bytes_sec_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
u64 brain_link_send_bytes = 0 ;
@ -1908,11 +1908,11 @@ char *status_get_brain_link_send_bytes_sec_dev (const hashcat_ctx_t *hashcat_ctx
}
# endif
char * status_get_hwmon_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
char * status_get_hwmon_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
char * output_buf = ( char * ) hcmalloc ( HCBUFSIZ_TINY ) ;
@ -1926,12 +1926,12 @@ char *status_get_hwmon_dev (const hashcat_ctx_t *hashcat_ctx, const int device_i
hc_thread_mutex_lock ( status_ctx - > mux_hwmon ) ;
const int num_temperature = hm_get_temperature_with_device _id ( ( hashcat_ctx_t * ) hashcat_ctx , device_id) ;
const int num_fanspeed = hm_get_fanspeed_with_device _id ( ( hashcat_ctx_t * ) hashcat_ctx , device_id) ;
const int num_utilization = hm_get_utilization_with_device _id ( ( hashcat_ctx_t * ) hashcat_ctx , device_id) ;
const int num_corespeed = hm_get_corespeed_with_device _id ( ( hashcat_ctx_t * ) hashcat_ctx , device_id) ;
const int num_memoryspeed = hm_get_memoryspeed_with_device _id ( ( hashcat_ctx_t * ) hashcat_ctx , device_id) ;
const int num_buslanes = hm_get_buslanes_with_device _id ( ( hashcat_ctx_t * ) hashcat_ctx , device_id) ;
const int num_temperature = hm_get_temperature_with_device s _idx ( ( hashcat_ctx_t * ) hashcat_ctx , backend_ devices _idx ) ;
const int num_fanspeed = hm_get_fanspeed_with_device s _idx ( ( hashcat_ctx_t * ) hashcat_ctx , backend_ devices _idx ) ;
const int num_utilization = hm_get_utilization_with_device s _idx ( ( hashcat_ctx_t * ) hashcat_ctx , backend_ devices _idx ) ;
const int num_corespeed = hm_get_corespeed_with_device s _idx ( ( hashcat_ctx_t * ) hashcat_ctx , backend_ devices _idx ) ;
const int num_memoryspeed = hm_get_memoryspeed_with_device s _idx ( ( hashcat_ctx_t * ) hashcat_ctx , backend_ devices _idx ) ;
const int num_buslanes = hm_get_buslanes_with_device s _idx ( ( hashcat_ctx_t * ) hashcat_ctx , backend_ devices _idx ) ;
int output_len = 0 ;
@ -1981,11 +1981,11 @@ char *status_get_hwmon_dev (const hashcat_ctx_t *hashcat_ctx, const int device_i
return output_buf ;
}
int status_get_corespeed_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_corespeed_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
if ( device_param - > skipped = = true ) return - 1 ;
@ -1995,18 +1995,18 @@ int status_get_corespeed_dev (const hashcat_ctx_t *hashcat_ctx, const int device
hc_thread_mutex_lock ( status_ctx - > mux_hwmon ) ;
const int num_corespeed = hm_get_corespeed_with_device _id ( ( hashcat_ctx_t * ) hashcat_ctx , device_id) ;
const int num_corespeed = hm_get_corespeed_with_device s _idx ( ( hashcat_ctx_t * ) hashcat_ctx , backend_ devices _idx ) ;
hc_thread_mutex_unlock ( status_ctx - > mux_hwmon ) ;
return num_corespeed ;
}
int status_get_memoryspeed_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_memoryspeed_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
if ( device_param - > skipped = = true ) return - 1 ;
@ -2016,18 +2016,18 @@ int status_get_memoryspeed_dev (const hashcat_ctx_t *hashcat_ctx, const int devi
hc_thread_mutex_lock ( status_ctx - > mux_hwmon ) ;
const int num_memoryspeed = hm_get_memoryspeed_with_device _id ( ( hashcat_ctx_t * ) hashcat_ctx , device_id) ;
const int num_memoryspeed = hm_get_memoryspeed_with_device s _idx ( ( hashcat_ctx_t * ) hashcat_ctx , backend_ devices _idx ) ;
hc_thread_mutex_unlock ( status_ctx - > mux_hwmon ) ;
return num_memoryspeed ;
}
u64 status_get_progress_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
u64 status_get_progress_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
if ( device_param - > skipped = = true ) return 0 ;
@ -2036,11 +2036,11 @@ u64 status_get_progress_dev (const hashcat_ctx_t *hashcat_ctx, const int device_
return device_param - > outerloop_left ;
}
double status_get_runtime_msec_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
double status_get_runtime_msec_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
if ( device_param - > skipped = = true ) return 0 ;
@ -2049,11 +2049,11 @@ double status_get_runtime_msec_dev (const hashcat_ctx_t *hashcat_ctx, const int
return device_param - > outerloop_msec ;
}
int status_get_kernel_accel_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_kernel_accel_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
if ( device_param - > skipped = = true ) return 0 ;
@ -2064,11 +2064,11 @@ int status_get_kernel_accel_dev (const hashcat_ctx_t *hashcat_ctx, const int dev
return device_param - > kernel_accel ;
}
int status_get_kernel_loops_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_kernel_loops_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
if ( device_param - > skipped = = true ) return 0 ;
@ -2079,11 +2079,11 @@ int status_get_kernel_loops_dev (const hashcat_ctx_t *hashcat_ctx, const int dev
return device_param - > kernel_loops ;
}
int status_get_kernel_threads_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_kernel_threads_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
if ( device_param - > skipped = = true ) return 0 ;
@ -2092,11 +2092,11 @@ int status_get_kernel_threads_dev (const hashcat_ctx_t *hashcat_ctx, const int d
return device_param - > kernel_threads ;
}
int status_get_vector_width_dev ( const hashcat_ctx_t * hashcat_ctx , const int device_id)
int status_get_vector_width_dev ( 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 [ device_id] ;
hc_device_param_t * device_param = & backend_ctx - > devices_param [ backend_ devices _idx ] ;
if ( device_param - > skipped = = true ) return 0 ;