Fix status screen current password query
This commit is contained in:
+75
-2
@@ -1922,6 +1922,59 @@ int hc_cuCtxSetCacheConfig (hashcat_ctx_t *hashcat_ctx, CUfunc_cache config)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hc_cuCtxPushCurrent (hashcat_ctx_t *hashcat_ctx, CUcontext ctx)
|
||||
{
|
||||
backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx;
|
||||
|
||||
CUDA_PTR *cuda = backend_ctx->cuda;
|
||||
|
||||
const CUresult CU_err = cuda->cuCtxPushCurrent (ctx);
|
||||
|
||||
if (CU_err != CUDA_SUCCESS)
|
||||
{
|
||||
const char *pStr = NULL;
|
||||
|
||||
if (cuda->cuGetErrorString (CU_err, &pStr) == CUDA_SUCCESS)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "cuCtxPushCurrent(): %s", pStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
event_log_error (hashcat_ctx, "cuCtxPushCurrent(): %d", CU_err);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int hc_cuCtxPopCurrent (hashcat_ctx_t *hashcat_ctx, CUcontext *pctx)
|
||||
{
|
||||
backend_ctx_t *backend_ctx = hashcat_ctx->backend_ctx;
|
||||
|
||||
CUDA_PTR *cuda = backend_ctx->cuda;
|
||||
|
||||
const CUresult CU_err = cuda->cuCtxPopCurrent (pctx);
|
||||
|
||||
if (CU_err != CUDA_SUCCESS)
|
||||
{
|
||||
const char *pStr = NULL;
|
||||
|
||||
if (cuda->cuGetErrorString (CU_err, &pStr) == CUDA_SUCCESS)
|
||||
{
|
||||
event_log_error (hashcat_ctx, "cuCtxPopCurrent(): %s", pStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
event_log_error (hashcat_ctx, "cuCtxPopCurrent(): %d", CU_err);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// OpenCL
|
||||
@@ -2607,7 +2660,17 @@ int gidd_to_pw_t (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, c
|
||||
|
||||
if (device_param->is_cuda == true)
|
||||
{
|
||||
const int CU_rc = hc_cuMemcpyDtoH (hashcat_ctx, &pw_idx, device_param->cuda_d_pws_idx + (gidd * sizeof (pw_idx_t)), sizeof (pw_idx_t));
|
||||
int CU_rc;
|
||||
|
||||
CU_rc = hc_cuCtxPushCurrent (hashcat_ctx, device_param->cuda_context);
|
||||
|
||||
if (CU_rc == -1) return -1;
|
||||
|
||||
CU_rc = hc_cuMemcpyDtoH (hashcat_ctx, &pw_idx, device_param->cuda_d_pws_idx + (gidd * sizeof (pw_idx_t)), sizeof (pw_idx_t));
|
||||
|
||||
if (CU_rc == -1) return -1;
|
||||
|
||||
CU_rc = hc_cuCtxPopCurrent (hashcat_ctx, &device_param->cuda_context);
|
||||
|
||||
if (CU_rc == -1) return -1;
|
||||
}
|
||||
@@ -2627,7 +2690,17 @@ int gidd_to_pw_t (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, c
|
||||
{
|
||||
if (cnt > 0)
|
||||
{
|
||||
const int CU_rc = hc_cuMemcpyDtoH (hashcat_ctx,pw->i, device_param->cuda_d_pws_comp_buf + (off * sizeof (u32)), cnt * sizeof (u32));
|
||||
int CU_rc;
|
||||
|
||||
CU_rc = hc_cuCtxPushCurrent (hashcat_ctx, device_param->cuda_context);
|
||||
|
||||
if (CU_rc == -1) return -1;
|
||||
|
||||
CU_rc = hc_cuMemcpyDtoH (hashcat_ctx,pw->i, device_param->cuda_d_pws_comp_buf + (off * sizeof (u32)), cnt * sizeof (u32));
|
||||
|
||||
if (CU_rc == -1) return -1;
|
||||
|
||||
CU_rc = hc_cuCtxPopCurrent (hashcat_ctx, &device_param->cuda_context);
|
||||
|
||||
if (CU_rc == -1) return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user