Grub4dos never resolve .lnk files. Users should avoid opening .lnk files from within grub4dos.
Sure it does not, noone asks that, but it should treat the file "normally" when cat --hex read, write and dd, etc.
The issue was found when it was attempted to copy .lnk files.
If you prefer one need to use "raw" on *any* command, something that normally isn't used, IMHO (though I understand how at this time it is probably not possible anymore to correct the behaviour) the autodetection feature should be limited to only (say) the map command and an added "expand" parameter added to the other command if one really-really need to expand the lzma and gzip files.
As I see it, out of a multitude of generic commands that may be used on a poor, innocent file, only a few of them actually *need* expansion of a compressed file, and in those case the user actually:
1) knows that the file is compressed
2) actually wants to decompress it
This way with auto-recognition, a said particularly with LZMA that - unlike gzip - has not a "fixed" header, the risk of mis-recognition has moved from extremely rare/impossible (gzip) to rather possible and as we have seen there is an used (even if not very common) format that is mis-recognized as LZMA.
Most probably the "best" option for the future would be to remove suppor for LZMA_Alone (leaving the .gzip one) and replace it with .xz format:
http://fileformats.a...wiki/LZMA_Alone
which has a "proper" header:
Header Magic Bytes
The first six (6) bytes of the Stream are so called Header
Magic Bytes. They can be used to identify the file type.
Using a C array and ASCII:
const uint8_t HEADER_MAGIC[6]
= { 0xFD, '7', 'z', 'X', 'Z', 0x00 };
In plain hexadecimal:
FD 37 7A 58 5A 00
Notes:
- The first byte (0xFD) was chosen so that the files cannot
be erroneously detected as being in .lzma format, in which
the first byte is in the range [0x00, 0xE0].
- The sixth byte (0x00) was chosen to prevent applications
from misdetecting the file as a text file.
If the Header Magic Bytes don't match, the decoder MUST
indicate an error.
Wonko