diff --git a/src/backend.c b/src/backend.c index da24fc7a5..186dd9dfb 100644 --- a/src/backend.c +++ b/src/backend.c @@ -6746,10 +6746,7 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) #if defined (__APPLE__) if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE) { - if (device_param->skipped == false) - { - need_iokit = true; - } + need_iokit = true; } #endif @@ -6778,16 +6775,15 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) #endif } + #if defined (__APPLE__) if (strncmp (device_param->device_name, "Apple M", 7) == 0) { if (device_param->opencl_platform_vendor_id == VENDOR_ID_APPLE) { - if (device_param->skipped == false) - { - need_iokit = true; - } + need_iokit = true; } } + #endif } if (device_param->opencl_device_type & CL_DEVICE_TYPE_CPU) diff --git a/src/ext_iokit.c b/src/ext_iokit.c index a85f7e3e4..e638ba7c7 100644 --- a/src/ext_iokit.c +++ b/src/ext_iokit.c @@ -249,30 +249,37 @@ int hm_IOKIT_get_utilization_current (void *hashcat_ctx, int *utilization) { // Service dictionary creation failed. IOObjectRelease (regEntry); + continue; } - CFMutableDictionaryRef perf_properties = (CFMutableDictionaryRef) CFDictionaryGetValue( serviceDictionary, CFSTR("PerformanceStatistics")); + CFMutableDictionaryRef perf_properties = (CFMutableDictionaryRef) CFDictionaryGetValue (serviceDictionary, CFSTR ("PerformanceStatistics")); + if (perf_properties) { - static ssize_t gpuCoreUtil=0; - const void* gpuCoreUtilization = CFDictionaryGetValue(perf_properties, CFSTR("Device Utilization %")); - if (gpuCoreUtilization) + static ssize_t gpuCoreUtil = 0; + + const void *gpuCoreUtilization = CFDictionaryGetValue (perf_properties, CFSTR ("Device Utilization %")); + + if (gpuCoreUtilization != NULL) { - CFNumberGetValue( gpuCoreUtilization, kCFNumberSInt64Type, &gpuCoreUtil); + CFNumberGetValue (gpuCoreUtilization, kCFNumberSInt64Type, &gpuCoreUtil); + *utilization = gpuCoreUtil; rc = true; } } - CFRelease(serviceDictionary); + CFRelease (serviceDictionary); + IOObjectRelease (regEntry); - IOObjectRelease(iterator); if (rc == true) break; } + IOObjectRelease (iterator); + return rc; }