From 7d9ff152b0861bb9eedba5910cd1eac3566a871c Mon Sep 17 00:00:00 2001 From: jsteube Date: Fri, 23 Sep 2016 20:08:47 +0200 Subject: [PATCH] Fix random rules generator seeding --- src/hashcat.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/hashcat.c b/src/hashcat.c index a4e17609c..a9d6c790e 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -369,15 +369,6 @@ int main (int argc, char **argv) set_cpu_affinity (user_options->cpu_affinity); } - if (user_options->rp_gen_seed_chgd == false) - { - srand (user_options->rp_gen_seed); - } - else - { - srand (proc_start); - } - /** * logfile init */ @@ -803,6 +794,19 @@ int main (int argc, char **argv) opencl_ctx->force_jit_compilation = 1500; } + /** + * prepare seeding for random number generator used from random rules generator + */ + + if (user_options->rp_gen_seed_chgd == true) + { + srand (user_options->rp_gen_seed); + } + else + { + srand (proc_start); + } + /** * load rules */