diff --git a/docs/changes.txt b/docs/changes.txt index 30a321b32..bcfe489a5 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -22,6 +22,7 @@ - Replace RegGetValue() with RegQueryValueEx() to enable Windows XP 32 bit compatibility - Slightly increased NVidias rule-processing performance by using generic instructions instead of byte_perm() - Add support for @ rule (RULE_OP_MANGLE_PURGECHAR) to use on GPU +- Add support for --outfile (short -o) to be used together with --stdout ## ## Bugs diff --git a/src/hashcat.c b/src/hashcat.c index 1af559b55..eab467860 100644 --- a/src/hashcat.c +++ b/src/hashcat.c @@ -2544,7 +2544,18 @@ static void process_stdout (hc_device_param_t *device_param, const uint pws_cnt) { out_t out; - out.fp = stdout; + out.fp = stdout; + + if (data.outfile != NULL) + { + if ((out.fp = fopen (data.outfile, "ab")) == NULL) + { + log_error ("ERROR: %s: %s", data.outfile, strerror (errno)); + + out.fp = stdout; + } + } + out.len = 0; uint plain_buf[16] = { 0 }; @@ -2712,6 +2723,11 @@ static void process_stdout (hc_device_param_t *device_param, const uint pws_cnt) } out_flush (&out); + + if (out.fp != stdout) + { + fclose (out.fp); + } } static void save_hash ()