You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.)
The text was updated successfully, but these errors were encountered:
joachimmetz
changed the title
evtexport improperly handles newlines embedded in strings
have evtexport handle CRLF platform dependent in embedded in strings
May 3, 2018
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.)The text was updated successfully, but these errors were encountered: