1
mirror of https://github.com/hashcat/hashcat synced 2024-12-27 05:13:45 +01:00

Speed up startup time for --stdout by using an empty kernel

This commit is contained in:
jsteube 2016-06-19 14:33:50 +02:00
parent 07acd52ed4
commit 4444c17ec6
2 changed files with 31 additions and 17 deletions

View File

@ -893,6 +893,7 @@ extern hc_thread_mutex_t mux_display;
#define KERN_TYPE_HMACSHA512_PW 1750
#define KERN_TYPE_HMACSHA512_SLT 1760
#define KERN_TYPE_SHA512CRYPT 1800
#define KERN_TYPE_STDOUT 2000
#define KERN_TYPE_DCC2 2100
#define KERN_TYPE_MD5PIX 2400
#define KERN_TYPE_MD5ASA 2410

View File

@ -6773,6 +6773,8 @@ int main (int argc, char **argv)
kernel_loops = 1024;
force = 1;
outfile_check_timer = 0;
session = "stdout";
opencl_vector_width = 1;
}
if (remove_timer_chgd == 1)
@ -8706,7 +8708,7 @@ int main (int argc, char **argv)
salt_type = SALT_TYPE_NONE;
attack_exec = ATTACK_EXEC_INSIDE_KERNEL;
opts_type = OPTS_TYPE_PT_GENERATE_LE;
kern_type = 0;
kern_type = KERN_TYPE_STDOUT;
dgst_size = DGST_SIZE_4_4;
parse_func = NULL;
sort_by_digest = NULL;
@ -13637,14 +13639,13 @@ int main (int argc, char **argv)
}
}
if (opencl_device_types == NULL)
{
/**
* OpenCL device types:
* In case the user did not specify --opencl-device-types and the user runs hashcat in a system with only a CPU only he probably want to use that CPU.
* In such a case, automatically enable CPU device type support, since it's disabled by default.
*/
if (opencl_device_types == NULL)
{
cl_device_type device_types_all = 0;
for (uint platform_id = 0; platform_id < platforms_cnt; platform_id++)
@ -13667,10 +13668,23 @@ int main (int argc, char **argv)
}
}
// In such a case, automatically enable CPU device type support, since it's disabled by default.
if ((device_types_all & (CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_ACCELERATOR)) == 0)
{
device_types_filter |= CL_DEVICE_TYPE_CPU;
}
// In another case, when the user uses --stdout, using CPU devices is much faster to setup
// If we have a CPU device, force it to be used
if (stdout_flag == 1)
{
if (device_types_all & CL_DEVICE_TYPE_CPU)
{
device_types_filter = CL_DEVICE_TYPE_CPU;
}
}
}
/**
@ -13749,16 +13763,9 @@ int main (int argc, char **argv)
{
if (machine_readable == 0)
{
int len = 0;
if (platform_skipped == 0)
{
len = log_info ("OpenCL Platform #%u: %s", platform_id + 1, platform_vendor);
}
else
{
len = log_info ("OpenCL Platform #%u: %s, skipped", platform_id + 1, platform_vendor);
}
const int len = log_info ("OpenCL Platform #%u: %s", platform_id + 1, platform_vendor);
char line[256] = { 0 };
@ -13766,6 +13773,12 @@ int main (int argc, char **argv)
log_info (line);
}
else
{
log_info ("OpenCL Platform #%u: %s, skipped", platform_id + 1, platform_vendor);
log_info ("");
}
}
}
if (platform_skipped == 1) continue;