From 4e4209e6c6d7daea5701eb440f61ea23edcdf6a2 Mon Sep 17 00:00:00 2001 From: philsmd Date: Sat, 9 Jul 2022 12:02:59 +0200 Subject: [PATCH] avoid OPTS_TYPE_HASH_COPY, just use digest_buf in -m 26200 = OpenEdge --- src/modules/module_26200.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/modules/module_26200.c b/src/modules/module_26200.c index c7cc91cae..5eadad2fe 100644 --- a/src/modules/module_26200.c +++ b/src/modules/module_26200.c @@ -23,8 +23,7 @@ static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE | OPTI_TYPE_NOT_ITERATED | OPTI_TYPE_NOT_SALTED; static const u64 OPTS_TYPE = OPTS_TYPE_STOCK_MODULE - | OPTS_TYPE_PT_GENERATE_LE - | OPTS_TYPE_HASH_COPY; + | OPTS_TYPE_PT_GENERATE_LE; static const u32 SALT_TYPE = SALT_TYPE_NONE; static const char *ST_PASS = "hashcat"; static const char *ST_HASH = "lebVZteiEsdpkncc"; @@ -116,7 +115,15 @@ int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSE int module_hash_encode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const void *digest_buf, MAYBE_UNUSED const salt_t *salt, MAYBE_UNUSED const void *esalt_buf, MAYBE_UNUSED const void *hook_salt_buf, MAYBE_UNUSED const hashinfo_t *hash_info, char *line_buf, MAYBE_UNUSED const int line_size) { - const int line_len = snprintf (line_buf, line_size, "%s", hash_info->orighash); + char *digest = (char *) digest_buf; + + char buf[16 + 1] = { 0 }; + + memcpy (buf, digest, 16); + + buf[16] = 0; + + const int line_len = snprintf (line_buf, line_size, "%s", buf); return line_len; }