mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Decode "TF" system area.
This commit is contained in:
@@ -1,9 +1,20 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using DiscImageChef.Helpers;
|
||||||
|
|
||||||
namespace DiscImageChef.Filesystems.ISO9660
|
namespace DiscImageChef.Filesystems.ISO9660
|
||||||
{
|
{
|
||||||
public partial class ISO9660
|
public partial class ISO9660
|
||||||
{
|
{
|
||||||
|
DateTime? DecodeIsoDateTime(byte[] timestamp)
|
||||||
|
{
|
||||||
|
switch(timestamp?.Length)
|
||||||
|
{
|
||||||
|
case 7: return DecodeIsoDateTime(Marshal.ByteArrayToStructureLittleEndian<IsoTimestamp>(timestamp));
|
||||||
|
case 17: return DateHandlers.Iso9660ToDateTime(timestamp);
|
||||||
|
default: return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DateTime? DecodeIsoDateTime(IsoTimestamp timestamp)
|
DateTime? DecodeIsoDateTime(IsoTimestamp timestamp)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -528,6 +528,65 @@ namespace DiscImageChef.Filesystems.ISO9660
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
case RRIP_TIMESTAMPS:
|
case RRIP_TIMESTAMPS:
|
||||||
|
byte tfLength = data[systemAreaOff + 2];
|
||||||
|
|
||||||
|
Timestamps timestamps =
|
||||||
|
Marshal.ByteArrayToStructureLittleEndian<Timestamps>(data, systemAreaOff,
|
||||||
|
Marshal.SizeOf<Timestamps>());
|
||||||
|
|
||||||
|
int tfOff = systemAreaOff + Marshal.SizeOf<Timestamps>();
|
||||||
|
int tfLen = timestamps.flags.HasFlag(TimestampFlags.LongFormat) ? 17 : 7;
|
||||||
|
|
||||||
|
if(timestamps.flags.HasFlag(TimestampFlags.Creation))
|
||||||
|
{
|
||||||
|
entry.RripCreation = new byte[tfLen];
|
||||||
|
Array.Copy(data, tfOff, entry.RripCreation, 0, tfLen);
|
||||||
|
tfOff += tfLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(timestamps.flags.HasFlag(TimestampFlags.Modification))
|
||||||
|
{
|
||||||
|
entry.RripModify = new byte[tfLen];
|
||||||
|
Array.Copy(data, tfOff, entry.RripModify, 0, tfLen);
|
||||||
|
tfOff += tfLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(timestamps.flags.HasFlag(TimestampFlags.Access))
|
||||||
|
{
|
||||||
|
entry.RripAccess = new byte[tfLen];
|
||||||
|
Array.Copy(data, tfOff, entry.RripAccess, 0, tfLen);
|
||||||
|
tfOff += tfLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(timestamps.flags.HasFlag(TimestampFlags.AttributeChange))
|
||||||
|
{
|
||||||
|
entry.RripAttributeChange = new byte[tfLen];
|
||||||
|
Array.Copy(data, tfOff, entry.RripAttributeChange, 0, tfLen);
|
||||||
|
tfOff += tfLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(timestamps.flags.HasFlag(TimestampFlags.Backup))
|
||||||
|
{
|
||||||
|
entry.RripBackup = new byte[tfLen];
|
||||||
|
Array.Copy(data, tfOff, entry.RripBackup, 0, tfLen);
|
||||||
|
tfOff += tfLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(timestamps.flags.HasFlag(TimestampFlags.Expiration))
|
||||||
|
{
|
||||||
|
entry.RripExpiration = new byte[tfLen];
|
||||||
|
Array.Copy(data, tfOff, entry.RripExpiration, 0, tfLen);
|
||||||
|
tfOff += tfLen;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(timestamps.flags.HasFlag(TimestampFlags.Effective))
|
||||||
|
{
|
||||||
|
entry.RripEffective = new byte[tfLen];
|
||||||
|
Array.Copy(data, tfOff, entry.RripEffective, 0, tfLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
systemAreaOff += tfLength;
|
||||||
|
break;
|
||||||
case RRIP_SPARSE:
|
case RRIP_SPARSE:
|
||||||
case SUSP_CONTINUATION:
|
case SUSP_CONTINUATION:
|
||||||
case SUSP_PADDING:
|
case SUSP_PADDING:
|
||||||
|
|||||||
@@ -186,6 +186,15 @@ namespace DiscImageChef.Filesystems.ISO9660
|
|||||||
stat.DeviceNo = (entry.PosixDeviceNumber.Value.dev_t_high << 32) +
|
stat.DeviceNo = (entry.PosixDeviceNumber.Value.dev_t_high << 32) +
|
||||||
entry.PosixDeviceNumber.Value.dev_t_low;
|
entry.PosixDeviceNumber.Value.dev_t_low;
|
||||||
|
|
||||||
|
if(entry.RripModify != null) stat.LastWriteTimeUtc = DecodeIsoDateTime(entry.RripModify);
|
||||||
|
|
||||||
|
if(entry.RripAccess != null) stat.AccessTimeUtc = DecodeIsoDateTime(entry.RripAccess);
|
||||||
|
|
||||||
|
if(entry.RripAttributeChange != null)
|
||||||
|
stat.StatusChangeTimeUtc = DecodeIsoDateTime(entry.RripAttributeChange);
|
||||||
|
|
||||||
|
if(entry.RripBackup != null) stat.BackupTimeUtc = DecodeIsoDateTime(entry.RripBackup);
|
||||||
|
|
||||||
if(entry.AssociatedFile is null || entry.AssociatedFile.Extent == 0 || entry.AssociatedFile.Size == 0)
|
if(entry.AssociatedFile is null || entry.AssociatedFile.Extent == 0 || entry.AssociatedFile.Size == 0)
|
||||||
return Errno.NoError;
|
return Errno.NoError;
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,13 @@ namespace DiscImageChef.Filesystems.ISO9660
|
|||||||
public PosixDeviceNumber? PosixDeviceNumber;
|
public PosixDeviceNumber? PosixDeviceNumber;
|
||||||
public DecodedDirectoryEntry ResourceFork;
|
public DecodedDirectoryEntry ResourceFork;
|
||||||
public byte[] RockRidgeAlternateName;
|
public byte[] RockRidgeAlternateName;
|
||||||
|
public byte[] RripAccess;
|
||||||
|
public byte[] RripAttributeChange;
|
||||||
|
public byte[] RripBackup;
|
||||||
|
public byte[] RripCreation;
|
||||||
|
public byte[] RripEffective;
|
||||||
|
public byte[] RripExpiration;
|
||||||
|
public byte[] RripModify;
|
||||||
public uint Size;
|
public uint Size;
|
||||||
public DateTime? Timestamp;
|
public DateTime? Timestamp;
|
||||||
public ushort VolumeSequenceNumber;
|
public ushort VolumeSequenceNumber;
|
||||||
|
|||||||
Reference in New Issue
Block a user