vstinner / hachoir

Hachoir is a Python library to view and edit a binary stream field by field
http://hachoir.readthedocs.io/
GNU General Public License v2.0
604 stars 70 forks source link

Cannot display FAT structure on mtools-generated image #89

Open ydirson opened 1 year ago

ydirson commented 1 year ago

Hachoir (from Debian 3.1.0+dfsg-3) can parse the structure of a FAT image created by mkfs.msdos (showing first 0x200 bytes as Boot, then both FAT copies, and root directory), but on an image created by mtools (specifically mformat -i "test-mtools.img" ::.) it reports a MasterBootRecord partition table followed by only RawBytes, whereas those should be identified as a FAT.

Could this be the presence of a non-empty partition table causing 2 different dissectors to be used?

vstinner commented 1 year ago

Well, it seems like the parser is incomplete / has issues. You can dig into the code and propose a fix :-)

ydirson commented 1 year ago

I'm unlikely to find the time for this, as going this far proved not necessary to get the cause of the glitch I was after. I'll leave this as an exercise for another potential contributor ;)

vstinner commented 1 year ago

Sadly, I'm no longer working on that project but @nneonneo is still hacking it sometimes :-)

nneonneo commented 1 year ago

Hello! Can you provide a sample file for me to look at? I do still hack on hachoir and still use it pretty often :)