Matmaus / LnkParse3

Windows Shortcut file (LNK) parser
MIT License
63 stars 13 forks source link

bugfix: Decode text data correctly #7

Closed ernix closed 3 years ago

ernix commented 3 years ago

The main decoding problem of this module was caused by picking ASCII-ish bytes from binary data randomly. clean_line and .replace(b"\x00", b"") were everywhere.

In fact, Unicode strings are stored as UTF-16LE, and ASCII strings are stored as Active CodePage that defined in each Windows machines. I added -c/--codepage option because we can't determine which code page was used for ASCII strings (I guess that's also why Unicode strings are also attached to LNK data structure)

Thanks

Matmaus commented 3 years ago

Thank you for this fix and explanation :+1: I have no remarks.