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

Merge pull request #1673 from RAN1/master

Allow hwmon when temp abort is disabled by refactoring guards when hwmon is not present
This commit is contained in:
Jens Steube 2018-08-30 11:06:26 +02:00 committed by GitHub
commit 4fa970fbf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 13 deletions

View File

@ -2004,15 +2004,20 @@ int hwmon_ctx_init (hashcat_ctx_t *hashcat_ctx)
hwmon_ctx->enabled = false;
#if !defined (WITH_HWMON)
return 0;
#endif // WITH_HWMON
if (user_options->example_hashes == true) return 0;
if (user_options->keyspace == true) return 0;
if (user_options->left == true) return 0;
if (user_options->opencl_info == true) return 0;
if (user_options->progress_only == true) return 0;
if (user_options->show == true) return 0;
if (user_options->speed_only == true) return 0;
if (user_options->stdout_flag == true) return 0;
if (user_options->usage == true) return 0;
if (user_options->version == true) return 0;
if (user_options->gpu_temp_disable == true) return 0;
hwmon_ctx->hm_device = (hm_attrs_t *) hccalloc (DEVICES_MAX, sizeof (hm_attrs_t));

View File

@ -510,7 +510,7 @@ static void main_outerloop_mainscreen (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx,
* Watchdog and Temperature balance
*/
if (hwmon_ctx->enabled == false && user_options->gpu_temp_disable == false)
if (hwmon_ctx->enabled == false)
{
event_log_info (hashcat_ctx, "Watchdog: Hardware monitoring interface not found on your system.");
}

View File

@ -143,7 +143,7 @@ static int monitor (hashcat_ctx_t *hashcat_ctx)
hc_thread_mutex_unlock (status_ctx->mux_hwmon);
}
if (hwmon_check == true)
if (hwmon_check == true && user_options->gpu_temp_disable == false)
{
hc_thread_mutex_lock (status_ctx->mux_hwmon);

View File

@ -780,7 +780,7 @@ void opencl_info_compact (hashcat_ctx_t *hashcat_ctx)
void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx)
{
const user_options_t *user_options = hashcat_ctx->user_options;
const hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx;
hashcat_status_t *hashcat_status = (hashcat_status_t *) hcmalloc (sizeof (hashcat_status_t));
@ -828,7 +828,7 @@ void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx)
printf ("RECSALT\t%d\t%d\t", hashcat_status->salts_done, hashcat_status->salts_cnt);
if (user_options->gpu_temp_disable == false)
if (hwmon_ctx->enabled == true)
{
printf ("TEMP\t");
@ -838,8 +838,6 @@ void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx)
if (device_info->skipped_dev == true) continue;
// ok, little cheat here...
const int temp = hm_get_temperature_with_device_id (hashcat_ctx, device_id);
printf ("%d\t", temp);
@ -875,6 +873,7 @@ void status_display_machine_readable (hashcat_ctx_t *hashcat_ctx)
void status_display (hashcat_ctx_t *hashcat_ctx)
{
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
const hwmon_ctx_t *hwmon_ctx = hashcat_ctx->hwmon_ctx;
const user_options_t *user_options = hashcat_ctx->user_options;
if (user_options->machine_readable == true)
@ -1318,7 +1317,7 @@ void status_display (hashcat_ctx_t *hashcat_ctx)
device_info->guess_candidates_dev);
}
if (user_options->gpu_temp_disable == false)
if (hwmon_ctx->enabled == true)
{
for (int device_id = 0; device_id < hashcat_status->device_info_cnt; device_id++)
{

View File

@ -1211,11 +1211,6 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
{
user_options_t *user_options = hashcat_ctx->user_options;
#if !defined (WITH_HWMON)
user_options->gpu_temp_disable = true;
user_options->gpu_temp_abort = 0;
#endif // WITH_HWMON
// some options can influence or overwrite other options
if (user_options->example_hashes == true
@ -1374,6 +1369,10 @@ void user_options_preprocess (hashcat_ctx_t *hashcat_ctx)
user_options->segment_size *= (1024 * 1024);
}
#if !defined (WITH_HWMON)
user_options->gpu_temp_disable = true;
#endif // WITH_HWMON
if (user_options->gpu_temp_disable == true)
{
user_options->gpu_temp_abort = 0;