diff --git a/include/hashes.h b/include/hashes.h index b6b3803c7..7509e944f 100644 --- a/include/hashes.h +++ b/include/hashes.h @@ -12,6 +12,8 @@ int sort_by_salt (const void *v1, const void *v2); int sort_by_hash (const void *v1, const void *v2, void *v3); int sort_by_hash_no_salt (const void *v1, const void *v2, void *v3); +int hash_encode (const hashconfig_t *hashconfig, const hashes_t *hashes, const module_ctx_t *module_ctx, char *out_buf, const int out_size, const u32 salt_pos, const u32 digest_pos); + int save_hash (hashcat_ctx_t *hashcat_ctx); void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, plain_t *plain); diff --git a/include/interface.h b/include/interface.h index 7a8a370fc..69d241e66 100644 --- a/include/interface.h +++ b/include/interface.h @@ -21,8 +21,6 @@ static const int MODULE_HASH_MODES_MAXIMUM = 100000; * output functions */ -int ascii_digest (const hashconfig_t *hashconfig, const hashes_t *hashes, const module_ctx_t *module_ctx, char *out_buf, const int out_size, const u32 salt_pos, const u32 digest_pos); - int module_filename (const folder_config_t *folder_config, const int hash_mode, char *out_buf, const size_t out_size); bool module_load (hashcat_ctx_t *hashcat_ctx, module_ctx_t *module_ctx, const u32 hash_mode); void module_unload (module_ctx_t *module_ctx); diff --git a/src/autotune.c b/src/autotune.c index d0c7e740b..a6e17d1a4 100644 --- a/src/autotune.c +++ b/src/autotune.c @@ -8,7 +8,6 @@ #include "event.h" #include "opencl.h" #include "status.h" -#include "terminal.h" #include "autotune.h" static double try_run (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 kernel_accel, const u32 kernel_loops) diff --git a/src/benchmark.c b/src/benchmark.c index 24b6f4ed1..bc11706da 100644 --- a/src/benchmark.c +++ b/src/benchmark.c @@ -6,9 +6,9 @@ #include "common.h" #include "types.h" #include "interface.h" -#include "benchmark.h" #include "memory.h" #include "shared.h" +#include "benchmark.h" static const int DEFAULT_BENCHMARK_ALGORITHMS_BUF[] = { diff --git a/src/bitmap.c b/src/bitmap.c index 3a8ec3475..66f9ebd0f 100644 --- a/src/bitmap.c +++ b/src/bitmap.c @@ -6,8 +6,8 @@ #include "common.h" #include "types.h" #include "memory.h" -#include "bitmap.h" #include "event.h" +#include "bitmap.h" static void selftest_to_bitmap (const u32 dgst_shifts, char *digests_buf_ptr, const u32 dgst_pos0, const u32 dgst_pos1, const u32 dgst_pos2, const u32 dgst_pos3, const u32 bitmap_mask, u32 *bitmap_a, u32 *bitmap_b, u32 *bitmap_c, u32 *bitmap_d) { diff --git a/src/brain.c b/src/brain.c index 42e6326b8..cf286c270 100644 --- a/src/brain.c +++ b/src/brain.c @@ -5,15 +5,13 @@ #include "common.h" #include "types.h" +#include "bitops.h" #include "timer.h" #include "memory.h" #include "thread.h" -#include "bitops.h" #include "convert.h" #include "shared.h" -#include "interface.h" #include "hashes.h" -#include "shared.h" #include "brain.h" static bool keep_running = true; @@ -96,7 +94,7 @@ u32 brain_compute_session (hashcat_ctx_t *hashcat_ctx) } else { - // using ascii_digest is an easy workaround for dealing with optimizations + // using hash_encode is an easy workaround for dealing with optimizations // like OPTI_TYPE_PRECOMPUTE_MERKLE which cause diffrent hashes in digests_buf // in case -O is used @@ -114,7 +112,7 @@ u32 brain_compute_session (hashcat_ctx_t *hashcat_ctx) for (u32 digest_idx = 0; digest_idx < salt_buf->digests_cnt; digest_idx++) { - const int out_len = ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salts_idx, digest_idx); + const int out_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salts_idx, digest_idx); out_buf[out_len] = 0; diff --git a/src/combinator.c b/src/combinator.c index 090098ae5..ccf7b4792 100644 --- a/src/combinator.c +++ b/src/combinator.c @@ -6,10 +6,9 @@ #include "common.h" #include "types.h" #include "event.h" -#include "memory.h" -#include "combinator.h" #include "shared.h" #include "wordlist.h" +#include "combinator.h" int combinator_ctx_init (hashcat_ctx_t *hashcat_ctx) { diff --git a/src/cpt.c b/src/cpt.c index 534c16f67..90ce8728d 100644 --- a/src/cpt.c +++ b/src/cpt.c @@ -7,7 +7,6 @@ #include "types.h" #include "memory.h" #include "cpt.h" -#include "shared.h" int cpt_ctx_init (hashcat_ctx_t *hashcat_ctx) { diff --git a/src/debugfile.c b/src/debugfile.c index 11a521c15..f6519534e 100644 --- a/src/debugfile.c +++ b/src/debugfile.c @@ -5,11 +5,10 @@ #include "common.h" #include "types.h" -#include "memory.h" #include "event.h" -#include "debugfile.h" #include "shared.h" #include "locking.h" +#include "debugfile.h" static void debugfile_format_plain (hashcat_ctx_t *hashcat_ctx, const u8 *plain_ptr, const u32 plain_len) { diff --git a/src/dictstat.c b/src/dictstat.c index e7b52cc41..628c15187 100644 --- a/src/dictstat.c +++ b/src/dictstat.c @@ -8,9 +8,9 @@ #include "memory.h" #include "bitops.h" #include "event.h" -#include "dictstat.h" #include "locking.h" #include "shared.h" +#include "dictstat.h" int sort_by_dictstat (const void *s1, const void *s2) { diff --git a/src/dispatch.c b/src/dispatch.c index 87a432526..e43a23ad0 100644 --- a/src/dispatch.c +++ b/src/dispatch.c @@ -5,7 +5,6 @@ #include "common.h" #include "types.h" -#include "convert.h" #include "event.h" #include "memory.h" #include "opencl.h" @@ -16,7 +15,6 @@ #include "rp.h" #include "rp_cpu.h" #include "slow_candidates.h" -#include "user_options.h" #include "dispatch.h" #ifdef WITH_BRAIN diff --git a/src/ext_OpenCL.c b/src/ext_OpenCL.c index 91b991368..ad4ad23a2 100644 --- a/src/ext_OpenCL.c +++ b/src/ext_OpenCL.c @@ -5,8 +5,6 @@ #include "common.h" #include "types.h" -#include "memory.h" -#include "event.h" #include "ext_OpenCL.h" const char *val2cstr_cl (cl_int CL_err) diff --git a/src/ext_lzma.c b/src/ext_lzma.c index 16e8e7f6d..0b29d9b9c 100644 --- a/src/ext_lzma.c +++ b/src/ext_lzma.c @@ -6,7 +6,6 @@ #include "common.h" #include "types.h" #include "memory.h" -#include "event.h" #include "ext_lzma.h" void *hc_lzma_alloc (MAYBE_UNUSED ISzAllocPtr p, size_t size) diff --git a/src/ext_nvapi.c b/src/ext_nvapi.c index f366372d4..4fad053ff 100644 --- a/src/ext_nvapi.c +++ b/src/ext_nvapi.c @@ -5,6 +5,4 @@ #include "common.h" #include "types.h" -#include "event.h" -#include "memory.h" #include "ext_nvapi.h" diff --git a/src/ext_nvml.c b/src/ext_nvml.c index 36e906e28..416b02bb4 100644 --- a/src/ext_nvml.c +++ b/src/ext_nvml.c @@ -5,7 +5,4 @@ #include "common.h" #include "types.h" -#include "event.h" -#include "memory.h" -#include "dynloader.h" #include "ext_nvml.h" diff --git a/src/hashcat.c b/src/hashcat.c index f568a79b6..b45319520 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -9,7 +9,6 @@ #include "types.h" #include "folder.h" -#include "locking.h" #include "memory.h" #include "shared.h" #include "thread.h" @@ -27,7 +26,6 @@ #include "dictstat.h" #include "dispatch.h" #include "event.h" -#include "hashcat.h" #include "hashes.h" #include "hwmon.h" #include "induct.h" @@ -42,14 +40,13 @@ #include "pidfile.h" #include "potfile.h" #include "restore.h" -#include "rp.h" #include "selftest.h" #include "status.h" #include "straight.h" #include "tuningdb.h" -#include "usage.h" #include "user_options.h" #include "wordlist.h" +#include "hashcat.h" #ifdef WITH_BRAIN #include "brain.h" diff --git a/src/hashes.c b/src/hashes.c index 675fb0d23..72963d017 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -7,26 +7,21 @@ #include "types.h" #include "memory.h" #include "event.h" -#include "hashes.h" - #include "convert.h" #include "debugfile.h" #include "filehandling.h" #include "hlfmt.h" -#include "interface.h" #include "terminal.h" #include "logfile.h" #include "loopback.h" -#include "mpsp.h" #include "opencl.h" #include "outfile.h" #include "potfile.h" #include "rp.h" #include "shared.h" #include "thread.h" -#include "timer.h" #include "locking.h" -#include "cpu_crc32.h" +#include "hashes.h" #ifdef WITH_BRAIN #include "brain.h" @@ -126,6 +121,50 @@ int sort_by_hash_no_salt (const void *v1, const void *v2, void *v3) return sort_by_digest_p0p1 (d1, d2, v3); } +int hash_encode (const hashconfig_t *hashconfig, const hashes_t *hashes, const module_ctx_t *module_ctx, char *out_buf, const int out_size, const u32 salt_pos, const u32 digest_pos) +{ + if (module_ctx->module_hash_encode == MODULE_DEFAULT) + { + return snprintf (out_buf, out_size, "%s", hashes->hashfile); + } + + salt_t *salts_buf = hashes->salts_buf; + + salts_buf += salt_pos; + + const u32 digest_cur = salts_buf[salt_pos].digests_offset + digest_pos; + + void *digests_buf = hashes->digests_buf; + void *esalts_buf = hashes->esalts_buf; + void *hook_salts_buf = hashes->hook_salts_buf; + hashinfo_t **hash_info = hashes->hash_info; + + char *digests_buf_ptr = (char *) digests_buf; + char *esalts_buf_ptr = (char *) esalts_buf; + char *hook_salts_buf_ptr = (char *) hook_salts_buf; + hashinfo_t *hash_info_ptr = NULL; + + digests_buf_ptr += digest_cur * hashconfig->dgst_size; + esalts_buf_ptr += digest_cur * hashconfig->esalt_size; + hook_salts_buf_ptr += digest_cur * hashconfig->hook_salt_size; + + if (hash_info) hash_info_ptr = hash_info[digest_cur]; + + const int out_len = module_ctx->module_hash_encode + ( + hashconfig, + digests_buf_ptr, + salts_buf, + esalts_buf_ptr, + hook_salts_buf_ptr, + hash_info_ptr, + out_buf, + out_size + ); + + return out_len; +} + int save_hash (hashcat_ctx_t *hashcat_ctx) { hashes_t *hashes = hashcat_ctx->hashes; @@ -206,7 +245,7 @@ int save_hash (hashcat_ctx_t *hashcat_ctx) fputc (separator, fp); } - const int out_len = ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_pos, digest_pos); + const int out_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_pos, digest_pos); out_buf[out_len] = 0; @@ -277,7 +316,7 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl u8 *out_buf = hashes->out_buf; - const int out_len = ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_pos, digest_pos); + const int out_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_pos, digest_pos); out_buf[out_len] = 0; diff --git a/src/interface.c b/src/interface.c index 9e3857a69..2a33c1b29 100644 --- a/src/interface.c +++ b/src/interface.c @@ -5,64 +5,18 @@ #include "common.h" #include "types.h" -#include "bitops.h" #include "memory.h" -#include "convert.h" #include "event.h" #include "shared.h" #include "opencl.h" -#include "interface.h" -#include "filehandling.h" #include "modules.h" #include "dynloader.h" +#include "interface.h" /** * parsing */ -int ascii_digest (const hashconfig_t *hashconfig, const hashes_t *hashes, const module_ctx_t *module_ctx, char *out_buf, const int out_size, const u32 salt_pos, const u32 digest_pos) -{ - void *digests_buf = hashes->digests_buf; - salt_t *salts_buf = hashes->salts_buf; - void *esalts_buf = hashes->esalts_buf; - void *hook_salts_buf = hashes->hook_salts_buf; - hashinfo_t **hash_info = hashes->hash_info; - const char *hashfile = hashes->hashfile; - - const u32 dgst_size = hashconfig->dgst_size; - const u64 esalt_size = hashconfig->esalt_size; - const u64 hook_salt_size = hashconfig->hook_salt_size; - - if (module_ctx->module_hash_encode == MODULE_DEFAULT) - { - return snprintf (out_buf, out_size, "%s", hashfile); - } - - char *digests_buf_ptr = (char *) digests_buf; - char *esalts_buf_ptr = (char *) esalts_buf; - char *hook_salts_buf_ptr = (char *) hook_salts_buf; - - const u32 digest_cur = salts_buf[salt_pos].digests_offset + digest_pos; - - hashinfo_t *hash_info_ptr = NULL; - - if (hash_info) hash_info_ptr = hash_info[digest_cur]; - - const int out_len = module_ctx->module_hash_encode - ( - hashconfig, - digests_buf_ptr + (digest_cur * dgst_size), - salts_buf + salt_pos, - esalts_buf_ptr + (digest_cur * esalt_size), - hook_salts_buf_ptr + (digest_cur * hook_salt_size), - hash_info_ptr, - out_buf, - out_size - ); - - return out_len; -} - int module_filename (const folder_config_t *folder_config, const int hash_mode, char *out_buf, const size_t out_size) { // native compiled diff --git a/src/locking.c b/src/locking.c index 86e65df87..756bb1abc 100644 --- a/src/locking.c +++ b/src/locking.c @@ -5,7 +5,6 @@ #include "common.h" #include "types.h" -#include "event.h" #include "locking.h" #if defined (F_SETLKW) diff --git a/src/logfile.c b/src/logfile.c index 02dfd9144..e0626f3f6 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -7,9 +7,9 @@ #include "types.h" #include "memory.h" #include "event.h" -#include "logfile.h" #include "locking.h" #include "shared.h" +#include "logfile.h" void logfile_generate_topid (hashcat_ctx_t *hashcat_ctx) { diff --git a/src/loopback.c b/src/loopback.c index eceb213ca..db4ab8c1d 100644 --- a/src/loopback.c +++ b/src/loopback.c @@ -8,8 +8,8 @@ #include "memory.h" #include "event.h" #include "shared.h" -#include "loopback.h" #include "locking.h" +#include "loopback.h" static void loopback_format_plain (hashcat_ctx_t *hashcat_ctx, const u8 *plain_ptr, const unsigned int plain_len) { diff --git a/src/main.c b/src/main.c index 19f03aed0..28ea88165 100644 --- a/src/main.c +++ b/src/main.c @@ -17,7 +17,6 @@ #include "terminal.h" #include "thread.h" #include "status.h" -#include "interface.h" #include "shared.h" #include "event.h" @@ -520,7 +519,7 @@ static void main_outerloop_mainscreen (MAYBE_UNUSED hashcat_ctx_t *hashcat_ctx, event_log_advice (hashcat_ctx, NULL); } } - + if (user_options->keep_guessing == true) { event_log_advice (hashcat_ctx, "ATTENTION! --keep-guessing mode is enabled."); diff --git a/src/monitor.c b/src/monitor.c index 0164391f4..2b942890f 100644 --- a/src/monitor.c +++ b/src/monitor.c @@ -6,13 +6,11 @@ #include "common.h" #include "types.h" #include "event.h" -#include "memory.h" #include "hwmon.h" #include "timer.h" #include "hashes.h" #include "thread.h" #include "restore.h" -#include "shared.h" #include "status.h" #include "monitor.h" diff --git a/src/mpsp.c b/src/mpsp.c index 932038d43..a5072776e 100644 --- a/src/mpsp.c +++ b/src/mpsp.c @@ -11,7 +11,6 @@ #include "logfile.h" #include "convert.h" #include "filehandling.h" -#include "interface.h" #include "opencl.h" #include "shared.h" #include "ext_lzma.h" diff --git a/src/opencl.c b/src/opencl.c index 6ee54ad36..75c07cdac 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -13,12 +13,9 @@ #include "rp.h" #include "rp_cpu.h" #include "mpsp.h" -#include "straight.h" -#include "combinator.h" #include "convert.h" #include "stdout.h" #include "filehandling.h" -#include "interface.h" #include "wordlist.h" #include "shared.h" #include "hashes.h" diff --git a/src/outfile.c b/src/outfile.c index d0ec8c06b..9ee259fb1 100644 --- a/src/outfile.c +++ b/src/outfile.c @@ -5,19 +5,16 @@ #include "common.h" #include "types.h" -#include "memory.h" #include "event.h" #include "convert.h" -#include "interface.h" -#include "hashes.h" #include "mpsp.h" #include "rp.h" #include "emu_inc_rp.h" #include "emu_inc_rp_optimized.h" #include "opencl.h" #include "shared.h" -#include "outfile.h" #include "locking.h" +#include "outfile.h" int build_plain (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, plain_t *plain, u32 *plain_buf, int *out_len) { diff --git a/src/outfile_check.c b/src/outfile_check.c index ffbab6088..2d3c7ee17 100644 --- a/src/outfile_check.c +++ b/src/outfile_check.c @@ -7,15 +7,12 @@ #include "types.h" #include "memory.h" #include "event.h" -#include "outfile_check.h" #include "filehandling.h" -#include "convert.h" #include "folder.h" #include "hashes.h" -#include "interface.h" #include "shared.h" #include "thread.h" -#include "bitops.h" +#include "outfile_check.h" static int sort_by_salt_buf (const void *v1, const void *v2, MAYBE_UNUSED void * v3) { diff --git a/src/pidfile.c b/src/pidfile.c index 81faac2d3..8654d41a8 100644 --- a/src/pidfile.c +++ b/src/pidfile.c @@ -7,7 +7,6 @@ #include "types.h" #include "memory.h" #include "event.h" -#include "user_options.h" #include "shared.h" #include "pidfile.h" diff --git a/src/potfile.c b/src/potfile.c index c59238684..1a8c942c1 100644 --- a/src/potfile.c +++ b/src/potfile.c @@ -5,17 +5,16 @@ #include "common.h" #include "types.h" -#include "bitops.h" #include "convert.h" #include "memory.h" #include "event.h" -#include "interface.h" +#include "hashes.h" #include "filehandling.h" #include "loopback.h" #include "outfile.h" -#include "potfile.h" #include "locking.h" #include "shared.h" +#include "potfile.h" static const char MASKED_PLAIN[] = "[notfound]"; @@ -378,7 +377,7 @@ int potfile_remove_parse (hashcat_ctx_t *hashcat_ctx) if (potfile_ctx->enabled == false) return 0; if (hashconfig->potfile_disable == true) return 0; - + if (hashconfig->opts_type & OPTS_TYPE_PT_NEVERCRACK) return 0; // if no potfile exists yet we don't need to do anything here @@ -667,11 +666,11 @@ int potfile_handle_show (hashcat_ctx_t *hashcat_ctx) u8 *out_buf = potfile_ctx->out_buf; - int out_len = ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 0, HCBUFSIZ_LARGE - 0, salt_idx, digest_idx); + int out_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 0, HCBUFSIZ_LARGE - 0, salt_idx, digest_idx); if (hash2) { - out_len += ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 16, HCBUFSIZ_LARGE - 16, salt_idx, split_neighbor); + out_len += hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 16, HCBUFSIZ_LARGE - 16, salt_idx, split_neighbor); } out_buf[out_len] = 0; @@ -755,7 +754,7 @@ int potfile_handle_show (hashcat_ctx_t *hashcat_ctx) u8 *out_buf = potfile_ctx->out_buf; - const int out_len = ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_idx, digest_idx); + const int out_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_idx, digest_idx); out_buf[out_len] = 0; @@ -875,11 +874,11 @@ int potfile_handle_left (hashcat_ctx_t *hashcat_ctx) u8 *out_buf = potfile_ctx->out_buf; - int out_len = ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 0, HCBUFSIZ_LARGE - 0, salt_idx, digest_idx); + int out_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 0, HCBUFSIZ_LARGE - 0, salt_idx, digest_idx); if (hash2) { - out_len += ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 16, HCBUFSIZ_LARGE - 16, salt_idx, split_neighbor); + out_len += hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf + 16, HCBUFSIZ_LARGE - 16, salt_idx, split_neighbor); } out_buf[out_len] = 0; @@ -928,7 +927,7 @@ int potfile_handle_left (hashcat_ctx_t *hashcat_ctx) u8 *out_buf = potfile_ctx->out_buf; - const int out_len = ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_idx, digest_idx); + const int out_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, (char *) out_buf, HCBUFSIZ_LARGE, salt_idx, digest_idx); out_buf[out_len] = 0; diff --git a/src/selftest.c b/src/selftest.c index 3f915e147..ad3909abb 100644 --- a/src/selftest.c +++ b/src/selftest.c @@ -9,7 +9,6 @@ #include "bitops.h" #include "convert.h" #include "opencl.h" -#include "interface.h" #include "thread.h" #include "selftest.h" diff --git a/src/shared.c b/src/shared.c index 007d2d0f4..7beb0e367 100644 --- a/src/shared.c +++ b/src/shared.c @@ -5,7 +5,6 @@ #include "common.h" #include "types.h" -#include "bitops.h" #include "convert.h" #include "shared.h" diff --git a/src/status.c b/src/status.c index c2cff5a7b..ed4cb9281 100644 --- a/src/status.c +++ b/src/status.c @@ -6,19 +6,17 @@ #include "common.h" #include "types.h" #include "memory.h" -#include "event.h" #include "convert.h" -#include "restore.h" #include "thread.h" #include "timer.h" -#include "interface.h" +#include "hashes.h" #include "hwmon.h" #include "outfile.h" #include "monitor.h" #include "mpsp.h" #include "terminal.h" -#include "status.h" #include "shared.h" +#include "status.h" static const char *ST_0000 = "Initializing"; static const char *ST_0001 = "Autotuning"; @@ -339,7 +337,7 @@ char *status_get_hash_target (const hashcat_ctx_t *hashcat_ctx) { char *tmp_buf = (char *) hcmalloc (HCBUFSIZ_LARGE); - const int tmp_len = ascii_digest (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, tmp_buf, HCBUFSIZ_LARGE, 0, 0); + const int tmp_len = hash_encode (hashcat_ctx->hashconfig, hashcat_ctx->hashes, hashcat_ctx->module_ctx, tmp_buf, HCBUFSIZ_LARGE, 0, 0); tmp_buf[tmp_len] = 0; diff --git a/src/straight.c b/src/straight.c index 572d4c4e1..7b45825cd 100644 --- a/src/straight.c +++ b/src/straight.c @@ -9,12 +9,10 @@ #include "event.h" #include "logfile.h" #include "shared.h" -#include "filehandling.h" #include "folder.h" #include "rp.h" -#include "rp_cpu.h" -#include "straight.h" #include "wordlist.h" +#include "straight.h" static int straight_ctx_add_wl (hashcat_ctx_t *hashcat_ctx, const char *dict) { diff --git a/src/terminal.c b/src/terminal.c index 3beab641c..d8af6099a 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -9,15 +9,12 @@ #include "event.h" #include "convert.h" #include "thread.h" -#include "timer.h" #include "status.h" -#include "restore.h" #include "shared.h" #include "hwmon.h" #include "interface.h" -#include "outfile.h" -#include "terminal.h" #include "hashcat.h" +#include "terminal.h" static const size_t TERMINAL_LINE_LENGTH = 79; diff --git a/src/thread.c b/src/thread.c index 22f4cb67e..c601955d2 100644 --- a/src/thread.c +++ b/src/thread.c @@ -5,10 +5,8 @@ #include "common.h" #include "types.h" -#include "memory.h" #include "event.h" #include "timer.h" -#include "shared.h" #include "thread.h" /* diff --git a/src/tuningdb.c b/src/tuningdb.c index 8418c8a9d..91425f306 100644 --- a/src/tuningdb.c +++ b/src/tuningdb.c @@ -5,17 +5,11 @@ #include "common.h" #include "types.h" -#include "interface.h" -#include "timer.h" #include "event.h" #include "memory.h" #include "filehandling.h" -#include "ext_OpenCL.h" -#include "tuningdb.h" -#include "thread.h" -#include "opencl.h" -#include "hashes.h" #include "shared.h" +#include "tuningdb.h" static int sort_by_tuning_db_alias (const void *v1, const void *v2) { diff --git a/src/usage.c b/src/usage.c index bc4ba0d02..f30873c57 100644 --- a/src/usage.c +++ b/src/usage.c @@ -5,9 +5,9 @@ #include "common.h" #include "types.h" +#include "memory.h" #include "shared.h" #include "interface.h" -#include "memory.h" #include "usage.h" static const char *const USAGE_MINI[] = diff --git a/src/user_options.c b/src/user_options.c index 87d7fe061..07a9d89b3 100644 --- a/src/user_options.c +++ b/src/user_options.c @@ -11,7 +11,6 @@ #include "interface.h" #include "shared.h" #include "usage.h" -#include "outfile.h" #include "opencl.h" #include "user_options.h" diff --git a/src/wordlist.c b/src/wordlist.c index 94db879d9..bafc9a2dd 100644 --- a/src/wordlist.c +++ b/src/wordlist.c @@ -9,7 +9,6 @@ #include "event.h" #include "convert.h" #include "dictstat.h" -#include "thread.h" #include "rp.h" #include "rp_cpu.h" #include "shared.h"