1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-22 16:18:09 +00:00

Increase buffer size for --example-hashes output

This commit is contained in:
jsteube 2019-04-08 17:36:26 +02:00
parent 4579ddb5b2
commit 92f4ccce93
5 changed files with 15 additions and 14 deletions

View File

@ -104,6 +104,7 @@ but this is nededed for VS compiler which doesn't have inline keyword but has __
#define SALT_MAX_OLD 51 #define SALT_MAX_OLD 51
#define HCBUFSIZ_TINY 0x1000 #define HCBUFSIZ_TINY 0x1000
#define HCBUFSIZ_SMALL 0x2000
#define HCBUFSIZ_LARGE 0xb0000 #define HCBUFSIZ_LARGE 0xb0000
#define CPT_CACHE 0x20000 #define CPT_CACHE 0x20000

View File

@ -1519,7 +1519,7 @@ typedef struct outfile_ctx
typedef struct pot typedef struct pot
{ {
char plain_buf[HCBUFSIZ_TINY]; char plain_buf[HCBUFSIZ_SMALL];
int plain_len; int plain_len;
hash_t hash; hash_t hash;
@ -1614,7 +1614,7 @@ typedef struct out
{ {
FILE *fp; FILE *fp;
char buf[HCBUFSIZ_TINY]; char buf[HCBUFSIZ_SMALL];
int len; int len;
} out_t; } out_t;
@ -2180,11 +2180,11 @@ typedef struct hashlist_parse
typedef struct event_ctx typedef struct event_ctx
{ {
char old_buf[MAX_OLD_EVENTS][HCBUFSIZ_TINY]; char old_buf[MAX_OLD_EVENTS][HCBUFSIZ_SMALL];
size_t old_len[MAX_OLD_EVENTS]; size_t old_len[MAX_OLD_EVENTS];
int old_cnt; int old_cnt;
char msg_buf[HCBUFSIZ_TINY]; char msg_buf[HCBUFSIZ_SMALL];
size_t msg_len; size_t msg_len;
bool msg_newline; bool msg_newline;

View File

@ -91,7 +91,7 @@ size_t event_log_advice_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...)
va_start (ap, fmt); va_start (ap, fmt);
event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_TINY - 1); event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_SMALL - 1);
va_end (ap); va_end (ap);
} }
@ -119,7 +119,7 @@ size_t event_log_info_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...)
va_start (ap, fmt); va_start (ap, fmt);
event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_TINY - 1); event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_SMALL - 1);
va_end (ap); va_end (ap);
} }
@ -147,7 +147,7 @@ size_t event_log_warning_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...)
va_start (ap, fmt); va_start (ap, fmt);
event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_TINY - 1); event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_SMALL - 1);
va_end (ap); va_end (ap);
} }
@ -175,7 +175,7 @@ size_t event_log_error_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...)
va_start (ap, fmt); va_start (ap, fmt);
event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_TINY - 1); event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_SMALL - 1);
va_end (ap); va_end (ap);
} }
@ -203,7 +203,7 @@ size_t event_log_advice (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...)
va_start (ap, fmt); va_start (ap, fmt);
event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_TINY - 1); event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_SMALL - 1);
va_end (ap); va_end (ap);
} }
@ -231,7 +231,7 @@ size_t event_log_info (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...)
va_start (ap, fmt); va_start (ap, fmt);
event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_TINY - 1); event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_SMALL - 1);
va_end (ap); va_end (ap);
} }
@ -259,7 +259,7 @@ size_t event_log_warning (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...)
va_start (ap, fmt); va_start (ap, fmt);
event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_TINY - 1); event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_SMALL - 1);
va_end (ap); va_end (ap);
} }
@ -287,7 +287,7 @@ size_t event_log_error (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...)
va_start (ap, fmt); va_start (ap, fmt);
event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_TINY - 1); event_ctx->msg_len = event_log (fmt, ap, event_ctx->msg_buf, HCBUFSIZ_SMALL - 1);
va_end (ap); va_end (ap);
} }

View File

@ -836,7 +836,7 @@ int potfile_handle_show (hashcat_ctx_t *hashcat_ctx)
if (is_collider_hex_password == true) if (is_collider_hex_password == true)
{ {
u8 pass_unhexified[HCBUFSIZ_TINY] = { 0 }; u8 pass_unhexified[HCBUFSIZ_SMALL] = { 0 };
const size_t pass_unhexified_len = exec_unhexify ((u8 *) hash->pw_buf, hash->pw_len, pass_unhexified, sizeof (pass_unhexified)); const size_t pass_unhexified_len = exec_unhexify ((u8 *) hash->pw_buf, hash->pw_len, pass_unhexified, sizeof (pass_unhexified));

View File

@ -44,7 +44,7 @@ static void out_push (out_t *out, const u8 *pw_buf, const int pw_len)
#endif #endif
if (out->len >= HCBUFSIZ_TINY - 300) if (out->len >= HCBUFSIZ_SMALL - 300)
{ {
out_flush (out); out_flush (out);
} }