mirror of
https://github.com/hashcat/hashcat.git
synced 2025-05-10 19:08:49 +00:00
Update induct.c function parameters
This commit is contained in:
parent
c48ca34e1b
commit
ef582be4eb
@ -12,9 +12,9 @@
|
|||||||
|
|
||||||
static const char INDUCT_DIR[] = "induct";
|
static const char INDUCT_DIR[] = "induct";
|
||||||
|
|
||||||
int induct_ctx_init (induct_ctx_t *induct_ctx, const user_options_t *user_options, const folder_config_t *folder_config, const status_ctx_t *status_ctx);
|
int induct_ctx_init (hashcat_ctx_t *hashcat_ctx);
|
||||||
void induct_ctx_scan (induct_ctx_t *induct_ctx);
|
void induct_ctx_scan (hashcat_ctx_t *hashcat_ctx);
|
||||||
void induct_ctx_cleanup (induct_ctx_t *induct_ctx);
|
void induct_ctx_cleanup (hashcat_ctx_t *hashcat_ctx);
|
||||||
void induct_ctx_destroy (induct_ctx_t *induct_ctx);
|
void induct_ctx_destroy (hashcat_ctx_t *hashcat_ctx);
|
||||||
|
|
||||||
#endif // _INDUCT_H
|
#endif // _INDUCT_H
|
||||||
|
@ -541,7 +541,7 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
if (induct_ctx->induction_dictionaries_cnt == 0)
|
if (induct_ctx->induction_dictionaries_cnt == 0)
|
||||||
{
|
{
|
||||||
induct_ctx_scan (induct_ctx);
|
induct_ctx_scan (hashcat_ctx);
|
||||||
|
|
||||||
while (induct_ctx->induction_dictionaries_cnt)
|
while (induct_ctx->induction_dictionaries_cnt)
|
||||||
{
|
{
|
||||||
@ -558,7 +558,7 @@ static int inner2_loop (hashcat_ctx_t *hashcat_ctx)
|
|||||||
|
|
||||||
myfree (induct_ctx->induction_dictionaries);
|
myfree (induct_ctx->induction_dictionaries);
|
||||||
|
|
||||||
induct_ctx_scan (induct_ctx);
|
induct_ctx_scan (hashcat_ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1238,7 +1238,6 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold
|
|||||||
|
|
||||||
dictstat_ctx_t *dictstat_ctx = hashcat_ctx->dictstat_ctx;
|
dictstat_ctx_t *dictstat_ctx = hashcat_ctx->dictstat_ctx;
|
||||||
folder_config_t *folder_config = hashcat_ctx->folder_config;
|
folder_config_t *folder_config = hashcat_ctx->folder_config;
|
||||||
induct_ctx_t *induct_ctx = hashcat_ctx->induct_ctx;
|
|
||||||
logfile_ctx_t *logfile_ctx = hashcat_ctx->logfile_ctx;
|
logfile_ctx_t *logfile_ctx = hashcat_ctx->logfile_ctx;
|
||||||
loopback_ctx_t *loopback_ctx = hashcat_ctx->loopback_ctx;
|
loopback_ctx_t *loopback_ctx = hashcat_ctx->loopback_ctx;
|
||||||
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||||
@ -1306,7 +1305,7 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold
|
|||||||
* induction directory
|
* induction directory
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const int rc_induct_ctx_init = induct_ctx_init (induct_ctx, user_options, folder_config, status_ctx);
|
const int rc_induct_ctx_init = induct_ctx_init (hashcat_ctx);
|
||||||
|
|
||||||
if (rc_induct_ctx_init == -1) return -1;
|
if (rc_induct_ctx_init == -1) return -1;
|
||||||
|
|
||||||
@ -1499,7 +1498,7 @@ int hashcat (hashcat_ctx_t *hashcat_ctx, char *install_folder, char *shared_fold
|
|||||||
|
|
||||||
potfile_destroy (hashcat_ctx);
|
potfile_destroy (hashcat_ctx);
|
||||||
|
|
||||||
induct_ctx_destroy (induct_ctx);
|
induct_ctx_destroy (hashcat_ctx);
|
||||||
|
|
||||||
outfile_destroy (hashcat_ctx);
|
outfile_destroy (hashcat_ctx);
|
||||||
|
|
||||||
|
19
src/induct.c
19
src/induct.c
@ -21,8 +21,13 @@ static int sort_by_mtime (const void *p1, const void *p2)
|
|||||||
return s2.st_mtime - s1.st_mtime;
|
return s2.st_mtime - s1.st_mtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
int induct_ctx_init (induct_ctx_t *induct_ctx, const user_options_t *user_options, const folder_config_t *folder_config, const status_ctx_t *status_ctx)
|
int induct_ctx_init (hashcat_ctx_t *hashcat_ctx)
|
||||||
{
|
{
|
||||||
|
folder_config_t *folder_config = hashcat_ctx->folder_config;
|
||||||
|
induct_ctx_t *induct_ctx = hashcat_ctx->induct_ctx;
|
||||||
|
status_ctx_t *status_ctx = hashcat_ctx->status_ctx;
|
||||||
|
user_options_t *user_options = hashcat_ctx->user_options;
|
||||||
|
|
||||||
induct_ctx->enabled = false;
|
induct_ctx->enabled = false;
|
||||||
|
|
||||||
if (user_options->benchmark == true) return 0;
|
if (user_options->benchmark == true) return 0;
|
||||||
@ -89,8 +94,10 @@ int induct_ctx_init (induct_ctx_t *induct_ctx, const user_options_t *user_option
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void induct_ctx_scan (induct_ctx_t *induct_ctx)
|
void induct_ctx_scan (hashcat_ctx_t *hashcat_ctx)
|
||||||
{
|
{
|
||||||
|
induct_ctx_t *induct_ctx = hashcat_ctx->induct_ctx;
|
||||||
|
|
||||||
if (induct_ctx->enabled == false) return;
|
if (induct_ctx->enabled == false) return;
|
||||||
|
|
||||||
induct_ctx->induction_dictionaries = scan_directory (induct_ctx->root_directory);
|
induct_ctx->induction_dictionaries = scan_directory (induct_ctx->root_directory);
|
||||||
@ -100,8 +107,10 @@ void induct_ctx_scan (induct_ctx_t *induct_ctx)
|
|||||||
qsort (induct_ctx->induction_dictionaries, (size_t) induct_ctx->induction_dictionaries_cnt, sizeof (char *), sort_by_mtime);
|
qsort (induct_ctx->induction_dictionaries, (size_t) induct_ctx->induction_dictionaries_cnt, sizeof (char *), sort_by_mtime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void induct_ctx_cleanup (induct_ctx_t *induct_ctx)
|
void induct_ctx_cleanup (hashcat_ctx_t *hashcat_ctx)
|
||||||
{
|
{
|
||||||
|
induct_ctx_t *induct_ctx = hashcat_ctx->induct_ctx;
|
||||||
|
|
||||||
if (induct_ctx->enabled == false) return;
|
if (induct_ctx->enabled == false) return;
|
||||||
|
|
||||||
for (int file_pos = 0; file_pos < induct_ctx->induction_dictionaries_cnt; file_pos++)
|
for (int file_pos = 0; file_pos < induct_ctx->induction_dictionaries_cnt; file_pos++)
|
||||||
@ -115,8 +124,10 @@ void induct_ctx_cleanup (induct_ctx_t *induct_ctx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void induct_ctx_destroy (induct_ctx_t *induct_ctx)
|
void induct_ctx_destroy (hashcat_ctx_t *hashcat_ctx)
|
||||||
{
|
{
|
||||||
|
induct_ctx_t *induct_ctx = hashcat_ctx->induct_ctx;
|
||||||
|
|
||||||
if (induct_ctx->enabled == false) return;
|
if (induct_ctx->enabled == false) return;
|
||||||
|
|
||||||
if (rmdir (induct_ctx->root_directory) == -1)
|
if (rmdir (induct_ctx->root_directory) == -1)
|
||||||
|
Loading…
Reference in New Issue
Block a user