nathanhi / pyfatfs

Python based FAT12/FAT16/FAT32 implementation with VFAT support
https://pypi.org/project/pyfatfs/
MIT License
29 stars 14 forks source link

Support FAT12/FAT16 disks without extended signature #1

Closed akx closed 4 years ago

akx commented 4 years ago

If the BootSig field isn't 0x28/0x29, we shouldn't try to verify BS_FilSysType.

Found this out via the Excel 5.0 floppies over at https://winworldpc.com/product/microsoft-excel/5x (which don't all work even with this fix).

nathanhi commented 4 years ago

First of all: Sorry for the delay! Seems like I completely missed the notification! Thanks for your contribution, amazing!

Yes, FAT12 support needs some further love, that's something I planned before releasing 1.0.0.

Extended boot signature. (Should be 0x29[5][6][7][28] to indicate that an EBPB with the following 3 entries exists (since OS/2 1.2 and DOS 4.0). Can be 0x28 on some OS/2 1.0-1.1 and PC DOS 3.4 disks indicating an earlier form of the EBPB format with only the serial number following. MS-DOS/PC DOS 4.0 and higher, OS/2 1.2 and higher as well as the Windows NT family recognize both signatures accordingly.) https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#Extended_BIOS_Parameter_Block

Seems like something that should be kept in mind for further development. The current implementation completely relies on Microsoft EFI FAT32 File System Specification v1.03 and I haven't yet thrown a bunch of random disk images at it yet.

nathanhi commented 4 years ago

@akx Would you mind telling me, which disk images and/or operations were problematic for you? I was able to list the files in all disk images I tried so far:

image

Have you been trying the Mac formatted disks? In that case I don't think they are FAT formatted

akx commented 4 years ago

@nathanhi Ugh, it's been a while, I can't really remember. Did you try to read the data too?

I ended up using mtools' mcopy for extraction in the end (for https://github.com/akx/res-extract).

nathanhi commented 4 years ago

Yes, I tried listing directories as well as accessing files / comparing SHA256 checksums:

image

mtools is a perfect solution if you don't need it portable without installing extra binaries. In case you want to give pyfat another whirl, let me know if you still encounter issues / feel free to open up an issue. Thanks again for your contribution!