Fledge68 / WiiFlow_Lite

My mod of the Wii USB Loader WiiFlow
459 stars 58 forks source link

Ignore USB storage devices with unknown partition types #343

Closed kcpants closed 1 year ago

kcpants commented 1 year ago

This fix adds a sanity check to the loop in __usbstorage_ogc_IsInserted which reads the MBR sector of the USB storage drive and skips over drives whose partition type is "Unknown" (according to the logic in the PartFromType function defined in PartitionHandle.cpp). Since the relevant cpp structs and functions defined in PartitionHandle are not available, we access the raw byte containing the partition type directly by calculating its offset within the MBR sector.

eku commented 1 year ago

Does this also work with drives hidden via USTEALTH?

kcpants commented 1 year ago

Yes, I can confirm this fix is compatible with drives hidden with Ustealth. The Wii USB drive attached to my Wii U is hidden with ustealth.

Ustealth alters the bytes that are used to identify the boot sector as MBR but leaves the "partition bytes" untouched.