X-Git-Url: https://www.flypig.org.uk/git/?a=blobdiff_plain;f=src%2Fhashcat.c;h=0beaa24ed913bc410e7525691402d5ef1b83bbb0;hb=eda36a98776345978b243bf8372629999885148c;hp=caf72ed00ce8af1856d0ae0f6438948902e2746e;hpb=4f0709b3c970a2f29fbbd0fac09736c590f440cc;p=hashcat.git diff --git a/src/hashcat.c b/src/hashcat.c index caf72ed..0beaa24 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -2470,11 +2470,14 @@ static void run_kernel (const uint kern_run, hc_device_param_t *device_param, co if (data.devices_status == STATUS_RUNNING) { - switch (kern_run) + if (iteration < EXPECTED_ITERATIONS) { - case KERN_RUN_1: usleep (device_param->exec_us_prev1[iteration]); break; - case KERN_RUN_2: usleep (device_param->exec_us_prev2[iteration]); break; - case KERN_RUN_3: usleep (device_param->exec_us_prev3[iteration]); break; + switch (kern_run) + { + case KERN_RUN_1: if (device_param->exec_us_prev1[iteration]) usleep (device_param->exec_us_prev1[iteration]); break; + case KERN_RUN_2: if (device_param->exec_us_prev2[iteration]) usleep (device_param->exec_us_prev2[iteration]); break; + case KERN_RUN_3: if (device_param->exec_us_prev3[iteration]) usleep (device_param->exec_us_prev3[iteration]); break; + } } } @@ -2490,11 +2493,14 @@ static void run_kernel (const uint kern_run, hc_device_param_t *device_param, co if (data.devices_status == STATUS_RUNNING) { - switch (kern_run) + if (iteration < EXPECTED_ITERATIONS) { - case KERN_RUN_1: device_param->exec_us_prev1[iteration] = exec_us; break; - case KERN_RUN_2: device_param->exec_us_prev2[iteration] = exec_us; break; - case KERN_RUN_3: device_param->exec_us_prev3[iteration] = exec_us; break; + switch (kern_run) + { + case KERN_RUN_1: device_param->exec_us_prev1[iteration] = exec_us; break; + case KERN_RUN_2: device_param->exec_us_prev2[iteration] = exec_us; break; + case KERN_RUN_3: device_param->exec_us_prev3[iteration] = exec_us; break; + } } } @@ -3243,7 +3249,7 @@ static void run_cracker (hc_device_param_t *device_param, const uint pws_cnt) // innerloops - for (uint innerloop_pos = 0, fast_iteration = 0; innerloop_pos < innerloop_cnt; innerloop_pos += innerloop_step, fast_iteration++) + for (uint innerloop_pos = 0; innerloop_pos < innerloop_cnt; innerloop_pos += innerloop_step) { while (data.devices_status == STATUS_PAUSED) hc_sleep (1); @@ -3254,9 +3260,16 @@ static void run_cracker (hc_device_param_t *device_param, const uint pws_cnt) if (data.devices_status == STATUS_QUIT) break; if (data.devices_status == STATUS_BYPASS) break; + uint fast_iteration = 0; + uint innerloop_left = innerloop_cnt - innerloop_pos; - if (innerloop_left > innerloop_step) innerloop_left = innerloop_step; + if (innerloop_left > innerloop_step) + { + innerloop_left = innerloop_step; + + fast_iteration = 1; + } device_param->innerloop_pos = innerloop_pos; device_param->innerloop_left = innerloop_left;