2016-09-15 02:29:22 +00:00
|
|
|
/**
|
|
|
|
* Author......: See docs/credits.txt
|
|
|
|
* License.....: MIT
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "types.h"
|
|
|
|
#include "memory.h"
|
|
|
|
#include "filehandling.h"
|
|
|
|
#include "interface.h"
|
|
|
|
#include "timer.h"
|
|
|
|
#include "logging.h"
|
|
|
|
#include "ext_OpenCL.h"
|
|
|
|
#include "ext_ADL.h"
|
|
|
|
#include "ext_nvapi.h"
|
|
|
|
#include "ext_nvml.h"
|
|
|
|
#include "ext_xnvctrl.h"
|
2016-09-15 14:02:52 +00:00
|
|
|
#include "tuningdb.h"
|
2016-09-20 11:18:47 +00:00
|
|
|
#include "thread.h"
|
2016-09-15 02:29:22 +00:00
|
|
|
#include "opencl.h"
|
2016-09-15 14:02:52 +00:00
|
|
|
#include "hwmon.h"
|
|
|
|
#include "restore.h"
|
2016-09-16 15:01:18 +00:00
|
|
|
#include "hash_management.h"
|
2016-09-15 02:29:22 +00:00
|
|
|
#include "rp_cpu.h"
|
|
|
|
#include "terminal.h"
|
|
|
|
#include "mpsp.h"
|
|
|
|
#include "outfile.h"
|
|
|
|
#include "potfile.h"
|
|
|
|
#include "debugfile.h"
|
|
|
|
#include "loopback.h"
|
|
|
|
#include "status.h"
|
|
|
|
#include "dictstat.h"
|
|
|
|
#include "wordlist.h"
|
|
|
|
#include "data.h"
|
|
|
|
#include "status.h"
|
|
|
|
#include "shared.h"
|
|
|
|
#include "dispatch.h"
|
|
|
|
|
|
|
|
extern hc_global_data_t data;
|
|
|
|
|
2016-09-22 13:56:32 +00:00
|
|
|
static void set_kernel_power_final (const user_options_t *user_options, const u64 kernel_power_final)
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
2016-09-22 13:56:32 +00:00
|
|
|
if (user_options->quiet == false)
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
|
|
|
clear_prompt ();
|
|
|
|
|
|
|
|
//log_info ("");
|
|
|
|
|
|
|
|
log_info ("INFO: approaching final keyspace, workload adjusted");
|
|
|
|
log_info ("");
|
|
|
|
|
|
|
|
send_prompt ();
|
|
|
|
}
|
|
|
|
|
|
|
|
data.kernel_power_final = kernel_power_final;
|
|
|
|
}
|
|
|
|
|
|
|
|
static u32 get_power (hc_device_param_t *device_param)
|
|
|
|
{
|
|
|
|
const u64 kernel_power_final = data.kernel_power_final;
|
|
|
|
|
|
|
|
if (kernel_power_final)
|
|
|
|
{
|
|
|
|
const double device_factor = (double) device_param->hardware_power / data.hardware_power_all;
|
|
|
|
|
|
|
|
const u64 words_left_device = (u64) CEIL (kernel_power_final * device_factor);
|
|
|
|
|
|
|
|
// work should be at least the hardware power available without any accelerator
|
|
|
|
|
|
|
|
const u64 work = MAX (words_left_device, device_param->hardware_power);
|
|
|
|
|
|
|
|
return work;
|
|
|
|
}
|
|
|
|
|
|
|
|
return device_param->kernel_power;
|
|
|
|
}
|
|
|
|
|
2016-09-22 10:33:33 +00:00
|
|
|
static uint get_work (opencl_ctx_t *opencl_ctx, const user_options_t *user_options, hc_device_param_t *device_param, const u64 max)
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
2016-09-20 11:18:47 +00:00
|
|
|
hc_thread_mutex_lock (opencl_ctx->mux_dispatcher);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
const u64 words_cur = data.words_cur;
|
2016-09-22 10:33:33 +00:00
|
|
|
const u64 words_base = (user_options->limit == 0) ? data.words_base : MIN (user_options->limit, data.words_base);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
device_param->words_off = words_cur;
|
|
|
|
|
|
|
|
const u64 kernel_power_all = data.kernel_power_all;
|
|
|
|
|
|
|
|
const u64 words_left = words_base - words_cur;
|
|
|
|
|
|
|
|
if (words_left < kernel_power_all)
|
|
|
|
{
|
|
|
|
if (data.kernel_power_final == 0)
|
|
|
|
{
|
2016-09-22 13:56:32 +00:00
|
|
|
set_kernel_power_final (user_options, words_left);
|
2016-09-15 02:29:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const u32 kernel_power = get_power (device_param);
|
|
|
|
|
|
|
|
uint work = MIN (words_left, kernel_power);
|
|
|
|
|
|
|
|
work = MIN (work, max);
|
|
|
|
|
|
|
|
data.words_cur += work;
|
|
|
|
|
2016-09-20 11:18:47 +00:00
|
|
|
hc_thread_mutex_unlock (opencl_ctx->mux_dispatcher);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
return work;
|
|
|
|
}
|
|
|
|
|
|
|
|
void *thread_calc_stdin (void *p)
|
|
|
|
{
|
|
|
|
hc_device_param_t *device_param = (hc_device_param_t *) p;
|
|
|
|
|
|
|
|
if (device_param->skipped) return NULL;
|
|
|
|
|
2016-09-22 10:15:13 +00:00
|
|
|
user_options_t *user_options = data.user_options;
|
|
|
|
user_options_extra_t *user_options_extra = data.user_options_extra;
|
|
|
|
hashconfig_t *hashconfig = data.hashconfig;
|
|
|
|
hashes_t *hashes = data.hashes;
|
2016-09-27 16:32:09 +00:00
|
|
|
straight_ctx_t *straight_ctx = data.straight_ctx;
|
|
|
|
combinator_ctx_t *combinator_ctx = data.combinator_ctx;
|
2016-09-25 23:18:00 +00:00
|
|
|
mask_ctx_t *mask_ctx = data.mask_ctx;
|
2016-09-27 16:32:09 +00:00
|
|
|
opencl_ctx_t *opencl_ctx = data.opencl_ctx;
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
char *buf = (char *) mymalloc (HCBUFSIZ_LARGE);
|
|
|
|
|
2016-09-22 13:50:49 +00:00
|
|
|
const uint attack_kern = user_options_extra->attack_kern;
|
2016-09-15 02:29:22 +00:00
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
while (opencl_ctx->run_thread_level1 == true)
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
2016-09-20 11:18:47 +00:00
|
|
|
hc_thread_mutex_lock (opencl_ctx->mux_dispatcher);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
if (feof (stdin) != 0)
|
|
|
|
{
|
2016-09-20 11:18:47 +00:00
|
|
|
hc_thread_mutex_unlock (opencl_ctx->mux_dispatcher);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint words_cur = 0;
|
|
|
|
|
|
|
|
while (words_cur < device_param->kernel_power)
|
|
|
|
{
|
|
|
|
char *line_buf = fgets (buf, HCBUFSIZ_LARGE - 1, stdin);
|
|
|
|
|
|
|
|
if (line_buf == NULL) break;
|
|
|
|
|
|
|
|
uint line_len = in_superchop (line_buf);
|
|
|
|
|
2016-09-22 13:14:55 +00:00
|
|
|
line_len = convert_from_hex (line_buf, line_len, user_options);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
// post-process rule engine
|
|
|
|
|
2016-09-22 10:15:13 +00:00
|
|
|
if (run_rule_engine (user_options_extra->rule_len_l, user_options->rule_buf_l))
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
|
|
|
char rule_buf_out[BLOCK_SIZE] = { 0 };
|
|
|
|
|
|
|
|
int rule_len_out = -1;
|
|
|
|
|
|
|
|
if (line_len < BLOCK_SIZE)
|
|
|
|
{
|
2016-09-22 10:15:13 +00:00
|
|
|
rule_len_out = _old_apply_rule (user_options->rule_buf_l, user_options_extra->rule_len_l, line_buf, line_len, rule_buf_out);
|
2016-09-15 02:29:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (rule_len_out < 0) continue;
|
|
|
|
|
|
|
|
line_buf = rule_buf_out;
|
|
|
|
line_len = rule_len_out;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (line_len > PW_MAX)
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
// hmm that's always the case, or?
|
|
|
|
|
|
|
|
if (attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
{
|
|
|
|
if ((line_len < data.pw_min) || (line_len > data.pw_max))
|
|
|
|
{
|
2016-09-20 11:26:19 +00:00
|
|
|
hc_thread_mutex_lock (opencl_ctx->mux_counter);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
for (uint salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++)
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
2016-09-27 11:13:07 +00:00
|
|
|
data.words_progress_rejected[salt_pos] += straight_ctx->kernel_rules_cnt;
|
2016-09-15 02:29:22 +00:00
|
|
|
}
|
|
|
|
|
2016-09-20 11:26:19 +00:00
|
|
|
hc_thread_mutex_unlock (opencl_ctx->mux_counter);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pw_add (device_param, (u8 *) line_buf, line_len);
|
|
|
|
|
|
|
|
words_cur++;
|
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
while (opencl_ctx->run_thread_level1 == false) break;
|
2016-09-15 02:29:22 +00:00
|
|
|
}
|
|
|
|
|
2016-09-20 11:18:47 +00:00
|
|
|
hc_thread_mutex_unlock (opencl_ctx->mux_dispatcher);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
while (opencl_ctx->run_thread_level1 == false) break;
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
// flush
|
|
|
|
|
|
|
|
const uint pws_cnt = device_param->pws_cnt;
|
|
|
|
|
|
|
|
if (pws_cnt)
|
|
|
|
{
|
2016-09-27 16:32:09 +00:00
|
|
|
run_copy (opencl_ctx, device_param, hashconfig, user_options, user_options_extra, combinator_ctx, pws_cnt);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
2016-09-27 16:32:09 +00:00
|
|
|
run_cracker (opencl_ctx, device_param, hashconfig, hashes, user_options, user_options_extra, straight_ctx, combinator_ctx, mask_ctx, pws_cnt);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
device_param->pws_cnt = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
still required?
|
|
|
|
if (attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
run_kernel_bzero (opencl_ctx, device_param, device_param->d_rules_c, device_param->size_rules_c);
|
2016-09-15 02:29:22 +00:00
|
|
|
}
|
|
|
|
else if (attack_kern == ATTACK_KERN_COMBI)
|
|
|
|
{
|
2016-09-15 14:02:52 +00:00
|
|
|
run_kernel_bzero (opencl_ctx, device_param, device_param->d_combs_c, device_param->size_combs);
|
2016-09-15 02:29:22 +00:00
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
device_param->kernel_accel = 0;
|
|
|
|
device_param->kernel_loops = 0;
|
|
|
|
|
|
|
|
myfree (buf);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
void *thread_calc (void *p)
|
|
|
|
{
|
|
|
|
hc_device_param_t *device_param = (hc_device_param_t *) p;
|
|
|
|
|
|
|
|
if (device_param->skipped) return NULL;
|
|
|
|
|
2016-09-22 10:15:13 +00:00
|
|
|
user_options_t *user_options = data.user_options;
|
|
|
|
user_options_extra_t *user_options_extra = data.user_options_extra;
|
|
|
|
hashconfig_t *hashconfig = data.hashconfig;
|
|
|
|
hashes_t *hashes = data.hashes;
|
2016-09-27 16:32:09 +00:00
|
|
|
straight_ctx_t *straight_ctx = data.straight_ctx;
|
|
|
|
combinator_ctx_t *combinator_ctx = data.combinator_ctx;
|
2016-09-25 23:18:00 +00:00
|
|
|
mask_ctx_t *mask_ctx = data.mask_ctx;
|
2016-09-27 16:32:09 +00:00
|
|
|
opencl_ctx_t *opencl_ctx = data.opencl_ctx;
|
2016-09-15 02:29:22 +00:00
|
|
|
|
2016-09-22 13:41:59 +00:00
|
|
|
const uint attack_mode = user_options->attack_mode;
|
2016-09-22 13:50:49 +00:00
|
|
|
const uint attack_kern = user_options_extra->attack_kern;
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
if (attack_mode == ATTACK_MODE_BF)
|
|
|
|
{
|
2016-09-19 13:52:01 +00:00
|
|
|
while (opencl_ctx->run_thread_level1 == true)
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
2016-09-22 10:33:33 +00:00
|
|
|
const uint work = get_work (opencl_ctx, user_options, device_param, -1u);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
if (work == 0) break;
|
|
|
|
|
|
|
|
const u64 words_off = device_param->words_off;
|
|
|
|
const u64 words_fin = words_off + work;
|
|
|
|
|
|
|
|
const uint pws_cnt = work;
|
|
|
|
|
|
|
|
device_param->pws_cnt = pws_cnt;
|
|
|
|
|
|
|
|
if (pws_cnt)
|
|
|
|
{
|
2016-09-27 16:32:09 +00:00
|
|
|
run_copy (opencl_ctx, device_param, hashconfig, user_options, user_options_extra, combinator_ctx, pws_cnt);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
2016-09-27 16:32:09 +00:00
|
|
|
run_cracker (opencl_ctx, device_param, hashconfig, hashes, user_options, user_options_extra, straight_ctx, combinator_ctx, mask_ctx, pws_cnt);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
device_param->pws_cnt = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
still required?
|
|
|
|
run_kernel_bzero (device_param, device_param->d_bfs_c, device_param->size_bfs);
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
if (opencl_ctx->run_thread_level1 == false) break;
|
2016-09-15 02:29:22 +00:00
|
|
|
|
2016-09-22 13:07:19 +00:00
|
|
|
if (user_options->benchmark == true) break;
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
device_param->words_done = words_fin;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
char *dictfile = data.dictfile;
|
|
|
|
|
|
|
|
if (attack_mode == ATTACK_MODE_COMBI)
|
|
|
|
{
|
2016-09-27 16:32:09 +00:00
|
|
|
if (combinator_ctx->combs_mode == COMBINATOR_MODE_BASE_RIGHT)
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
|
|
|
dictfile = data.dictfile2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
FILE *fd = fopen (dictfile, "rb");
|
|
|
|
|
|
|
|
if (fd == NULL)
|
|
|
|
{
|
|
|
|
log_error ("ERROR: %s: %s", dictfile, strerror (errno));
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (attack_mode == ATTACK_MODE_COMBI)
|
|
|
|
{
|
2016-09-27 16:32:09 +00:00
|
|
|
const uint combs_mode = combinator_ctx->combs_mode;
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
if (combs_mode == COMBINATOR_MODE_BASE_LEFT)
|
|
|
|
{
|
|
|
|
const char *dictfilec = data.dictfile2;
|
|
|
|
|
|
|
|
FILE *combs_fp = fopen (dictfilec, "rb");
|
|
|
|
|
|
|
|
if (combs_fp == NULL)
|
|
|
|
{
|
|
|
|
log_error ("ERROR: %s: %s", dictfilec, strerror (errno));
|
|
|
|
|
|
|
|
fclose (fd);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
device_param->combs_fp = combs_fp;
|
|
|
|
}
|
|
|
|
else if (combs_mode == COMBINATOR_MODE_BASE_RIGHT)
|
|
|
|
{
|
|
|
|
const char *dictfilec = data.dictfile;
|
|
|
|
|
|
|
|
FILE *combs_fp = fopen (dictfilec, "rb");
|
|
|
|
|
|
|
|
if (combs_fp == NULL)
|
|
|
|
{
|
|
|
|
log_error ("ERROR: %s: %s", dictfilec, strerror (errno));
|
|
|
|
|
|
|
|
fclose (fd);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
device_param->combs_fp = combs_fp;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
wl_data_t *wl_data = (wl_data_t *) mymalloc (sizeof (wl_data_t));
|
|
|
|
|
2016-09-22 09:35:08 +00:00
|
|
|
wl_data_init (wl_data, user_options, hashconfig);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
u64 words_cur = 0;
|
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
while (opencl_ctx->run_thread_level1 == true)
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
|
|
|
u64 words_off = 0;
|
|
|
|
u64 words_fin = 0;
|
|
|
|
|
|
|
|
u64 max = -1llu;
|
|
|
|
|
|
|
|
while (max)
|
|
|
|
{
|
2016-09-22 10:33:33 +00:00
|
|
|
const uint work = get_work (opencl_ctx, user_options, device_param, max);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
if (work == 0) break;
|
|
|
|
|
|
|
|
max = 0;
|
|
|
|
|
|
|
|
words_off = device_param->words_off;
|
|
|
|
words_fin = words_off + work;
|
|
|
|
|
|
|
|
char *line_buf;
|
|
|
|
uint line_len;
|
|
|
|
|
2016-09-22 10:15:13 +00:00
|
|
|
for ( ; words_cur < words_off; words_cur++) get_next_word (wl_data, user_options, user_options_extra, fd, &line_buf, &line_len);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
for ( ; words_cur < words_fin; words_cur++)
|
|
|
|
{
|
2016-09-22 10:15:13 +00:00
|
|
|
get_next_word (wl_data, user_options, user_options_extra, fd, &line_buf, &line_len);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
2016-09-22 13:14:55 +00:00
|
|
|
line_len = convert_from_hex (line_buf, line_len, user_options);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
// post-process rule engine
|
|
|
|
|
2016-09-22 10:15:13 +00:00
|
|
|
if (run_rule_engine (user_options_extra->rule_len_l, user_options->rule_buf_l))
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
|
|
|
char rule_buf_out[BLOCK_SIZE] = { 0 };
|
|
|
|
|
|
|
|
int rule_len_out = -1;
|
|
|
|
|
|
|
|
if (line_len < BLOCK_SIZE)
|
|
|
|
{
|
2016-09-22 10:15:13 +00:00
|
|
|
rule_len_out = _old_apply_rule (user_options->rule_buf_l, user_options_extra->rule_len_l, line_buf, line_len, rule_buf_out);
|
2016-09-15 02:29:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (rule_len_out < 0) continue;
|
|
|
|
|
|
|
|
line_buf = rule_buf_out;
|
|
|
|
line_len = rule_len_out;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
{
|
|
|
|
if ((line_len < data.pw_min) || (line_len > data.pw_max))
|
|
|
|
{
|
|
|
|
max++;
|
|
|
|
|
2016-09-20 11:26:19 +00:00
|
|
|
hc_thread_mutex_lock (opencl_ctx->mux_counter);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
for (uint salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++)
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
2016-09-27 11:13:07 +00:00
|
|
|
data.words_progress_rejected[salt_pos] += straight_ctx->kernel_rules_cnt;
|
2016-09-15 02:29:22 +00:00
|
|
|
}
|
|
|
|
|
2016-09-20 11:26:19 +00:00
|
|
|
hc_thread_mutex_unlock (opencl_ctx->mux_counter);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (attack_kern == ATTACK_KERN_COMBI)
|
|
|
|
{
|
|
|
|
// do not check if minimum restriction is satisfied (line_len >= data.pw_min) here
|
|
|
|
// since we still need to combine the plains
|
|
|
|
|
|
|
|
if (line_len > data.pw_max)
|
|
|
|
{
|
|
|
|
max++;
|
|
|
|
|
2016-09-20 11:26:19 +00:00
|
|
|
hc_thread_mutex_lock (opencl_ctx->mux_counter);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
2016-09-16 15:01:18 +00:00
|
|
|
for (uint salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++)
|
2016-09-15 02:29:22 +00:00
|
|
|
{
|
2016-09-27 16:32:09 +00:00
|
|
|
data.words_progress_rejected[salt_pos] += combinator_ctx->combs_cnt;
|
2016-09-15 02:29:22 +00:00
|
|
|
}
|
|
|
|
|
2016-09-20 11:26:19 +00:00
|
|
|
hc_thread_mutex_unlock (opencl_ctx->mux_counter);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
pw_add (device_param, (u8 *) line_buf, line_len);
|
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
if (opencl_ctx->run_thread_level1 == false) break;
|
2016-09-15 02:29:22 +00:00
|
|
|
}
|
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
if (opencl_ctx->run_thread_level1 == false) break;
|
2016-09-15 02:29:22 +00:00
|
|
|
}
|
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
if (opencl_ctx->run_thread_level1 == false) break;
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// flush
|
|
|
|
//
|
|
|
|
|
|
|
|
const uint pws_cnt = device_param->pws_cnt;
|
|
|
|
|
|
|
|
if (pws_cnt)
|
|
|
|
{
|
2016-09-27 16:32:09 +00:00
|
|
|
run_copy (opencl_ctx, device_param, hashconfig, user_options, user_options_extra, combinator_ctx, pws_cnt);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
2016-09-27 16:32:09 +00:00
|
|
|
run_cracker (opencl_ctx, device_param, hashconfig, hashes, user_options, user_options_extra, straight_ctx, combinator_ctx, mask_ctx, pws_cnt);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
device_param->pws_cnt = 0;
|
|
|
|
|
|
|
|
/*
|
|
|
|
still required?
|
|
|
|
if (attack_kern == ATTACK_KERN_STRAIGHT)
|
|
|
|
{
|
|
|
|
run_kernel_bzero (device_param, device_param->d_rules_c, device_param->size_rules_c);
|
|
|
|
}
|
|
|
|
else if (attack_kern == ATTACK_KERN_COMBI)
|
|
|
|
{
|
|
|
|
run_kernel_bzero (device_param, device_param->d_combs_c, device_param->size_combs);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2016-09-19 13:52:01 +00:00
|
|
|
if (opencl_ctx->run_thread_level1 == false) break;
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
if (words_fin == 0) break;
|
|
|
|
|
|
|
|
device_param->words_done = words_fin;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (attack_mode == ATTACK_MODE_COMBI)
|
|
|
|
{
|
|
|
|
fclose (device_param->combs_fp);
|
|
|
|
}
|
|
|
|
|
2016-09-22 09:35:08 +00:00
|
|
|
wl_data_destroy (wl_data);
|
2016-09-15 02:29:22 +00:00
|
|
|
|
|
|
|
fclose (fd);
|
|
|
|
}
|
|
|
|
|
|
|
|
device_param->kernel_accel = 0;
|
|
|
|
device_param->kernel_loops = 0;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|