mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-10 10:56:57 +00:00
Let's try a new library for this instead
This commit is contained in:
330
BinaryObjectScanner.Printing/AACSMediaKeyBlock.cs
Normal file
330
BinaryObjectScanner.Printing/AACSMediaKeyBlock.cs
Normal file
@@ -0,0 +1,330 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using SabreTools.Models.AACS;
|
||||
|
||||
namespace BinaryObjectScanner.Printing
|
||||
{
|
||||
public static class AACSMediaKeyBlock
|
||||
{
|
||||
public static void Print(StringBuilder builder, MediaKeyBlock mediaKeyBlock)
|
||||
{
|
||||
builder.AppendLine("AACS Media Key Block Information:");
|
||||
builder.AppendLine("-------------------------");
|
||||
builder.AppendLine();
|
||||
|
||||
Print(builder, mediaKeyBlock.Records);
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, Record[] records)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, Record?[]? records)
|
||||
#endif
|
||||
{
|
||||
builder.AppendLine(" Records Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (records == null || records.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No records");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < records.Length; i++)
|
||||
{
|
||||
var record = records[i];
|
||||
Print(builder, record, i);
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, Record record, int index)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, Record? record, int index)
|
||||
#endif
|
||||
{
|
||||
builder.AppendLine($" Record Entry {index}");
|
||||
if (record == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Record type: {record.RecordType} (0x{record.RecordType:X})");
|
||||
builder.AppendLine($" Record length: {record.RecordLength} (0x{record.RecordLength:X})");
|
||||
|
||||
switch (record)
|
||||
{
|
||||
case EndOfMediaKeyBlockRecord eomkb:
|
||||
Print(builder, eomkb);
|
||||
break;
|
||||
case ExplicitSubsetDifferenceRecord esd:
|
||||
Print(builder, esd);
|
||||
break;
|
||||
case MediaKeyDataRecord mkd:
|
||||
Print(builder, mkd);
|
||||
break;
|
||||
case SubsetDifferenceIndexRecord sdi:
|
||||
Print(builder, sdi);
|
||||
break;
|
||||
case TypeAndVersionRecord tav:
|
||||
Print(builder, tav);
|
||||
break;
|
||||
case DriveRevocationListRecord drl:
|
||||
Print(builder, drl);
|
||||
break;
|
||||
case HostRevocationListRecord hrl:
|
||||
Print(builder, hrl);
|
||||
break;
|
||||
case VerifyMediaKeyRecord vmk:
|
||||
Print(builder, vmk);
|
||||
break;
|
||||
case CopyrightRecord c:
|
||||
Print(builder, c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, EndOfMediaKeyBlockRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, EndOfMediaKeyBlockRecord record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Signature data: {(record.SignatureData == null ? "[NULL]" : BitConverter.ToString(record.SignatureData).Replace('-', ' '))}");
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, ExplicitSubsetDifferenceRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, ExplicitSubsetDifferenceRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Subset Differences:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (record?.SubsetDifferences == null || record.SubsetDifferences.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No subset differences");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = 0; j < record.SubsetDifferences.Length; j++)
|
||||
{
|
||||
var sd = record.SubsetDifferences[j];
|
||||
builder.AppendLine($" Subset Difference {j}");
|
||||
if (sd == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AppendLine($" Mask: {sd.Mask} (0x{sd.Mask:X})");
|
||||
builder.AppendLine($" Number: {sd.Number} (0x{sd.Number:X})");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, MediaKeyDataRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, MediaKeyDataRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Media Keys:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (record?.MediaKeyData == null || record.MediaKeyData.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No media keys");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = 0; j < record.MediaKeyData.Length; j++)
|
||||
{
|
||||
var mk = record.MediaKeyData[j];
|
||||
builder.AppendLine($" Media key {j}: {(mk == null ? "[NULL]" : BitConverter.ToString(mk).Replace('-', ' '))}");
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, SubsetDifferenceIndexRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, SubsetDifferenceIndexRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Span: {record.Span} (0x{record.Span:X})");
|
||||
builder.AppendLine($" Offsets:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (record.Offsets == null || record.Offsets.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No offsets");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = 0; j < record.Offsets.Length; j++)
|
||||
{
|
||||
var offset = record.Offsets[j];
|
||||
builder.AppendLine($" Offset {j}: {offset} (0x{offset:X})");
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, TypeAndVersionRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, TypeAndVersionRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Media key block type: {record.MediaKeyBlockType} (0x{record.MediaKeyBlockType:X})");
|
||||
builder.AppendLine($" Version number: {record.VersionNumber} (0x{record.VersionNumber:X})");
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, DriveRevocationListRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, DriveRevocationListRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Total number of entries: {record.TotalNumberOfEntries} (0x{record.TotalNumberOfEntries:X})");
|
||||
builder.AppendLine($" Signature Blocks:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (record.SignatureBlocks == null || record.SignatureBlocks.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No signature blocks");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = 0; j < record.SignatureBlocks.Length; j++)
|
||||
{
|
||||
var block = record.SignatureBlocks[j];
|
||||
builder.AppendLine($" Signature Block {j}");
|
||||
if (block == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Number of entries: {block.NumberOfEntries}");
|
||||
builder.AppendLine($" Entry Fields:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (block.EntryFields == null || block.EntryFields.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No entry fields");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int k = 0; k < block.EntryFields.Length; k++)
|
||||
{
|
||||
var ef = block.EntryFields[k];
|
||||
builder.AppendLine($" Entry {k}");
|
||||
if (ef == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AppendLine($" Range: {ef.Range} (0x{ef.Range:X})");
|
||||
builder.AppendLine($" Drive ID: {(ef.DriveID == null ? "[NULL]" : BitConverter.ToString(ef.DriveID).Replace('-', ' '))}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, HostRevocationListRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, HostRevocationListRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Total number of entries: {record.TotalNumberOfEntries} (0x{record.TotalNumberOfEntries:X})");
|
||||
builder.AppendLine($" Signature Blocks:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (record.SignatureBlocks == null || record.SignatureBlocks.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No signature blocks");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = 0; j < record.SignatureBlocks.Length; j++)
|
||||
{
|
||||
builder.AppendLine($" Signature Block {j}");
|
||||
var block = record.SignatureBlocks[j];
|
||||
if (block == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Number of entries: {block.NumberOfEntries}");
|
||||
builder.AppendLine($" Entry Fields:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (block.EntryFields == null || block.EntryFields.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No entry fields");
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int k = 0; k < block.EntryFields.Length; k++)
|
||||
{
|
||||
var ef = block.EntryFields[k];
|
||||
builder.AppendLine($" Entry {k}");
|
||||
if (ef == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
builder.AppendLine($" Range: {ef.Range} (0x{ef.Range:X})");
|
||||
builder.AppendLine($" Host ID: {(ef.HostID == null ? "[NULL]" : BitConverter.ToString(ef.HostID).Replace('-', ' '))}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, VerifyMediaKeyRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, VerifyMediaKeyRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Ciphertext value: {(record.CiphertextValue == null ? "[NULL]" : BitConverter.ToString(record.CiphertextValue).Replace('-', ' '))}");
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, CopyrightRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, CopyrightRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Copyright: {record.Copyright ?? "[NULL]"}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net48;net6.0;net7.0</TargetFrameworks>
|
||||
<RuntimeIdentifiers>win-x86;win-x64;linux-x64;osx-x64</RuntimeIdentifiers>
|
||||
<Title>BinaryObjectScanner.Printing</Title>
|
||||
<AssemblyName>BinaryObjectScanner.Printing</AssemblyName>
|
||||
<Authors>Matt Nadareski</Authors>
|
||||
<Product>BurnOutSharp</Product>
|
||||
<Copyright>Copyright (c)2022-2023 Matt Nadareski</Copyright>
|
||||
<RepositoryUrl>https://github.com/mnadareski/BurnOutSharp</RepositoryUrl>
|
||||
<Version>2.8</Version>
|
||||
<AssemblyVersion>2.8</AssemblyVersion>
|
||||
<FileVersion>2.8</FileVersion>
|
||||
<IncludeSource>true</IncludeSource>
|
||||
<IncludeSymbols>true</IncludeSymbols>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)'!='net48'">
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="SabreTools.Models" Version="1.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using SabreTools.Models.AACS;
|
||||
@@ -115,331 +114,10 @@ namespace BinaryObjectScanner.Wrappers
|
||||
public override StringBuilder PrettyPrint()
|
||||
{
|
||||
StringBuilder builder = new StringBuilder();
|
||||
Print(builder, _model);
|
||||
Printing.AACSMediaKeyBlock.Print(builder, _model);
|
||||
return builder;
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, MediaKeyBlock mediaKeyBlock)
|
||||
{
|
||||
builder.AppendLine("AACS Media Key Block Information:");
|
||||
builder.AppendLine("-------------------------");
|
||||
builder.AppendLine();
|
||||
|
||||
Print(builder, mediaKeyBlock.Records);
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, Record[] records)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, Record?[]? records)
|
||||
#endif
|
||||
{
|
||||
builder.AppendLine(" Records Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (records == null || records.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No records");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < records.Length; i++)
|
||||
{
|
||||
var record = records[i];
|
||||
Print(builder, record, i);
|
||||
}
|
||||
}
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, Record record, int index)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, Record? record, int index)
|
||||
#endif
|
||||
{
|
||||
builder.AppendLine($" Record Entry {index}");
|
||||
if (record == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Record type: {record.RecordType} (0x{record.RecordType:X})");
|
||||
builder.AppendLine($" Record length: {record.RecordLength} (0x{record.RecordLength:X})");
|
||||
|
||||
switch (record)
|
||||
{
|
||||
case EndOfMediaKeyBlockRecord eomkb:
|
||||
Print(builder, eomkb);
|
||||
break;
|
||||
case ExplicitSubsetDifferenceRecord esd:
|
||||
Print(builder, esd);
|
||||
break;
|
||||
case MediaKeyDataRecord mkd:
|
||||
Print(builder, mkd);
|
||||
break;
|
||||
case SubsetDifferenceIndexRecord sdi:
|
||||
Print(builder, sdi);
|
||||
break;
|
||||
case TypeAndVersionRecord tav:
|
||||
Print(builder, tav);
|
||||
break;
|
||||
case DriveRevocationListRecord drl:
|
||||
Print(builder, drl);
|
||||
break;
|
||||
case HostRevocationListRecord hrl:
|
||||
Print(builder, hrl);
|
||||
break;
|
||||
case VerifyMediaKeyRecord vmk:
|
||||
Print(builder, vmk);
|
||||
break;
|
||||
case CopyrightRecord c:
|
||||
Print(builder, c);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, EndOfMediaKeyBlockRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, EndOfMediaKeyBlockRecord record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Signature data: {(record.SignatureData == null ? "[NULL]" : BitConverter.ToString(record.SignatureData).Replace('-', ' '))}");
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, ExplicitSubsetDifferenceRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, ExplicitSubsetDifferenceRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Subset Differences:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (record?.SubsetDifferences == null || record.SubsetDifferences.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No subset differences");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = 0; j < record.SubsetDifferences.Length; j++)
|
||||
{
|
||||
var sd = record.SubsetDifferences[j];
|
||||
builder.AppendLine($" Subset Difference {j}");
|
||||
if (sd == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AppendLine($" Mask: {sd.Mask} (0x{sd.Mask:X})");
|
||||
builder.AppendLine($" Number: {sd.Number} (0x{sd.Number:X})");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, MediaKeyDataRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, MediaKeyDataRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Media Keys:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (record?.MediaKeyData == null || record.MediaKeyData.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No media keys");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = 0; j < record.MediaKeyData.Length; j++)
|
||||
{
|
||||
var mk = record.MediaKeyData[j];
|
||||
builder.AppendLine($" Media key {j}: {(mk == null ? "[NULL]" : BitConverter.ToString(mk).Replace('-', ' '))}");
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, SubsetDifferenceIndexRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, SubsetDifferenceIndexRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Span: {record.Span} (0x{record.Span:X})");
|
||||
builder.AppendLine($" Offsets:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (record.Offsets == null || record.Offsets.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No offsets");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = 0; j < record.Offsets.Length; j++)
|
||||
{
|
||||
var offset = record.Offsets[j];
|
||||
builder.AppendLine($" Offset {j}: {offset} (0x{offset:X})");
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, TypeAndVersionRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, TypeAndVersionRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Media key block type: {record.MediaKeyBlockType} (0x{record.MediaKeyBlockType:X})");
|
||||
builder.AppendLine($" Version number: {record.VersionNumber} (0x{record.VersionNumber:X})");
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, DriveRevocationListRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, DriveRevocationListRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Total number of entries: {record.TotalNumberOfEntries} (0x{record.TotalNumberOfEntries:X})");
|
||||
builder.AppendLine($" Signature Blocks:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (record.SignatureBlocks == null || record.SignatureBlocks.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No signature blocks");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = 0; j < record.SignatureBlocks.Length; j++)
|
||||
{
|
||||
var block = record.SignatureBlocks[j];
|
||||
builder.AppendLine($" Signature Block {j}");
|
||||
if (block == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Number of entries: {block.NumberOfEntries}");
|
||||
builder.AppendLine($" Entry Fields:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (block.EntryFields == null || block.EntryFields.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No entry fields");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int k = 0; k < block.EntryFields.Length; k++)
|
||||
{
|
||||
var ef = block.EntryFields[k];
|
||||
builder.AppendLine($" Entry {k}");
|
||||
if (ef == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AppendLine($" Range: {ef.Range} (0x{ef.Range:X})");
|
||||
builder.AppendLine($" Drive ID: {(ef.DriveID == null ? "[NULL]" : BitConverter.ToString(ef.DriveID).Replace('-', ' '))}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, HostRevocationListRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, HostRevocationListRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Total number of entries: {record.TotalNumberOfEntries} (0x{record.TotalNumberOfEntries:X})");
|
||||
builder.AppendLine($" Signature Blocks:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (record.SignatureBlocks == null || record.SignatureBlocks.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No signature blocks");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int j = 0; j < record.SignatureBlocks.Length; j++)
|
||||
{
|
||||
builder.AppendLine($" Signature Block {j}");
|
||||
var block = record.SignatureBlocks[j];
|
||||
if (block == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
continue;
|
||||
}
|
||||
|
||||
builder.AppendLine($" Number of entries: {block.NumberOfEntries}");
|
||||
builder.AppendLine($" Entry Fields:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (block.EntryFields == null || block.EntryFields.Length == 0)
|
||||
{
|
||||
builder.AppendLine($" No entry fields");
|
||||
continue;
|
||||
}
|
||||
|
||||
for (int k = 0; k < block.EntryFields.Length; k++)
|
||||
{
|
||||
var ef = block.EntryFields[k];
|
||||
builder.AppendLine($" Entry {k}");
|
||||
if (ef == null)
|
||||
{
|
||||
builder.AppendLine(" [NULL]");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
builder.AppendLine($" Range: {ef.Range} (0x{ef.Range:X})");
|
||||
builder.AppendLine($" Host ID: {(ef.HostID == null ? "[NULL]" : BitConverter.ToString(ef.HostID).Replace('-', ' '))}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, VerifyMediaKeyRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, VerifyMediaKeyRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Ciphertext value: {(record.CiphertextValue == null ? "[NULL]" : BitConverter.ToString(record.CiphertextValue).Replace('-', ' '))}");
|
||||
}
|
||||
|
||||
#if NET48
|
||||
private static void Print(StringBuilder builder, CopyrightRecord record)
|
||||
#else
|
||||
private static void Print(StringBuilder builder, CopyrightRecord? record)
|
||||
#endif
|
||||
{
|
||||
if (record == null)
|
||||
return;
|
||||
|
||||
builder.AppendLine($" Copyright: {record.Copyright ?? "[NULL]"}");
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\BinaryObjectScanner.Compression\BinaryObjectScanner.Compression.csproj" />
|
||||
<ProjectReference Include="..\BinaryObjectScanner.Printing\BinaryObjectScanner.Printing.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -36,6 +36,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BinaryObjectScanner.FileTyp
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BinaryObjectScanner.GameEngine", "BinaryObjectScanner.GameEngine\BinaryObjectScanner.GameEngine.csproj", "{8AFC9C4C-CC57-4382-8C32-F6B4C46E321A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BinaryObjectScanner.Printing", "BinaryObjectScanner.Printing\BinaryObjectScanner.Printing.csproj", "{E01BAF82-F5BB-4CD0-A5C7-312EB4EEC82B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -90,6 +92,10 @@ Global
|
||||
{8AFC9C4C-CC57-4382-8C32-F6B4C46E321A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8AFC9C4C-CC57-4382-8C32-F6B4C46E321A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8AFC9C4C-CC57-4382-8C32-F6B4C46E321A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E01BAF82-F5BB-4CD0-A5C7-312EB4EEC82B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E01BAF82-F5BB-4CD0-A5C7-312EB4EEC82B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E01BAF82-F5BB-4CD0-A5C7-312EB4EEC82B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E01BAF82-F5BB-4CD0-A5C7-312EB4EEC82B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -60,6 +60,10 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\BinaryObjectScanner.Printing\BinaryObjectScanner.Printing.csproj">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\BinaryObjectScanner.Protection\BinaryObjectScanner.Protection.csproj">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
|
||||
Reference in New Issue
Block a user