1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-23 15:18:16 +00:00

Use pure kernel rule engine for --stdout

This commit is contained in:
jsteube 2017-08-12 12:11:48 +02:00
parent 98b4aab9d0
commit e47506c610
8 changed files with 3051 additions and 2437 deletions

View File

@ -6,7 +6,6 @@
#ifndef _RP_KERNEL_ON_CPU_H
#define _RP_KERNEL_ON_CPU_H
u32 apply_rule (const u32 name, const u32 p0, const u32 p1, u32 buf0[4], u32 buf1[4], const u32 in_len);
u32 apply_rules (u32 *cmds, u32 buf0[4], u32 buf1[4], const u32 len);
int apply_rules (const u32 *cmds, u32 in_buf[64], const int in_len, u32 out_buf[64]);
#endif // _RP_KERNEL_ON_CPU_H

View File

@ -0,0 +1,12 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _RP_KERNEL_ON_CPU_OPTIMIZED_H
#define _RP_KERNEL_ON_CPU_OPTIMIZED_H
u32 apply_rule_optimized (const u32 name, const u32 p0, const u32 p1, u32 buf0[4], u32 buf1[4], const u32 in_len);
u32 apply_rules_optimized (u32 *cmds, u32 buf0[4], u32 buf1[4], const u32 len);
#endif // _RP_KERNEL_ON_CPU_OPTIMIZED_H

View File

@ -273,7 +273,7 @@ LFLAGS_CROSS_WIN64 += -lpsapi
## Objects
##
OBJS_ALL := affinity autotune benchmark bitmap bitops combinator common convert cpt cpu_aes cpu_crc32 cpu_des cpu_md4 cpu_md5 cpu_sha1 cpu_sha256 debugfile dictstat dispatch dynloader event ext_ADL ext_nvapi ext_nvml ext_OpenCL ext_sysfs ext_xnvctrl ext_lzma lzma_sdk/Alloc lzma_sdk/Lzma2Dec lzma_sdk/LzmaDec filehandling folder hashcat hashes hlfmt hwmon induct interface locking logfile loopback memory monitor mpsp opencl outfile_check outfile pidfile potfile restore rp rp_cpu rp_kernel_on_cpu selftest shared status stdout straight terminal thread timer tuningdb usage user_options weak_hash wordlist
OBJS_ALL := affinity autotune benchmark bitmap bitops combinator common convert cpt cpu_aes cpu_crc32 cpu_des cpu_md4 cpu_md5 cpu_sha1 cpu_sha256 debugfile dictstat dispatch dynloader event ext_ADL ext_nvapi ext_nvml ext_OpenCL ext_sysfs ext_xnvctrl ext_lzma lzma_sdk/Alloc lzma_sdk/Lzma2Dec lzma_sdk/LzmaDec filehandling folder hashcat hashes hlfmt hwmon induct interface locking logfile loopback memory monitor mpsp opencl outfile_check outfile pidfile potfile restore rp rp_cpu rp_kernel_on_cpu rp_kernel_on_cpu_optimized selftest shared status stdout straight terminal thread timer tuningdb usage user_options weak_hash wordlist
NATIVE_STATIC_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).NATIVE.STATIC.o)
NATIVE_SHARED_OBJS := $(foreach OBJ,$(OBJS_ALL),obj/$(OBJ).NATIVE.SHARED.o)

View File

@ -21,7 +21,6 @@
#include "outfile.h"
#include "potfile.h"
#include "rp.h"
#include "rp_kernel_on_cpu.h"
#include "shared.h"
#include "thread.h"
#include "timer.h"

View File

@ -13,6 +13,7 @@
#include "mpsp.h"
#include "rp.h"
#include "rp_kernel_on_cpu.h"
#include "rp_kernel_on_cpu_optimized.h"
#include "opencl.h"
#include "shared.h"
#include "outfile.h"
@ -42,16 +43,21 @@ int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl
if (rc == -1) return -1;
for (int i = 0; i < 64; i++)
{
plain_buf[i] = pw.i[i];
}
plain_len = (int) pw.pw_len;
const u32 off = device_param->innerloop_pos + il_pos;
plain_len = (int) apply_rules (straight_ctx->kernel_rules_buf[off].cmds, &plain_buf[0], &plain_buf[4], (u32) plain_len);
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
{
for (int i = 0; i < 8; i++)
{
plain_buf[i] = pw.i[i];
}
plain_len = (int) apply_rules_optimized (straight_ctx->kernel_rules_buf[off].cmds, &plain_buf[0], &plain_buf[4], (u32) pw.pw_len);
}
else
{
plain_len = (int) apply_rules (straight_ctx->kernel_rules_buf[off].cmds, pw.i, pw.pw_len, plain_buf);
}
if (plain_len > (int) hashconfig->pw_max) plain_len = (int) hashconfig->pw_max;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,7 @@
#include "event.h"
#include "locking.h"
#include "rp_kernel_on_cpu.h"
#include "rp_kernel_on_cpu_optimized.h"
#include "mpsp.h"
#include "opencl.h"
#include "shared.h"
@ -112,18 +113,23 @@ int process_stdout (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param,
return -1;
}
const u32 pos = device_param->innerloop_pos;
for (u32 il_pos = 0; il_pos < il_cnt; il_pos++)
{
for (int i = 0; i < 64; i++)
const u32 off = device_param->innerloop_pos + il_pos;
if (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL)
{
plain_buf[i] = pw.i[i];
for (int i = 0; i < 8; i++)
{
plain_buf[i] = pw.i[i];
}
plain_len = apply_rules_optimized (straight_ctx->kernel_rules_buf[off].cmds, &plain_buf[0], &plain_buf[4], pw.pw_len);
}
else
{
plain_len = (int) apply_rules (straight_ctx->kernel_rules_buf[off].cmds, pw.i, pw.pw_len, plain_buf);
}
plain_len = pw.pw_len;
plain_len = apply_rules (straight_ctx->kernel_rules_buf[pos + il_pos].cmds, &plain_buf[0], &plain_buf[4], plain_len);
if (plain_len > hashconfig->pw_max) plain_len = hashconfig->pw_max;