1
mirror of https://github.com/hashcat/hashcat synced 2025-03-19 06:14:22 +01:00
hashcat/src/combinator.c

44 lines
1001 B
C
Raw Normal View History

2016-09-27 20:07:49 +02:00
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#include "common.h"
#include "types.h"
#include "memory.h"
#include "logging.h"
#include "combinator.h"
#include "wordlist.h"
int combinator_ctx_init (combinator_ctx_t *combinator_ctx, const user_options_t *user_options)
{
combinator_ctx->enabled = false;
if (user_options->left == true) return 0;
if (user_options->opencl_info == true) return 0;
if (user_options->show == true) return 0;
if (user_options->usage == true) return 0;
if (user_options->version == true) return 0;
2016-09-27 20:07:49 +02:00
if ((user_options->attack_mode != ATTACK_MODE_COMBI)
&& (user_options->attack_mode != ATTACK_MODE_HYBRID1)
&& (user_options->attack_mode != ATTACK_MODE_HYBRID2)) return 0;
combinator_ctx->enabled = true;
return 0;
}
void combinator_ctx_destroy (combinator_ctx_t *combinator_ctx)
{
2016-09-30 13:36:27 +02:00
if (combinator_ctx->enabled == false)
{
myfree (combinator_ctx);
return;
}
2016-09-27 20:07:49 +02:00
myfree (combinator_ctx);
}