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

Actual use of --outfile-autohex-disable was lost during refactoring. Fixes https://github.com/hashcat/hashcat/issues/567

This commit is contained in:
jsteube 2016-11-04 22:12:25 +01:00
parent 6fdb2bfca4
commit fb8fb6b21d
4 changed files with 9 additions and 7 deletions

View File

@ -1174,7 +1174,7 @@ typedef struct outfile_ctx
FILE *fp;
u32 outfile_format;
u32 outfile_autohex;
bool outfile_autohex;
} outfile_ctx_t;

View File

@ -326,8 +326,9 @@ void outfile_write_close (hashcat_ctx_t *hashcat_ctx)
int outfile_write (hashcat_ctx_t *hashcat_ctx, const char *out_buf, const unsigned char *plain_ptr, const u32 plain_len, const u64 crackpos, const unsigned char *username, const u32 user_len, char tmp_buf[HCBUFSIZ_LARGE])
{
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
const outfile_ctx_t *outfile_ctx = hashcat_ctx->outfile_ctx;
const hashconfig_t *hashconfig = hashcat_ctx->hashconfig;
const outfile_ctx_t *outfile_ctx = hashcat_ctx->outfile_ctx;
const user_options_t *user_options = hashcat_ctx->user_options;
int tmp_len = 0;
@ -366,7 +367,7 @@ int outfile_write (hashcat_ctx_t *hashcat_ctx, const char *out_buf, const unsign
if (outfile_ctx->outfile_format & OUTFILE_FMT_PLAIN)
{
if (need_hexify (plain_ptr, plain_len) == true)
if ((user_options->outfile_autohex == true) && (need_hexify (plain_ptr, plain_len) == true))
{
tmp_buf[tmp_len++] = '$';
tmp_buf[tmp_len++] = 'H';

View File

@ -267,7 +267,8 @@ void potfile_write_close (hashcat_ctx_t *hashcat_ctx)
void potfile_write_append (hashcat_ctx_t *hashcat_ctx, const char *out_buf, u8 *plain_ptr, unsigned int plain_len)
{
potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx;
const potfile_ctx_t *potfile_ctx = hashcat_ctx->potfile_ctx;
const user_options_t *user_options = hashcat_ctx->user_options;
if (potfile_ctx->enabled == false) return;
@ -290,7 +291,7 @@ void potfile_write_append (hashcat_ctx_t *hashcat_ctx, const char *out_buf, u8 *
if (1)
{
if (need_hexify (plain_ptr, plain_len) == true)
if ((user_options->outfile_autohex == true) && (need_hexify (plain_ptr, plain_len) == true))
{
tmp_buf[tmp_len++] = '$';
tmp_buf[tmp_len++] = 'H';

View File

@ -285,7 +285,7 @@ int user_options_getopt (hashcat_ctx_t *hashcat_ctx, int argc, char **argv)
case IDX_OUTFILE: user_options->outfile = optarg; break;
case IDX_OUTFILE_FORMAT: user_options->outfile_format = atoi (optarg);
user_options->outfile_format_chgd = true; break;
case IDX_OUTFILE_AUTOHEX_DISABLE: user_options->outfile_autohex = 0; break;
case IDX_OUTFILE_AUTOHEX_DISABLE: user_options->outfile_autohex = false; break;
case IDX_OUTFILE_CHECK_TIMER: user_options->outfile_check_timer = atoi (optarg); break;
case IDX_HEX_CHARSET: user_options->hex_charset = true; break;
case IDX_HEX_SALT: user_options->hex_salt = true; break;