From d41a093f0abc0036b125df05cfc520ec7bf85bfd Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Mon, 19 Feb 2018 18:33:15 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BPrevent=20some=20FAT=20BPBs=20to=20?= =?UTF-8?q?false=20positive=20as=20PC-98=20partition=20tables.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DiscImageChef.Partitions/PC98.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DiscImageChef.Partitions/PC98.cs b/DiscImageChef.Partitions/PC98.cs index 35315707..2e0239a7 100644 --- a/DiscImageChef.Partitions/PC98.cs +++ b/DiscImageChef.Partitions/PC98.cs @@ -56,6 +56,9 @@ namespace DiscImageChef.Partitions byte[] sector = imagePlugin.ReadSector(1); if(bootSector[bootSector.Length - 2] != 0x55 || bootSector[bootSector.Length - 1] != 0xAA) return false; + // Prevent false positives with some FAT BPBs + if(Encoding.ASCII.GetString(bootSector, 0x36, 3) == "FAT") return false; + IntPtr tablePtr = Marshal.AllocHGlobal(256); Marshal.Copy(sector, 0, tablePtr, 256); PC98Table table = (PC98Table)Marshal.PtrToStructure(tablePtr, typeof(PC98Table));