mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Implement decoding High Sierra path table.
This commit is contained in:
@@ -35,5 +35,39 @@ namespace DiscImageChef.Filesystems.ISO9660
|
|||||||
|
|
||||||
return table.ToArray();
|
return table.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PathTableEntryInternal[] DecodeHighSierraPathTable(byte[] data)
|
||||||
|
{
|
||||||
|
if(data is null) return null;
|
||||||
|
|
||||||
|
List<PathTableEntryInternal> table = new List<PathTableEntryInternal>();
|
||||||
|
|
||||||
|
int off = 0;
|
||||||
|
while(off < data.Length)
|
||||||
|
{
|
||||||
|
HighSierraPathTableEntry entry =
|
||||||
|
Marshal.ByteArrayToStructureBigEndian<HighSierraPathTableEntry>(data, off,
|
||||||
|
Marshal
|
||||||
|
.SizeOf<HighSierraPathTableEntry
|
||||||
|
>());
|
||||||
|
|
||||||
|
if(entry.name_len == 0) break;
|
||||||
|
|
||||||
|
off += Marshal.SizeOf<HighSierraPathTableEntry>();
|
||||||
|
|
||||||
|
string name = Encoding.GetString(data, off, entry.name_len);
|
||||||
|
|
||||||
|
table.Add(new PathTableEntryInternal
|
||||||
|
{
|
||||||
|
Extent = entry.start_lbn, Name = name, Parent = entry.parent_dirno
|
||||||
|
});
|
||||||
|
|
||||||
|
off += entry.name_len;
|
||||||
|
|
||||||
|
if(entry.name_len % 2 != 0) off++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return table.ToArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -199,7 +199,7 @@ namespace DiscImageChef.Filesystems.ISO9660
|
|||||||
fsFormat = "ISO9660";
|
fsFormat = "ISO9660";
|
||||||
}
|
}
|
||||||
|
|
||||||
pathTable = DecodePathTable(pathTableData);
|
pathTable = highSierra ? DecodeHighSierraPathTable(pathTableData) : DecodePathTable(pathTableData);
|
||||||
|
|
||||||
// High Sierra and CD-i do not support Joliet or RRIP
|
// High Sierra and CD-i do not support Joliet or RRIP
|
||||||
if((highSierra || cdi) && this.@namespace != Namespace.Normal && this.@namespace != Namespace.Vms)
|
if((highSierra || cdi) && this.@namespace != Namespace.Normal && this.@namespace != Namespace.Vms)
|
||||||
|
|||||||
Reference in New Issue
Block a user