From 0155c9d44a4df71f9138a26ca91c5cba9e0a0319 Mon Sep 17 00:00:00 2001 From: jsteube Date: Thu, 6 Oct 2016 09:56:17 +0200 Subject: [PATCH] Update bitmap.c function parameters --- include/bitmap.h | 6 ++---- src/bitmap.c | 11 +++++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/include/bitmap.h b/include/bitmap.h index 6cb8b452b..18b07f329 100644 --- a/include/bitmap.h +++ b/include/bitmap.h @@ -8,9 +8,7 @@ #include -int sort_by_bitmap (const void *s1, const void *s2); - -void bitmap_ctx_init (bitmap_ctx_t *bitmap_ctx, const user_options_t *user_options, const hashconfig_t *hashconfig, const hashes_t *hashes); -void bitmap_ctx_destroy (bitmap_ctx_t *bitmap_ctx); +void bitmap_ctx_init (hashcat_ctx_t *hashcat_ctx); +void bitmap_ctx_destroy (hashcat_ctx_t *hashcat_ctx); #endif // _BITMAP_H diff --git a/src/bitmap.c b/src/bitmap.c index a88c5f254..abb5c9c1a 100644 --- a/src/bitmap.c +++ b/src/bitmap.c @@ -50,8 +50,13 @@ static u32 generate_bitmaps (const u32 digests_cnt, const u32 dgst_size, const u return collisions; } -void bitmap_ctx_init (bitmap_ctx_t *bitmap_ctx, const user_options_t *user_options, const hashconfig_t *hashconfig, const hashes_t *hashes) +void bitmap_ctx_init (hashcat_ctx_t *hashcat_ctx) { + bitmap_ctx_t *bitmap_ctx = hashcat_ctx->bitmap_ctx; + hashconfig_t *hashconfig = hashcat_ctx->hashconfig; + hashes_t *hashes = hashcat_ctx->hashes; + user_options_t *user_options = hashcat_ctx->user_options; + bitmap_ctx->enabled = false; if (user_options->keyspace == true) return; @@ -131,8 +136,10 @@ void bitmap_ctx_init (bitmap_ctx_t *bitmap_ctx, const user_options_t *user_optio bitmap_ctx->bitmap_s2_d = bitmap_s2_d; } -void bitmap_ctx_destroy (bitmap_ctx_t *bitmap_ctx) +void bitmap_ctx_destroy (hashcat_ctx_t *hashcat_ctx) { + bitmap_ctx_t *bitmap_ctx = hashcat_ctx->bitmap_ctx; + if (bitmap_ctx->enabled == false) return; myfree (bitmap_ctx->bitmap_s1_a);