mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add support for ISO9660 Enhanced Volume Descriptors.
This commit is contained in:
@@ -52,6 +52,7 @@ namespace DiscImageChef.Filesystems.ISO9660
|
||||
PathTableEntryInternal[] pathTable;
|
||||
Dictionary<string, DecodedDirectoryEntry> rootDirectoryCache;
|
||||
FileSystemInfo statfs;
|
||||
bool useEvd;
|
||||
bool usePathTable;
|
||||
bool useTransTbl;
|
||||
|
||||
@@ -65,7 +66,9 @@ namespace DiscImageChef.Filesystems.ISO9660
|
||||
new (string name, Type type, string description)[]
|
||||
{
|
||||
("use_path_table", typeof(bool), "Use path table for directory traversal"),
|
||||
("use_trans_tbl", typeof(bool), "Use TRANS.TBL for filenames")
|
||||
("use_trans_tbl", typeof(bool), "Use TRANS.TBL for filenames"),
|
||||
("use_evd", typeof(bool),
|
||||
"If present, use Enhanced Volume Descriptor with specified encoding (overrides namespace)")
|
||||
};
|
||||
|
||||
public Dictionary<string, string> Namespaces =>
|
||||
|
||||
@@ -110,6 +110,7 @@ namespace DiscImageChef.Filesystems.ISO9660
|
||||
int hsOff = 0;
|
||||
if(highSierra) hsOff = 8;
|
||||
bool cdi = false;
|
||||
bool evd = false;
|
||||
|
||||
while(true)
|
||||
{
|
||||
@@ -181,11 +182,16 @@ namespace DiscImageChef.Filesystems.ISO9660
|
||||
Marshal.ByteArrayToStructureLittleEndian<PrimaryVolumeDescriptor>(vdSector);
|
||||
|
||||
// Check if this is Joliet
|
||||
if(svd.escape_sequences[0] == '%' && svd.escape_sequences[1] == '/')
|
||||
if(svd.escape_sequences[2] == '@' || svd.escape_sequences[2] == 'C' ||
|
||||
svd.escape_sequences[2] == 'E') jolietvd = svd;
|
||||
else
|
||||
DicConsole.WriteLine("ISO9660 plugin", "Found unknown supplementary volume descriptor");
|
||||
if(svd.version == 1)
|
||||
{
|
||||
if(svd.escape_sequences[0] == '%' && svd.escape_sequences[1] == '/')
|
||||
if(svd.escape_sequences[2] == '@' || svd.escape_sequences[2] == 'C' ||
|
||||
svd.escape_sequences[2] == 'E') jolietvd = svd;
|
||||
else
|
||||
DicConsole.WriteLine("ISO9660 plugin",
|
||||
"Found unknown supplementary volume descriptor");
|
||||
}
|
||||
else evd = true;
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -469,6 +475,7 @@ namespace DiscImageChef.Filesystems.ISO9660
|
||||
if(rrip) isoMetadata.AppendLine("Rock Ridge Interchange Protocol present.");
|
||||
if(aaip) isoMetadata.AppendLine("Arbitrary Attribute Interchange Protocol present.");
|
||||
if(ziso) isoMetadata.AppendLine("zisofs compression present.");
|
||||
if(evd) isoMetadata.AppendLine("Contains Enhanved Volume Descriptor.");
|
||||
if(bvd != null)
|
||||
isoMetadata.AppendFormat("Disc bootable following {0} specifications.", bootSpec).AppendLine();
|
||||
if(segaCd != null)
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace DiscImageChef.Filesystems.ISO9660
|
||||
bool.TryParse(usePathTableString, out usePathTable);
|
||||
if(options.TryGetValue("use_trans_tbl", out string useTransTblString))
|
||||
bool.TryParse(useTransTblString, out useTransTbl);
|
||||
if(options.TryGetValue("use_evd", out string useEvdString)) bool.TryParse(useEvdString, out useEvd);
|
||||
|
||||
// Default namespace
|
||||
if(@namespace is null) @namespace = "joliet";
|
||||
@@ -133,12 +134,24 @@ namespace DiscImageChef.Filesystems.ISO9660
|
||||
PrimaryVolumeDescriptor svd =
|
||||
Marshal.ByteArrayToStructureLittleEndian<PrimaryVolumeDescriptor>(vdSector);
|
||||
|
||||
// TODO: Other escape sequences
|
||||
// Check if this is Joliet
|
||||
if(svd.escape_sequences[0] == '%' && svd.escape_sequences[1] == '/')
|
||||
if(svd.escape_sequences[2] == '@' || svd.escape_sequences[2] == 'C' ||
|
||||
svd.escape_sequences[2] == 'E') jolietvd = svd;
|
||||
else
|
||||
DicConsole.WriteLine("ISO9660 plugin", "Found unknown supplementary volume descriptor");
|
||||
if(svd.version == 1)
|
||||
{
|
||||
if(svd.escape_sequences[0] == '%' && svd.escape_sequences[1] == '/')
|
||||
if(svd.escape_sequences[2] == '@' || svd.escape_sequences[2] == 'C' ||
|
||||
svd.escape_sequences[2] == 'E') jolietvd = svd;
|
||||
else
|
||||
DicConsole.WriteLine("ISO9660 plugin",
|
||||
"Found unknown supplementary volume descriptor");
|
||||
}
|
||||
else if(useEvd)
|
||||
{
|
||||
// Basically until escape sequences are implemented, let the user chose the encoding.
|
||||
// This is the same as user chosing Romeo namespace, but using the EVD instead of the PVD
|
||||
this.@namespace = Namespace.Romeo;
|
||||
pvd = svd;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user