mirror of
https://github.com/hashcat/hashcat.git
synced 2024-11-25 09:28:20 +00:00
Update cpt.c function parameters
This commit is contained in:
parent
077a94600d
commit
702c175f84
@ -10,8 +10,8 @@
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
|
||||
int cpt_ctx_init (cpt_ctx_t *cpt_ctx, const user_options_t *user_options);
|
||||
void cpt_ctx_destroy (cpt_ctx_t *cpt_ctx);
|
||||
void cpt_ctx_reset (cpt_ctx_t *cpt_ctx);
|
||||
int cpt_ctx_init (hashcat_ctx_t *hashcat_ctx);
|
||||
void cpt_ctx_destroy (hashcat_ctx_t *hashcat_ctx);
|
||||
void cpt_ctx_reset (hashcat_ctx_t *hashcat_ctx);
|
||||
|
||||
#endif // _CPT_H
|
||||
|
13
src/cpt.c
13
src/cpt.c
@ -9,8 +9,11 @@
|
||||
#include "logging.h"
|
||||
#include "cpt.h"
|
||||
|
||||
int cpt_ctx_init (cpt_ctx_t *cpt_ctx, const user_options_t *user_options)
|
||||
int cpt_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
cpt_ctx_t *cpt_ctx = hashcat_ctx->cpt_ctx;
|
||||
user_options_t *user_options = hashcat_ctx->user_options;
|
||||
|
||||
cpt_ctx->enabled = false;
|
||||
|
||||
if (user_options->keyspace == true) return 0;
|
||||
@ -32,8 +35,10 @@ int cpt_ctx_init (cpt_ctx_t *cpt_ctx, const user_options_t *user_options)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cpt_ctx_destroy (cpt_ctx_t *cpt_ctx)
|
||||
void cpt_ctx_destroy (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
cpt_ctx_t *cpt_ctx = hashcat_ctx->cpt_ctx;
|
||||
|
||||
if (cpt_ctx->enabled == false) return;
|
||||
|
||||
myfree (cpt_ctx->cpt_buf);
|
||||
@ -41,8 +46,10 @@ void cpt_ctx_destroy (cpt_ctx_t *cpt_ctx)
|
||||
memset (cpt_ctx, 0, sizeof (cpt_ctx_t));
|
||||
}
|
||||
|
||||
void cpt_ctx_reset (cpt_ctx_t *cpt_ctx)
|
||||
void cpt_ctx_reset (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
cpt_ctx_t *cpt_ctx = hashcat_ctx->cpt_ctx;
|
||||
|
||||
if (cpt_ctx->enabled == false) return;
|
||||
|
||||
memset (cpt_ctx->cpt_buf, 0, CPT_BUF * sizeof (cpt_t));
|
||||
|
@ -117,7 +117,6 @@ void hashcat_ctx_destroy (hashcat_ctx_t *hashcat_ctx)
|
||||
static int inner2_loop (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx;
|
||||
cpt_ctx_t *cpt_ctx = hashcat_ctx->cpt_ctx;
|
||||
dictstat_ctx_t *dictstat_ctx = hashcat_ctx->dictstat_ctx;
|
||||
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||
hashes_t *hashes = hashcat_ctx->hashes;
|
||||
@ -169,7 +168,7 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
opencl_session_reset (opencl_ctx);
|
||||
|
||||
cpt_ctx_reset (cpt_ctx);
|
||||
cpt_ctx_reset (hashcat_ctx);
|
||||
|
||||
// figure out wordlist based workload
|
||||
|
||||
@ -760,7 +759,6 @@ static int inner1_loop (hashcat_ctx_t *hashcat_ctx)
|
||||
static int outer_loop (hashcat_ctx_t *hashcat_ctx)
|
||||
{
|
||||
bitmap_ctx_t *bitmap_ctx = hashcat_ctx->bitmap_ctx;
|
||||
cpt_ctx_t *cpt_ctx = hashcat_ctx->cpt_ctx;
|
||||
folder_config_t *folder_config = hashcat_ctx->folder_config;
|
||||
hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
|
||||
hashes_t *hashes = hashcat_ctx->hashes;
|
||||
@ -913,7 +911,7 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
|
||||
* cracks-per-time allocate buffer
|
||||
*/
|
||||
|
||||
cpt_ctx_init (cpt_ctx, user_options);
|
||||
cpt_ctx_init (hashcat_ctx);
|
||||
|
||||
/**
|
||||
* Wordlist allocate buffer
|
||||
@ -1232,7 +1230,7 @@ static int outer_loop (hashcat_ctx_t *hashcat_ctx)
|
||||
|
||||
wl_data_destroy (wl_data);
|
||||
|
||||
cpt_ctx_destroy (cpt_ctx);
|
||||
cpt_ctx_destroy (hashcat_ctx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user