mirror of
https://github.com/hashcat/hashcat.git
synced 2024-12-22 06:38:11 +00:00
Fix segfault in related to weak-hash-check on CPU devices
Move typedef for bool datatype to common.h
This commit is contained in:
parent
54ed58e28b
commit
0ff49c5b44
@ -93,6 +93,8 @@ void log_out (FILE *fp, const char *fmt, ...);
|
||||
void log_info (const char *fmt, ...);
|
||||
void log_error (const char *fmt, ...);
|
||||
|
||||
typedef int bool; // this is ugly but ADL requires the bool datatype
|
||||
|
||||
typedef uint32_t uint; // we should rename to u32, sooner or later, for consistency
|
||||
typedef uint64_t u64;
|
||||
|
||||
|
@ -8,10 +8,6 @@
|
||||
|
||||
#include <common.h>
|
||||
|
||||
// this is ugly but ADL requires the bool datatype
|
||||
|
||||
typedef int bool;
|
||||
|
||||
#include <adl_sdk.h>
|
||||
|
||||
typedef int HM_ADAPTER_AMD;
|
||||
|
@ -1904,8 +1904,6 @@ void hc_signal (void c (int));
|
||||
|
||||
#endif
|
||||
|
||||
typedef int bool;
|
||||
|
||||
bool class_num (char c);
|
||||
bool class_lower (char c);
|
||||
bool class_upper (char c);
|
||||
|
@ -2658,7 +2658,7 @@ static void run_cracker (hc_device_param_t *device_param, const uint pw_cnt, con
|
||||
uint innerloop_cnt = 0;
|
||||
|
||||
if (data.attack_exec == ATTACK_EXEC_INSIDE_KERNEL) innerloop_step = kernel_loops;
|
||||
else innerloop_step = 1;
|
||||
else innerloop_step = 1;
|
||||
|
||||
if (data.attack_kern == ATTACK_KERN_STRAIGHT) innerloop_cnt = data.kernel_rules_cnt;
|
||||
else if (data.attack_kern == ATTACK_KERN_COMBI) innerloop_cnt = data.combs_cnt;
|
||||
@ -13826,6 +13826,7 @@ int main (int argc, char **argv)
|
||||
|
||||
device_param->d_pws_buf = hc_clCreateBuffer (device_param->context, CL_MEM_READ_ONLY, size_pws, NULL);
|
||||
device_param->d_pws_amp_buf = hc_clCreateBuffer (device_param->context, CL_MEM_READ_ONLY, size_pws, NULL);
|
||||
device_param->d_rules_c = hc_clCreateBuffer (device_param->context, CL_MEM_READ_ONLY, size_rules_c, NULL); // we need this for weak-hash-check even if the user has choosen for ex: -a 3
|
||||
device_param->d_tmps = hc_clCreateBuffer (device_param->context, CL_MEM_READ_WRITE, size_tmps, NULL);
|
||||
device_param->d_hooks = hc_clCreateBuffer (device_param->context, CL_MEM_READ_WRITE, size_hooks, NULL);
|
||||
device_param->d_bitmap_s1_a = hc_clCreateBuffer (device_param->context, CL_MEM_READ_ONLY, bitmap_size, NULL);
|
||||
@ -13857,6 +13858,7 @@ int main (int argc, char **argv)
|
||||
|
||||
run_kernel_bzero (device_param, device_param->d_pws_buf, size_pws);
|
||||
run_kernel_bzero (device_param, device_param->d_pws_amp_buf, size_pws);
|
||||
run_kernel_bzero (device_param, device_param->d_rules_c, size_rules_c);
|
||||
run_kernel_bzero (device_param, device_param->d_tmps, size_tmps);
|
||||
run_kernel_bzero (device_param, device_param->d_hooks, size_hooks);
|
||||
run_kernel_bzero (device_param, device_param->d_plain_bufs, size_plains);
|
||||
@ -13868,12 +13870,9 @@ int main (int argc, char **argv)
|
||||
|
||||
if (attack_kern == ATTACK_KERN_STRAIGHT)
|
||||
{
|
||||
device_param->d_rules = hc_clCreateBuffer (device_param->context, CL_MEM_READ_ONLY, size_rules, NULL);
|
||||
device_param->d_rules_c = hc_clCreateBuffer (device_param->context, CL_MEM_READ_ONLY, size_rules_c, NULL);
|
||||
device_param->d_rules = hc_clCreateBuffer (device_param->context, CL_MEM_READ_ONLY, size_rules, NULL);
|
||||
|
||||
hc_clEnqueueWriteBuffer (device_param->command_queue, device_param->d_rules, CL_TRUE, 0, size_rules, kernel_rules_buf, 0, NULL, NULL);
|
||||
|
||||
run_kernel_bzero (device_param, device_param->d_rules_c, size_rules_c);
|
||||
}
|
||||
else if (attack_kern == ATTACK_KERN_COMBI)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user