String values in evtx files sometimes contain embedded newlines, which are CRLF because they're written on Windows. In the attached exmaple, the value starting at offset 0x19472 is one such:
evtxexport writes these string values to stdout witout altering them. Because stdout is a text stream, it translates \n to the platform-appropriate line ending. On Windows the \r\n which ends each line in the above string has its \n translated to \r\n, while on Unix the \n remains an \n. The result is that in evtxexport's output, string values with embedded line endings have \r\r\n in them on Windows and \r\n in them on Unix---neither of which is a platform-appropriate line ending.
The correct thing to do is to translate the \r\n in these strings to \n before writing them to stdout, as then stdout will produce the platform-appropriate line ending. (Note that switching stdout to binary mode would not fix the problem, as in that case the line endings would remain \r\n on Unix.)
This is a long way of just asking to make end of lines in the output of record strings platform aware. This is not a high priority for me seeing compatibility issues in specific projects keep me preoccupied.
String values in evtx files sometimes contain embedded newlines, which are CRLF because they're written on Windows. In the attached exmaple, the value starting at offset 0x19472 is one such:
Application.evtx.gz
evtxexport writes these string values to stdout witout altering them. Because stdout is a text stream, it translates
\n
to the platform-appropriate line ending. On Windows the\r\n
which ends each line in the above string has its\n
translated to\r\n
, while on Unix the\n
remains an\n
. The result is that in evtxexport's output, string values with embedded line endings have\r\r\n
in them on Windows and\r\n
in them on Unix---neither of which is a platform-appropriate line ending.The correct thing to do is to translate the
\r\n
in these strings to\n
before writing them to stdout, as then stdout will produce the platform-appropriate line ending. (Note that switching stdout to binary mode would not fix the problem, as in that case the line endings would remain\r\n
on Unix.)