From 61eebfa91631c231afbacd6578f16355e83ee086 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 25 Jun 2020 23:05:43 +0100 Subject: [PATCH] If use path table option is indicated in ISO9660, use it also for the root directory. --- Aaru.Filesystems/ISO9660/Super.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/Aaru.Filesystems/ISO9660/Super.cs b/Aaru.Filesystems/ISO9660/Super.cs index 9da63534e..069b35271 100644 --- a/Aaru.Filesystems/ISO9660/Super.cs +++ b/Aaru.Filesystems/ISO9660/Super.cs @@ -358,6 +358,30 @@ namespace Aaru.Filesystems.ISO9660 if(usePathTable && pathTableData.Length == 1) usePathTable = false; + if(usePathTable && !cdi) + { + rootLocation = pathTable[0].Extent; + + byte[] firstRootSector = ReadSector(rootLocation); + + if(highSierra) + { + HighSierraDirectoryRecord rootEntry = + Marshal.ByteArrayToStructureLittleEndian(firstRootSector); + + rootSize = rootEntry.size; + } + else + { + DirectoryRecord rootEntry = + Marshal.ByteArrayToStructureLittleEndian(firstRootSector); + + rootSize = rootEntry.size; + } + + rootXattrLength = pathTable[0].XattrLength; + } + try { byte[] rootDir = ReadSingleExtent(0, rootSize, rootLocation);