2017-07-19 16:31:08 +01:00
|
|
|
|
// /***************************************************************************
|
2020-02-27 12:31:25 +00:00
|
|
|
|
// Aaru Data Preservation Suite
|
2016-09-15 01:54:13 +01:00
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
2022-12-07 13:07:31 +00:00
|
|
|
|
// Filename : Info.cs
|
2016-09-15 01:54:13 +01:00
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
|
//
|
2016-09-15 01:54:40 +01:00
|
|
|
|
// Component : Universal Disk Format plugin.
|
2016-09-15 01:54:13 +01:00
|
|
|
|
//
|
|
|
|
|
|
// --[ License ] --------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// This library is free software; you can redistribute it and/or modify
|
|
|
|
|
|
// it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
|
// published by the Free Software Foundation; either version 2.1 of the
|
|
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
|
//
|
|
|
|
|
|
// This library is distributed in the hope that it will be useful, but
|
|
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
|
|
//
|
|
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
|
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2024-12-19 10:45:18 +00:00
|
|
|
|
// Copyright © 2011-2025 Natalia Portillo
|
2016-09-15 01:54:13 +01:00
|
|
|
|
// ****************************************************************************/
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2016-09-15 01:54:13 +01:00
|
|
|
|
using System;
|
2020-07-20 07:47:12 +01:00
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2017-07-19 16:31:08 +01:00
|
|
|
|
using System.Linq;
|
2016-09-15 01:54:40 +01:00
|
|
|
|
using System.Text;
|
2022-12-15 22:21:07 +00:00
|
|
|
|
using Aaru.CommonTypes.AaruMetadata;
|
2021-09-19 21:16:47 +01:00
|
|
|
|
using Aaru.CommonTypes.Enums;
|
2020-02-27 00:33:26 +00:00
|
|
|
|
using Aaru.CommonTypes.Interfaces;
|
2020-07-20 15:43:52 +01:00
|
|
|
|
using Aaru.Helpers;
|
2025-08-17 05:50:25 +01:00
|
|
|
|
using Aaru.Logging;
|
2022-12-15 22:21:07 +00:00
|
|
|
|
using Partition = Aaru.CommonTypes.Partition;
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
namespace Aaru.Filesystems;
|
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
// TODO: Detect bootable
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
|
/// <summary>Implements detection of the Universal Disk Format filesystem</summary>
|
|
|
|
|
|
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
2022-12-07 13:07:31 +00:00
|
|
|
|
public sealed partial class UDF
|
2016-09-15 01:54:13 +01:00
|
|
|
|
{
|
2023-10-03 23:22:08 +01:00
|
|
|
|
#region IFilesystem Members
|
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
|
public bool Identify(IMediaImage imagePlugin, Partition partition)
|
|
|
|
|
|
{
|
|
|
|
|
|
// UDF needs at least that
|
2024-05-01 04:05:22 +01:00
|
|
|
|
if(partition.End - partition.Start < 256) return false;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
// UDF needs at least that
|
2024-05-01 04:05:22 +01:00
|
|
|
|
if(imagePlugin.Info.SectorSize < 512) return false;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2023-10-04 17:34:40 +01:00
|
|
|
|
var anchor = new AnchorVolumeDescriptorPointer();
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
// All positions where anchor may reside, with the ratio between 512 and 2048bps
|
|
|
|
|
|
ulong[][] positions =
|
2024-05-01 04:39:38 +01:00
|
|
|
|
[
|
|
|
|
|
|
[256, 1], [512, 1], [partition.End - 256, 1], [partition.End, 1], [1024, 4], [2048, 4],
|
|
|
|
|
|
[partition.End - 1024, 4], [partition.End - 4, 4]
|
|
|
|
|
|
];
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-10-22 14:28:58 +01:00
|
|
|
|
var anchorFound = false;
|
2023-10-04 08:44:14 +01:00
|
|
|
|
uint ratio = 1;
|
|
|
|
|
|
byte[] sector = null;
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-11-15 01:35:06 +00:00
|
|
|
|
foreach(ulong[] position in from position in
|
|
|
|
|
|
positions.Where(position =>
|
|
|
|
|
|
position[0] + partition.Start + position[1] <=
|
2023-10-04 17:34:40 +01:00
|
|
|
|
partition.End &&
|
|
|
|
|
|
position[0] < partition.End)
|
2025-10-22 14:28:58 +01:00
|
|
|
|
let errno =
|
2025-10-23 03:07:43 +01:00
|
|
|
|
imagePlugin.ReadSectors(position[0],
|
|
|
|
|
|
false,
|
|
|
|
|
|
(uint)position[1],
|
|
|
|
|
|
out sector,
|
|
|
|
|
|
out _)
|
2023-10-03 23:22:08 +01:00
|
|
|
|
where errno == ErrorNumber.NoError
|
|
|
|
|
|
select position)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
{
|
|
|
|
|
|
anchor = Marshal.ByteArrayToStructureLittleEndian<AnchorVolumeDescriptorPointer>(sector);
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.Debug(MODULE_NAME, "anchor.tag.tagIdentifier = {0}", anchor.tag.tagIdentifier);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.Debug(MODULE_NAME, "anchor.tag.descriptorVersion = {0}", anchor.tag.descriptorVersion);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.Debug(MODULE_NAME, "anchor.tag.tagChecksum = 0x{0:X2}", anchor.tag.tagChecksum);
|
|
|
|
|
|
AaruLogging.Debug(MODULE_NAME, "anchor.tag.reserved = {0}", anchor.tag.reserved);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.Debug(MODULE_NAME, "anchor.tag.tagSerialNumber = {0}", anchor.tag.tagSerialNumber);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.Debug(MODULE_NAME, "anchor.tag.descriptorCrc = 0x{0:X4}", anchor.tag.descriptorCrc);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-10-22 14:28:58 +01:00
|
|
|
|
AaruLogging.Debug(MODULE_NAME, "anchor.tag.descriptorCrcLength = {0}", anchor.tag.descriptorCrcLength);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.Debug(MODULE_NAME, "anchor.tag.tagLocation = {0}", anchor.tag.tagLocation);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.Debug(MODULE_NAME,
|
2025-10-22 14:28:58 +01:00
|
|
|
|
"anchor.mainVolumeDescriptorSequenceExtent.length = {0}",
|
|
|
|
|
|
anchor.mainVolumeDescriptorSequenceExtent.length);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.Debug(MODULE_NAME,
|
2025-10-22 14:28:58 +01:00
|
|
|
|
"anchor.mainVolumeDescriptorSequenceExtent.location = {0}",
|
|
|
|
|
|
anchor.mainVolumeDescriptorSequenceExtent.location);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.Debug(MODULE_NAME,
|
2025-10-22 14:28:58 +01:00
|
|
|
|
"anchor.reserveVolumeDescriptorSequenceExtent.length = {0}",
|
|
|
|
|
|
anchor.reserveVolumeDescriptorSequenceExtent.length);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-08-17 06:11:22 +01:00
|
|
|
|
AaruLogging.Debug(MODULE_NAME,
|
2025-10-22 14:28:58 +01:00
|
|
|
|
"anchor.reserveVolumeDescriptorSequenceExtent.location = {0}",
|
|
|
|
|
|
anchor.reserveVolumeDescriptorSequenceExtent.location);
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(anchor.tag.tagIdentifier != TagIdentifier.AnchorVolumeDescriptorPointer ||
|
2022-03-07 07:36:44 +00:00
|
|
|
|
anchor.tag.tagLocation != position[0] / position[1] ||
|
2023-10-03 23:22:08 +01:00
|
|
|
|
anchor.mainVolumeDescriptorSequenceExtent.location * position[1] + partition.Start >= partition.End)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
continue;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
anchorFound = true;
|
|
|
|
|
|
ratio = (uint)position[1];
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2024-05-01 04:05:22 +01:00
|
|
|
|
if(!anchorFound) return false;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
ulong count = 0;
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
while(count < 256)
|
|
|
|
|
|
{
|
|
|
|
|
|
ErrorNumber errno =
|
2024-05-01 04:05:22 +01:00
|
|
|
|
imagePlugin.ReadSectors(partition.Start +
|
|
|
|
|
|
anchor.mainVolumeDescriptorSequenceExtent.location * ratio +
|
|
|
|
|
|
count * ratio,
|
2025-10-23 03:07:43 +01:00
|
|
|
|
false,
|
2024-05-01 04:05:22 +01:00
|
|
|
|
ratio,
|
2025-10-22 14:28:58 +01:00
|
|
|
|
out sector,
|
|
|
|
|
|
out _);
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(errno != ErrorNumber.NoError)
|
2016-09-15 01:54:40 +01:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
count++;
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
}
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2025-10-22 14:28:58 +01:00
|
|
|
|
var tagId = (TagIdentifier)BitConverter.ToUInt16(sector, 0);
|
|
|
|
|
|
var location = BitConverter.ToUInt32(sector, 0x0C);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2023-10-03 23:22:08 +01:00
|
|
|
|
if(location == partition.Start / ratio + anchor.mainVolumeDescriptorSequenceExtent.location + count)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
{
|
2024-05-01 04:05:22 +01:00
|
|
|
|
if(tagId == TagIdentifier.TerminatingDescriptor) break;
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(tagId == TagIdentifier.LogicalVolumeDescriptor)
|
2016-09-15 01:54:40 +01:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
LogicalVolumeDescriptor lvd =
|
|
|
|
|
|
Marshal.ByteArrayToStructureLittleEndian<LogicalVolumeDescriptor>(sector);
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
return _magic.SequenceEqual(lvd.domainIdentifier.identifier);
|
2016-09-15 01:54:40 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
|
else
|
|
|
|
|
|
break;
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
count++;
|
2016-09-15 01:54:13 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
/// <inheritdoc />
|
2022-12-17 22:41:56 +00:00
|
|
|
|
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
|
|
|
|
|
|
out FileSystem metadata)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
{
|
|
|
|
|
|
information = "";
|
|
|
|
|
|
ErrorNumber errno;
|
2022-12-17 22:41:56 +00:00
|
|
|
|
metadata = new FileSystem();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
// UDF is always UTF-8
|
2022-12-17 23:17:18 +00:00
|
|
|
|
encoding = Encoding.UTF8;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
byte[] sector;
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
var sbInformation = new StringBuilder();
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sbInformation.AppendLine(Localization.Universal_Disk_Format);
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
var anchor = new AnchorVolumeDescriptorPointer();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
// All positions where anchor may reside, with the ratio between 512 and 2048bps
|
|
|
|
|
|
ulong[][] positions =
|
2024-05-01 04:39:38 +01:00
|
|
|
|
[
|
|
|
|
|
|
[256, 1], [512, 1], [partition.End - 256, 1], [partition.End, 1], [1024, 4], [2048, 4],
|
|
|
|
|
|
[partition.End - 1024, 4], [partition.End - 4, 4]
|
|
|
|
|
|
];
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
uint ratio = 1;
|
2021-06-03 13:56:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
foreach(ulong[] position in positions)
|
|
|
|
|
|
{
|
2025-10-23 03:07:43 +01:00
|
|
|
|
errno = imagePlugin.ReadSectors(position[0], false, (uint)position[1], out sector, out _);
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2024-05-01 04:05:22 +01:00
|
|
|
|
if(errno != ErrorNumber.NoError) continue;
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
anchor = Marshal.ByteArrayToStructureLittleEndian<AnchorVolumeDescriptorPointer>(sector);
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(anchor.tag.tagIdentifier != TagIdentifier.AnchorVolumeDescriptorPointer ||
|
|
|
|
|
|
anchor.tag.tagLocation != position[0] / position[1] ||
|
|
|
|
|
|
anchor.mainVolumeDescriptorSequenceExtent.location + partition.Start >= partition.End)
|
|
|
|
|
|
continue;
|
2021-06-03 13:56:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
ratio = (uint)position[1];
|
2021-06-03 13:56:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
ulong count = 0;
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-11-13 20:27:32 +00:00
|
|
|
|
var pvd = new PrimaryVolumeDescriptor();
|
|
|
|
|
|
var lvd = new LogicalVolumeDescriptor();
|
|
|
|
|
|
var lvidiu = new LogicalVolumeIntegrityDescriptorImplementationUse();
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
while(count < 256)
|
|
|
|
|
|
{
|
2024-05-01 04:05:22 +01:00
|
|
|
|
errno = imagePlugin.ReadSectors(partition.Start +
|
|
|
|
|
|
anchor.mainVolumeDescriptorSequenceExtent.location * ratio +
|
|
|
|
|
|
count * ratio,
|
2025-10-23 03:07:43 +01:00
|
|
|
|
false,
|
2024-05-01 04:05:22 +01:00
|
|
|
|
ratio,
|
2025-10-22 14:28:58 +01:00
|
|
|
|
out sector,
|
|
|
|
|
|
out _);
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2024-05-01 04:05:22 +01:00
|
|
|
|
if(errno != ErrorNumber.NoError) continue;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-10-22 14:28:58 +01:00
|
|
|
|
var tagId = (TagIdentifier)BitConverter.ToUInt16(sector, 0);
|
|
|
|
|
|
var location = BitConverter.ToUInt32(sector, 0x0C);
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2023-10-03 23:22:08 +01:00
|
|
|
|
if(location == partition.Start / ratio + anchor.mainVolumeDescriptorSequenceExtent.location + count)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
{
|
2024-05-01 04:05:22 +01:00
|
|
|
|
if(tagId == TagIdentifier.TerminatingDescriptor) break;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
switch(tagId)
|
2016-09-15 01:54:40 +01:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
case TagIdentifier.LogicalVolumeDescriptor:
|
|
|
|
|
|
lvd = Marshal.ByteArrayToStructureLittleEndian<LogicalVolumeDescriptor>(sector);
|
|
|
|
|
|
|
2020-02-29 18:03:35 +00:00
|
|
|
|
break;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
case TagIdentifier.PrimaryVolumeDescriptor:
|
|
|
|
|
|
pvd = Marshal.ByteArrayToStructureLittleEndian<PrimaryVolumeDescriptor>(sector);
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
break;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
count++;
|
|
|
|
|
|
}
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2025-10-23 03:07:43 +01:00
|
|
|
|
errno = imagePlugin.ReadSectors(lvd.integritySequenceExtent.location * ratio, false, ratio, out sector, out _);
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2024-05-01 04:05:22 +01:00
|
|
|
|
if(errno != ErrorNumber.NoError) return;
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-11-13 20:27:32 +00:00
|
|
|
|
LogicalVolumeIntegrityDescriptor lvid =
|
|
|
|
|
|
Marshal.ByteArrayToStructureLittleEndian<LogicalVolumeIntegrityDescriptor>(sector);
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(lvid.tag.tagIdentifier == TagIdentifier.LogicalVolumeIntegrityDescriptor &&
|
|
|
|
|
|
lvid.tag.tagLocation == lvd.integritySequenceExtent.location)
|
2023-10-03 23:22:08 +01:00
|
|
|
|
{
|
2024-05-01 04:05:22 +01:00
|
|
|
|
lvidiu = Marshal.ByteArrayToStructureLittleEndian<LogicalVolumeIntegrityDescriptorImplementationUse>(sector,
|
|
|
|
|
|
(int)(lvid.numberOfPartitions * 8 + 80),
|
|
|
|
|
|
System.Runtime.InteropServices.Marshal.SizeOf(lvidiu));
|
2023-10-03 23:22:08 +01:00
|
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
|
else
|
|
|
|
|
|
lvid = new LogicalVolumeIntegrityDescriptor();
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2024-05-01 04:05:22 +01:00
|
|
|
|
sbInformation.AppendFormat(Localization.Volume_is_number_0_of_1,
|
|
|
|
|
|
pvd.volumeSequenceNumber,
|
|
|
|
|
|
pvd.maximumVolumeSequenceNumber)
|
|
|
|
|
|
.AppendLine();
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sbInformation.AppendFormat(Localization.Volume_set_identifier_0,
|
2024-05-01 04:05:22 +01:00
|
|
|
|
StringHandlers.DecompressUnicode(pvd.volumeSetIdentifier))
|
|
|
|
|
|
.AppendLine();
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2024-05-01 04:05:22 +01:00
|
|
|
|
sbInformation
|
|
|
|
|
|
.AppendFormat(Localization.Volume_name_0, StringHandlers.DecompressUnicode(lvd.logicalVolumeIdentifier))
|
|
|
|
|
|
.AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sbInformation.AppendFormat(Localization.Volume_uses_0_bytes_per_block, lvd.logicalBlockSize).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2024-05-01 04:05:22 +01:00
|
|
|
|
sbInformation.AppendFormat(Localization.Volume_was_last_written_on_0, EcmaToDateTime(lvid.recordingDateTime))
|
|
|
|
|
|
.AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sbInformation.AppendFormat(Localization.Volume_contains_0_partitions, lvid.numberOfPartitions).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2024-05-01 04:05:22 +01:00
|
|
|
|
sbInformation
|
|
|
|
|
|
.AppendFormat(Localization.Volume_contains_0_files_and_1_directories, lvidiu.files, lvidiu.directories)
|
|
|
|
|
|
.AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sbInformation.AppendFormat(Localization.Volume_conforms_to_0,
|
2024-05-01 04:05:22 +01:00
|
|
|
|
encoding.GetString(lvd.domainIdentifier.identifier).TrimEnd('\u0000'))
|
|
|
|
|
|
.AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sbInformation.AppendFormat(Localization.Volume_was_last_written_by_0,
|
2024-05-01 04:05:22 +01:00
|
|
|
|
encoding.GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000'))
|
|
|
|
|
|
.AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sbInformation.AppendFormat(Localization.Volume_requires_UDF_version_0_1_to_be_read,
|
2022-03-06 13:29:38 +00:00
|
|
|
|
Convert.ToInt32($"{(lvidiu.minimumReadUDF & 0xFF00) >> 8}", 10),
|
2024-05-01 04:05:22 +01:00
|
|
|
|
Convert.ToInt32($"{lvidiu.minimumReadUDF & 0xFF}", 10))
|
|
|
|
|
|
.AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sbInformation.AppendFormat(Localization.Volume_requires_UDF_version_0_1_to_be_written_to,
|
2022-03-06 13:29:38 +00:00
|
|
|
|
Convert.ToInt32($"{(lvidiu.minimumWriteUDF & 0xFF00) >> 8}", 10),
|
2024-05-01 04:05:22 +01:00
|
|
|
|
Convert.ToInt32($"{lvidiu.minimumWriteUDF & 0xFF}", 10))
|
|
|
|
|
|
.AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sbInformation.AppendFormat(Localization.Volume_cannot_be_written_by_any_UDF_version_higher_than_0_1,
|
2022-03-06 13:29:38 +00:00
|
|
|
|
Convert.ToInt32($"{(lvidiu.maximumWriteUDF & 0xFF00) >> 8}", 10),
|
2024-05-01 04:05:22 +01:00
|
|
|
|
Convert.ToInt32($"{lvidiu.maximumWriteUDF & 0xFF}", 10))
|
|
|
|
|
|
.AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-12-17 22:41:56 +00:00
|
|
|
|
metadata = new FileSystem
|
2022-03-06 13:29:38 +00:00
|
|
|
|
{
|
2022-12-15 22:21:07 +00:00
|
|
|
|
Type = FS_TYPE,
|
2022-12-17 23:17:18 +00:00
|
|
|
|
ApplicationIdentifier = encoding.GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000'),
|
2022-12-15 22:21:07 +00:00
|
|
|
|
ClusterSize = lvd.logicalBlockSize,
|
|
|
|
|
|
ModificationDate = EcmaToDateTime(lvid.recordingDateTime),
|
|
|
|
|
|
Files = lvidiu.files,
|
|
|
|
|
|
VolumeName = StringHandlers.DecompressUnicode(lvd.logicalVolumeIdentifier),
|
|
|
|
|
|
VolumeSetIdentifier = StringHandlers.DecompressUnicode(pvd.volumeSetIdentifier),
|
|
|
|
|
|
VolumeSerial = StringHandlers.DecompressUnicode(pvd.volumeSetIdentifier),
|
2022-12-17 23:17:18 +00:00
|
|
|
|
SystemIdentifier = encoding.GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000')
|
2022-03-06 13:29:38 +00:00
|
|
|
|
};
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-12-17 22:41:56 +00:00
|
|
|
|
metadata.Clusters = (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / metadata.ClusterSize;
|
2016-09-15 01:54:40 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
information = sbInformation.ToString();
|
|
|
|
|
|
}
|
2023-10-03 23:22:08 +01:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
2016-09-15 01:54:40 +01:00
|
|
|
|
}
|