Added support for ziso extensions to ISO9660.

This commit is contained in:
2017-10-09 12:21:38 +01:00
parent a02ef2c4d6
commit d6efae3143
3 changed files with 35 additions and 1 deletions

View File

@@ -59,6 +59,10 @@ namespace DiscImageChef.Filesystems.ISO9660
const ushort RRIP_RelocatedDir = 0x5245; // "RE"
const ushort RRIP_Timestamps = 0x5446; // "TF"
const ushort RRIP_Sparse = 0x5346; // "SF"
const ulong ziso_header_magic = 0x37E45396C9DBD607;
const ulong ziso_header_cigam = 0x07D6DBC99653E437;
const ushort ziso_Magic = 0x5A46; // "ZF"
const ushort ziso_PagedZlib = 0x707A; // "pz"
[Flags]
enum FileFlags : byte

View File

@@ -257,6 +257,7 @@ namespace DiscImageChef.Filesystems.ISO9660
bool Apple = false;
bool SUSP = false;
bool RRIP = false;
bool ziso = false;
List<ContinuationArea> contareas = new List<ContinuationArea>();
List<byte[]> refareas = new List<byte[]>();
StringBuilder suspInformation = new StringBuilder();
@@ -375,7 +376,9 @@ namespace DiscImageChef.Filesystems.ISO9660
nextSignature == RRIP_Name || nextSignature == RRIP_Childlink ||
nextSignature == RRIP_Parentlink || nextSignature == RRIP_RelocatedDir ||
nextSignature == RRIP_Timestamps || nextSignature == RRIP_Sparse;
ziso |= nextSignature == ziso_Magic;
sa_off += sa[sa_off + 2];
if(nextSignature == SUSP_Terminator)
@@ -431,6 +434,8 @@ namespace DiscImageChef.Filesystems.ISO9660
nextSignature == RRIP_Parentlink || nextSignature == RRIP_RelocatedDir ||
nextSignature == RRIP_Timestamps || nextSignature == RRIP_Sparse;
ziso |= nextSignature == ziso_Magic;
ca_off += ca_data[ca_off + 2];
}
}
@@ -472,6 +477,8 @@ namespace DiscImageChef.Filesystems.ISO9660
ISOMetadata.AppendLine("System Use Sharing Protocol present.");
if(RRIP)
ISOMetadata.AppendLine("Rock Ridge Interchange Protocol present.");
if(ziso)
ISOMetadata.AppendLine("zisofs compression present.");
if(bvd != null)
ISOMetadata.AppendFormat("Disc bootable following {0} specifications.", BootSpec).AppendLine();
if(SegaCD != null)

View File

@@ -609,6 +609,29 @@ namespace DiscImageChef.Filesystems.ISO9660
public byte table_depth;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ZisofsHeader
{
public ulong magic;
public uint uncomp_len;
public uint uncomp_len_be;
public byte header_size; // Shifted >> 2
public byte block_size_log; // log2(block_size)
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ZisofsEntry
{
public ushort signature;
public byte length;
public byte version;
public ushort alogirhtm;
public byte header_size; // Shifted >> 2
public byte block_size_log; // log2(block_size)
public uint uncomp_len;
public uint uncomp_len_be;
}
struct DecodedVolumeDescriptor
{
public string SystemIdentifier;