Add support for dumping the 2nd layer PFI of DVDs.

This commit is contained in:
2025-12-14 11:23:54 +00:00
parent c92b3f636a
commit 1aa8271d62
7 changed files with 58 additions and 1 deletions

View File

@@ -384,7 +384,10 @@ public enum MediaTagType
MiniDiscDTOC = 72, MiniDiscDTOC = 72,
/// <summary>Decrypted DVD disc key</summary> /// <summary>Decrypted DVD disc key</summary>
[Description("Disc key (Decrypted)")] [Description("Disc key (Decrypted)")]
DVD_DiscKey_Decrypted = 73 DVD_DiscKey_Decrypted = 73,
/// <summary>Physical Format Information for the 2nd layer of dual-layer DVDs</summary>
[Description("Physical Format Information (2nd Layer)")]
DVD_PFI_2ndLayer = 74
} }
/// <summary>Enumeration of media types defined in metadata</summary> /// <summary>Enumeration of media types defined in metadata</summary>

View File

@@ -420,6 +420,33 @@ partial class Dump
DiskCategory.UMD => MediaType.UMD, DiskCategory.UMD => MediaType.UMD,
_ => MediaType.DVDROM _ => MediaType.DVDROM
}; };
if(nullablePfi.Value.Layers > 1)
{
sense = _dev.ReadDiscStructure(out cmdBuf,
out _,
MmcDiscStructureMediaType.Dvd,
0,
1,
MmcDiscStructureFormat.PhysicalInformation,
0,
_dev.Timeout,
out _);
if(!sense)
{
PFI.PhysicalFormatInformation? layer2Pfi = PFI.Decode(cmdBuf, dskType);
if(layer2Pfi.HasValue)
{
tmpBuf = new byte[cmdBuf.Length - 4];
Array.Copy(cmdBuf, 4, tmpBuf, 0, cmdBuf.Length - 4);
mediaTags.Add(MediaTagType.DVD_PFI_2ndLayer, tmpBuf);
UpdateStatus?.Invoke("Layer 2 PFI:\n" + PFI.Prettify(layer2Pfi.Value));
}
}
}
} }
} }

View File

@@ -566,6 +566,20 @@ public static class ImageInfo
} }
} }
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DVD_PFI_2ndLayer) == true)
{
errno = imageFormat.ReadMediaTag(MediaTagType.DVD_PFI_2ndLayer, out byte[] pfi);
if(errno == ErrorNumber.NoError)
{
AaruLogging.WriteLine(Localization.Core
.DVD_2nd_layer_Physical_Format_Information_contained_in_image_WithMarkup);
AaruLogging.Write(PFI.Prettify(pfi, imageFormat.Info.MediaType));
AaruLogging.WriteLine();
}
}
if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DVDRAM_DDS) == true) if(imageFormat.Info.ReadableMediaTags?.Contains(MediaTagType.DVDRAM_DDS) == true)
{ {
errno = imageFormat.ReadMediaTag(MediaTagType.DVDRAM_DDS, out byte[] dds); errno = imageFormat.ReadMediaTag(MediaTagType.DVDRAM_DDS, out byte[] dds);

View File

@@ -210,6 +210,7 @@ public sealed partial class DecodeMediaTagsViewModel : ViewModelBase
break; break;
case MediaTagType.DVD_PFI: case MediaTagType.DVD_PFI:
case MediaTagType.DVD_PFI_2ndLayer:
DecodedText = PFI.Prettify(value.Data, _mediaType); DecodedText = PFI.Prettify(value.Data, _mediaType);
if(string.IsNullOrEmpty(DecodedText)) DecodedVisible = false; if(string.IsNullOrEmpty(DecodedText)) DecodedVisible = false;

View File

@@ -6892,5 +6892,11 @@ namespace Aaru.Localization {
return ResourceManager.GetString("Media_identified_as", resourceCulture); return ResourceManager.GetString("Media_identified_as", resourceCulture);
} }
} }
public static string DVD_2nd_layer_Physical_Format_Information_contained_in_image_WithMarkup {
get {
return ResourceManager.GetString("DVD_2nd_layer_Physical_Format_Information_contained_in_image_WithMarkup", resourceCulture);
}
}
} }
} }

View File

@@ -3496,4 +3496,7 @@ No tiene sentido hacerlo y supondría demasiado esfuerzo para la cinta.</value>
<data name="XML_type_0" xml:space="preserve"> <data name="XML_type_0" xml:space="preserve">
<value>[slateblue1]Tipo XML:[/] [italic][rosybrown]{0}[/][/]</value> <value>[slateblue1]Tipo XML:[/] [italic][rosybrown]{0}[/][/]</value>
</data> </data>
<data name="DVD_2nd_layer_Physical_Format_Information_contained_in_image_WithMarkup" xml:space="preserve">
<value>[bold][blue]Información del formato físico del DVD (2ª capa) contenida en la imagen:[/][/]</value>
</data>
</root> </root>

View File

@@ -3517,4 +3517,7 @@ It has no sense to do it, and it will put too much strain on the tape.</value>
<data name="Media_identified_as" xml:space="preserve"> <data name="Media_identified_as" xml:space="preserve">
<value>Media identified as</value> <value>Media identified as</value>
</data> </data>
<data name="DVD_2nd_layer_Physical_Format_Information_contained_in_image_WithMarkup" xml:space="preserve">
<value>[bold][blue]DVD 2nd layer Physical Format Information contained in image:[/][/]</value>
</data>
</root> </root>