1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-12-22 14:48:12 +00:00

Add missing combinator files

This commit is contained in:
jsteube 2016-09-27 20:07:49 +02:00
parent 814206801a
commit f1cf902c35
2 changed files with 49 additions and 0 deletions

15
include/combinator.h Normal file
View File

@ -0,0 +1,15 @@
/**
* Author......: See docs/credits.txt
* License.....: MIT
*/
#ifndef _COMBINATOR_H
#define _COMBINATOR_H
#include <stdio.h>
#include <errno.h>
int combinator_ctx_init (combinator_ctx_t *combinator_ctx, const user_options_t *user_options);
void combinator_ctx_destroy (combinator_ctx_t *combinator_ctx);
#endif // _COMBINATOR_H

34
src/combinator.c Normal file
View File

@ -0,0 +1,34 @@
/**
* 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)
{
memset (combinator_ctx, 0, sizeof (combinator_ctx_t));
combinator_ctx->enabled = false;
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)
{
if (combinator_ctx->enabled == false) return;
myfree (combinator_ctx);
}