mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Check FAT's EA file has correct magic.
This commit is contained in:
@@ -80,6 +80,8 @@ namespace DiscImageChef.Filesystems.FAT
|
|||||||
const byte LFN_ERASED = 0x80;
|
const byte LFN_ERASED = 0x80;
|
||||||
const byte LFN_LAST = 0x40;
|
const byte LFN_LAST = 0x40;
|
||||||
const byte LFN_MASK = 0x1F;
|
const byte LFN_MASK = 0x1F;
|
||||||
|
const ushort EADATA_MAGIC = 0x4445;
|
||||||
|
const ushort EASCTR_MAGIC = 0x4145;
|
||||||
|
|
||||||
readonly (string hash, string name)[] knownBootHashes =
|
readonly (string hash, string name)[] knownBootHashes =
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -602,6 +602,18 @@ namespace DiscImageChef.Filesystems.FAT
|
|||||||
cultureInfo = new CultureInfo("en-US", false);
|
cultureInfo = new CultureInfo("en-US", false);
|
||||||
directoryCache = new Dictionary<string, Dictionary<string, DirectoryEntry>>();
|
directoryCache = new Dictionary<string, Dictionary<string, DirectoryEntry>>();
|
||||||
|
|
||||||
|
// Check it is really an OS/2 EA file
|
||||||
|
if(eaDirEntry.start_cluster != 0)
|
||||||
|
{
|
||||||
|
ulong secadd = firstClusterSector + eaDirEntry.start_cluster * sectorsPerCluster;
|
||||||
|
byte[] eadata =
|
||||||
|
imagePlugin.ReadSectors(firstClusterSector + eaDirEntry.start_cluster * sectorsPerCluster,
|
||||||
|
sectorsPerCluster);
|
||||||
|
ushort eamagic = BitConverter.ToUInt16(eadata, 0);
|
||||||
|
|
||||||
|
if(eamagic != EADATA_MAGIC) eaDirEntry = new DirectoryEntry();
|
||||||
|
}
|
||||||
|
|
||||||
mounted = true;
|
mounted = true;
|
||||||
return Errno.NoError;
|
return Errno.NoError;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,6 @@
|
|||||||
// Copyright © 2011-2019 Natalia Portillo
|
// Copyright © 2011-2019 Natalia Portillo
|
||||||
// ****************************************************************************/
|
// ****************************************************************************/
|
||||||
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using DiscImageChef.CommonTypes.Structs;
|
using DiscImageChef.CommonTypes.Structs;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user