diff --git a/InfoPrint/InfoPrint.csproj b/InfoPrint/InfoPrint.csproj
index 34ee2962..2cfd792b 100644
--- a/InfoPrint/InfoPrint.csproj
+++ b/InfoPrint/InfoPrint.csproj
@@ -31,7 +31,7 @@
-
+
\ No newline at end of file
diff --git a/SabreTools.Serialization.Test/SabreTools.Serialization.Test.csproj b/SabreTools.Serialization.Test/SabreTools.Serialization.Test.csproj
index e18a3769..4497d614 100644
--- a/SabreTools.Serialization.Test/SabreTools.Serialization.Test.csproj
+++ b/SabreTools.Serialization.Test/SabreTools.Serialization.Test.csproj
@@ -28,7 +28,7 @@
-
+
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/SabreTools.Serialization/Deserializers/AACS.cs b/SabreTools.Serialization/Deserializers/AACS.cs
index dfaf597b..6c4c8ae9 100644
--- a/SabreTools.Serialization/Deserializers/AACS.cs
+++ b/SabreTools.Serialization/Deserializers/AACS.cs
@@ -41,15 +41,8 @@ namespace SabreTools.Serialization.Deserializers
break;
// Align to the 4-byte boundary if we're not at the end
- if (data.Position < data.Length)
- {
- while (data.Position < data.Length && (data.Position % 4) != 0)
- _ = data.ReadByteValue();
- }
- else
- {
+ if (!data.AlignToBoundary(4))
break;
- }
}
#endregion
diff --git a/SabreTools.Serialization/Deserializers/CIA.cs b/SabreTools.Serialization/Deserializers/CIA.cs
index ce69e5a7..3c91b6d3 100644
--- a/SabreTools.Serialization/Deserializers/CIA.cs
+++ b/SabreTools.Serialization/Deserializers/CIA.cs
@@ -42,10 +42,8 @@ namespace SabreTools.Serialization.Deserializers
#endregion
// Align to 64-byte boundary, if needed
- while (data.Position < data.Length - 1 && data.Position % 64 != 0)
- {
- _ = data.ReadByteValue();
- }
+ if (!data.AlignToBoundary(64))
+ return null;
#region Certificate Chain
@@ -65,10 +63,8 @@ namespace SabreTools.Serialization.Deserializers
#endregion
// Align to 64-byte boundary, if needed
- while (data.Position < data.Length - 1 && data.Position % 64 != 0)
- {
- _ = data.ReadByteValue();
- }
+ if (!data.AlignToBoundary(64))
+ return null;
#region Ticket
@@ -83,10 +79,8 @@ namespace SabreTools.Serialization.Deserializers
#endregion
// Align to 64-byte boundary, if needed
- while (data.Position < data.Length - 1 && data.Position % 64 != 0)
- {
- _ = data.ReadByteValue();
- }
+ if (!data.AlignToBoundary(64))
+ return null;
#region Title Metadata
@@ -101,10 +95,8 @@ namespace SabreTools.Serialization.Deserializers
#endregion
// Align to 64-byte boundary, if needed
- while (data.Position < data.Length - 1 && data.Position % 64 != 0)
- {
- _ = data.ReadByteValue();
- }
+ if (!data.AlignToBoundary(64))
+ return null;
#region Content File Data
@@ -120,10 +112,8 @@ namespace SabreTools.Serialization.Deserializers
#endregion
// Align to 64-byte boundary, if needed
- while (data.Position < data.Length - 1 && data.Position % 64 != 0)
- {
- _ = data.ReadByteValue();
- }
+ if (!data.AlignToBoundary(64))
+ return null;
#region Meta Data
diff --git a/SabreTools.Serialization/Deserializers/CueSheet.cs b/SabreTools.Serialization/Deserializers/CueSheet.cs
index caaa264a..c912bc10 100644
--- a/SabreTools.Serialization/Deserializers/CueSheet.cs
+++ b/SabreTools.Serialization/Deserializers/CueSheet.cs
@@ -576,7 +576,7 @@ namespace SabreTools.Serialization.Deserializers
///
/// Possible flags as strings
/// CueTrackFlag value representing the strings, if possible
- private static CueTrackFlag GetFlags(string?[]? flagStrings)
+ private static CueTrackFlag GetFlags(string[]? flagStrings)
{
CueTrackFlag flag = 0;
if (flagStrings == null)
diff --git a/SabreTools.Serialization/Deserializers/N3DS.cs b/SabreTools.Serialization/Deserializers/N3DS.cs
index bcd9ed5a..6b597906 100644
--- a/SabreTools.Serialization/Deserializers/N3DS.cs
+++ b/SabreTools.Serialization/Deserializers/N3DS.cs
@@ -66,9 +66,9 @@ namespace SabreTools.Serialization.Deserializers
// Create the tables
cart.Partitions = new NCCHHeader[8];
- cart.ExtendedHeaders = new NCCHExtendedHeader?[8];
- cart.ExeFSHeaders = new ExeFSHeader?[8];
- cart.RomFSHeaders = new RomFSHeader?[8];
+ cart.ExtendedHeaders = new NCCHExtendedHeader[8];
+ cart.ExeFSHeaders = new ExeFSHeader[8];
+ cart.RomFSHeaders = new RomFSHeader[8];
// Iterate and build the partitions
for (int i = 0; i < 8; i++)
diff --git a/SabreTools.Serialization/Deserializers/PKZIP.cs b/SabreTools.Serialization/Deserializers/PKZIP.cs
index 62ff382c..7bcc2a3f 100644
--- a/SabreTools.Serialization/Deserializers/PKZIP.cs
+++ b/SabreTools.Serialization/Deserializers/PKZIP.cs
@@ -167,10 +167,10 @@ namespace SabreTools.Serialization.Deserializers
// Setup all of the collections
var localFileHeaders = new List();
- var encryptionHeaders = new List();
+ var encryptionHeaders = new List();
var fileData = new List(); // TODO: Should this data be read here?
- var dataDescriptors = new List();
- var zip64DataDescriptors = new List();
+ var dataDescriptors = new List();
+ var zip64DataDescriptors = new List();
// Read the local file headers
for (int i = 0; i < archive.CentralDirectoryHeaders.Length; i++)
@@ -199,10 +199,10 @@ namespace SabreTools.Serialization.Deserializers
{
// Add a placeholder null item
localFileHeaders.Add(new LocalFileHeader());
- encryptionHeaders.Add(null);
+ encryptionHeaders.Add([]);
fileData.Add([]);
- dataDescriptors.Add(null);
- zip64DataDescriptors.Add(null);
+ dataDescriptors.Add(new DataDescriptor());
+ zip64DataDescriptors.Add(new DataDescriptor64());
continue;
}
@@ -226,8 +226,8 @@ namespace SabreTools.Serialization.Deserializers
}
else
{
- // Add the null encryption header
- encryptionHeaders.Add(null);
+ // Add the empty encryption header
+ encryptionHeaders.Add([]);
}
// Try to read the file data
@@ -254,7 +254,7 @@ namespace SabreTools.Serialization.Deserializers
return null;
// Add the data descriptor
- dataDescriptors.Add(null);
+ dataDescriptors.Add(new DataDescriptor());
zip64DataDescriptors.Add(dataDescriptor64);
}
else
@@ -266,14 +266,14 @@ namespace SabreTools.Serialization.Deserializers
// Add the data descriptor
dataDescriptors.Add(dataDescriptor);
- zip64DataDescriptors.Add(null);
+ zip64DataDescriptors.Add(new DataDescriptor64());
}
}
else
{
// Add the null data descriptor
- dataDescriptors.Add(null);
- zip64DataDescriptors.Add(null);
+ dataDescriptors.Add(new DataDescriptor());
+ zip64DataDescriptors.Add(new DataDescriptor64());
}
}
diff --git a/SabreTools.Serialization/Deserializers/PortableExecutable.cs b/SabreTools.Serialization/Deserializers/PortableExecutable.cs
index e264a721..64180cde 100644
--- a/SabreTools.Serialization/Deserializers/PortableExecutable.cs
+++ b/SabreTools.Serialization/Deserializers/PortableExecutable.cs
@@ -663,8 +663,7 @@ namespace SabreTools.Serialization.Deserializers
attributeCertificateTable.Add(entry);
// Align to the 8-byte boundary
- while ((data.Position % 8) != 0 && data.Position < endOffset && data.Position < data.Length)
- _ = data.ReadByteValue();
+ data.AlignToBoundary(8);
}
return [.. attributeCertificateTable];
@@ -677,7 +676,7 @@ namespace SabreTools.Serialization.Deserializers
/// First address not part of the base relocation table
/// Section table to use for virtual address translation
/// Filled base relocation table on success, null on error
- public static BaseRelocationBlock[] ParseBaseRelocationTable(Stream data, int endOffset, SectionHeader?[] sections)
+ public static BaseRelocationBlock[] ParseBaseRelocationTable(Stream data, int endOffset, SectionHeader[] sections)
{
var baseRelocationTable = new List();
@@ -745,7 +744,7 @@ namespace SabreTools.Serialization.Deserializers
/// Stream to parse
/// Section table to use for virtual address translation
/// Filled export table on success, null on error
- public static ExportTable? ParseExportTable(Stream data, SectionHeader?[] sections)
+ public static ExportTable? ParseExportTable(Stream data, SectionHeader[] sections)
{
var exportTable = new ExportTable();
@@ -859,7 +858,7 @@ namespace SabreTools.Serialization.Deserializers
/// Optional header magic number indicating PE32 or PE32+
/// Section table to use for virtual address translation
/// Filled import table on success, null on error
- public static ImportTable? ParseImportTable(Stream data, OptionalHeaderMagicNumber magic, SectionHeader?[] sections)
+ public static ImportTable? ParseImportTable(Stream data, OptionalHeaderMagicNumber magic, SectionHeader[] sections)
{
var importTable = new ImportTable();
@@ -908,7 +907,7 @@ namespace SabreTools.Serialization.Deserializers
}
// Lookup tables
- var importLookupTables = new Dictionary();
+ var importLookupTables = new Dictionary();
for (int i = 0; i < importTable.ImportDirectoryTable.Length; i++)
{
@@ -962,7 +961,7 @@ namespace SabreTools.Serialization.Deserializers
importTable.ImportLookupTables = importLookupTables;
// Address tables
- var importAddressTables = new Dictionary();
+ var importAddressTables = new Dictionary();
for (int i = 0; i < importTable.ImportDirectoryTable.Length; i++)
{
@@ -1116,7 +1115,7 @@ namespace SabreTools.Serialization.Deserializers
/// Section table to use for virtual address translation
/// Indicates if this is the top level or not
/// Filled resource directory table on success, null on error
- public static ResourceDirectoryTable? ParseResourceDirectoryTable(Stream data, long initialOffset, SectionHeader?[] sections, bool topLevel = false)
+ public static ResourceDirectoryTable? ParseResourceDirectoryTable(Stream data, long initialOffset, SectionHeader[] sections, bool topLevel = false)
{
var resourceDirectoryTable = new ResourceDirectoryTable();
diff --git a/SabreTools.Serialization/Deserializers/SGA.cs b/SabreTools.Serialization/Deserializers/SGA.cs
index 08db2c9d..07adfcb4 100644
--- a/SabreTools.Serialization/Deserializers/SGA.cs
+++ b/SabreTools.Serialization/Deserializers/SGA.cs
@@ -7,10 +7,10 @@ using static SabreTools.Models.SGA.Constants;
namespace SabreTools.Serialization.Deserializers
{
- public class SGA : BaseBinaryDeserializer
+ public class SGA : BaseBinaryDeserializer
{
///
- public override Models.SGA.File? Deserialize(Stream? data)
+ public override Archive? Deserialize(Stream? data)
{
// If the data is invalid
if (data == null || !data.CanRead)
@@ -19,7 +19,7 @@ namespace SabreTools.Serialization.Deserializers
try
{
// Create a new SGA to fill
- var file = new Models.SGA.File();
+ var archive = new Archive();
#region Header
@@ -29,7 +29,7 @@ namespace SabreTools.Serialization.Deserializers
return null;
// Set the SGA header
- file.Header = header;
+ archive.Header = header;
#endregion
@@ -41,11 +41,11 @@ namespace SabreTools.Serialization.Deserializers
return null;
// Set the SGA directory
- file.Directory = directory;
+ archive.Directory = directory;
#endregion
- return file;
+ return archive;
}
catch
{
diff --git a/SabreTools.Serialization/Deserializers/WAD3.cs b/SabreTools.Serialization/Deserializers/WAD3.cs
index 8e0b1465..5c148d92 100644
--- a/SabreTools.Serialization/Deserializers/WAD3.cs
+++ b/SabreTools.Serialization/Deserializers/WAD3.cs
@@ -58,7 +58,7 @@ namespace SabreTools.Serialization.Deserializers
#region File Entries
// Create the file entry array
- file.FileEntries = new FileEntry?[header.NumDirs];
+ file.FileEntries = new FileEntry[header.NumDirs];
for (int i = 0; i < header.NumDirs; i++)
{
var dirEntry = file.DirEntries[i];
diff --git a/SabreTools.Serialization/Extensions.PortableExecutable.cs b/SabreTools.Serialization/Extensions.PortableExecutable.cs
index eb99a499..e6c0a479 100644
--- a/SabreTools.Serialization/Extensions.PortableExecutable.cs
+++ b/SabreTools.Serialization/Extensions.PortableExecutable.cs
@@ -16,7 +16,7 @@ namespace SabreTools.Serialization
/// Relative virtual address to convert
/// Array of sections to check against
/// Physical address, 0 on error
- public static uint ConvertVirtualAddress(this uint rva, SectionHeader?[]? sections)
+ public static uint ConvertVirtualAddress(this uint rva, SectionHeader[]? sections)
{
// If we have an invalid section table, we can't do anything
if (sections == null || sections.Length == 0)
@@ -59,7 +59,7 @@ namespace SabreTools.Serialization
/// Relative virtual address to convert
/// Array of sections to check against
/// Section index, null on error
- public static int ContainingSectionIndex(this uint rva, SectionHeader?[]? sections)
+ public static int ContainingSectionIndex(this uint rva, SectionHeader[]? sections)
{
// If we have an invalid section table, we can't do anything
if (sections == null || sections.Length == 0)
diff --git a/SabreTools.Serialization/Printers/AACSMediaKeyBlock.cs b/SabreTools.Serialization/Printers/AACSMediaKeyBlock.cs
index 5b35f522..3c57422a 100644
--- a/SabreTools.Serialization/Printers/AACSMediaKeyBlock.cs
+++ b/SabreTools.Serialization/Printers/AACSMediaKeyBlock.cs
@@ -19,7 +19,7 @@ namespace SabreTools.Serialization.Printers
Print(builder, mediaKeyBlock.Records);
}
- private static void Print(StringBuilder builder, Record?[]? records)
+ private static void Print(StringBuilder builder, Record[]? records)
{
builder.AppendLine(" Records Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/BFPK.cs b/SabreTools.Serialization/Printers/BFPK.cs
index 5ef27ac7..b60ddb6f 100644
--- a/SabreTools.Serialization/Printers/BFPK.cs
+++ b/SabreTools.Serialization/Printers/BFPK.cs
@@ -37,7 +37,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, FileEntry?[]? files)
+ private static void Print(StringBuilder builder, FileEntry[]? files)
{
builder.AppendLine(" File Table Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/CFB.cs b/SabreTools.Serialization/Printers/CFB.cs
index 2eab14aa..74e80e89 100644
--- a/SabreTools.Serialization/Printers/CFB.cs
+++ b/SabreTools.Serialization/Printers/CFB.cs
@@ -84,7 +84,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryEntry?[]? directoryEntries)
+ private static void Print(StringBuilder builder, DirectoryEntry[]? directoryEntries)
{
builder.AppendLine(" Directory Entries Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/CIA.cs b/SabreTools.Serialization/Printers/CIA.cs
index 45c2af05..a7d7e05d 100644
--- a/SabreTools.Serialization/Printers/CIA.cs
+++ b/SabreTools.Serialization/Printers/CIA.cs
@@ -47,7 +47,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, Certificate?[]? certificateChain)
+ private static void Print(StringBuilder builder, Certificate[]? certificateChain)
{
builder.AppendLine(" Certificate Chain Information:");
builder.AppendLine(" -------------------------");
@@ -351,7 +351,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, NCCHHeader?[]? partitions)
+ private static void Print(StringBuilder builder, NCCHHeader[]? partitions)
{
builder.AppendLine(" NCCH Partition Header Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/GCF.cs b/SabreTools.Serialization/Printers/GCF.cs
index fa4a69b5..d1ee82d2 100644
--- a/SabreTools.Serialization/Printers/GCF.cs
+++ b/SabreTools.Serialization/Printers/GCF.cs
@@ -100,7 +100,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, BlockEntry?[]? entries)
+ private static void Print(StringBuilder builder, BlockEntry[]? entries)
{
builder.AppendLine(" Block Entries Information:");
builder.AppendLine(" -------------------------");
@@ -150,7 +150,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, FragmentationMap?[]? entries)
+ private static void Print(StringBuilder builder, FragmentationMap[]? entries)
{
builder.AppendLine(" Fragmentation Maps Information:");
builder.AppendLine(" -------------------------");
@@ -195,7 +195,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, BlockEntryMap?[]? entries)
+ private static void Print(StringBuilder builder, BlockEntryMap[]? entries)
{
builder.AppendLine(" Block Entry Maps Information:");
builder.AppendLine(" -------------------------");
@@ -250,7 +250,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryEntry?[]? entries, Dictionary? entryNames)
+ private static void Print(StringBuilder builder, DirectoryEntry[]? entries, Dictionary? entryNames)
{
builder.AppendLine(" Directory Entries Information:");
builder.AppendLine(" -------------------------");
@@ -283,7 +283,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryInfo1Entry?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryInfo1Entry[]? entries)
{
builder.AppendLine(" Directory Info 1 Entries Information:");
builder.AppendLine(" -------------------------");
@@ -309,7 +309,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryInfo2Entry?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryInfo2Entry[]? entries)
{
builder.AppendLine(" Directory Info 2 Entries Information:");
builder.AppendLine(" -------------------------");
@@ -335,7 +335,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryCopyEntry?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryCopyEntry[]? entries)
{
builder.AppendLine(" Directory Copy Entries Information:");
builder.AppendLine(" -------------------------");
@@ -361,7 +361,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryLocalEntry?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryLocalEntry[]? entries)
{
builder.AppendLine(" Directory Local Entries Information:");
builder.AppendLine(" -------------------------");
@@ -403,7 +403,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryMapEntry?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryMapEntry[]? entries)
{
builder.AppendLine(" Directory Map Entries Information:");
builder.AppendLine(" -------------------------");
@@ -463,7 +463,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ChecksumMapEntry?[]? entries)
+ private static void Print(StringBuilder builder, ChecksumMapEntry[]? entries)
{
builder.AppendLine(" Checksum Map Entries Information:");
builder.AppendLine(" -------------------------");
@@ -490,7 +490,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ChecksumEntry?[]? entries)
+ private static void Print(StringBuilder builder, ChecksumEntry[]? entries)
{
builder.AppendLine(" Checksum Entries Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/InstallShieldCabinet.cs b/SabreTools.Serialization/Printers/InstallShieldCabinet.cs
index 86b16886..b19db527 100644
--- a/SabreTools.Serialization/Printers/InstallShieldCabinet.cs
+++ b/SabreTools.Serialization/Printers/InstallShieldCabinet.cs
@@ -205,7 +205,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, string?[]? entries)
+ private static void Print(StringBuilder builder, string[]? entries)
{
builder.AppendLine(" Directory Names:");
builder.AppendLine(" -------------------------");
@@ -223,7 +223,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, FileDescriptor?[]? entries)
+ private static void Print(StringBuilder builder, FileDescriptor[]? entries)
{
builder.AppendLine(" File Descriptors:");
builder.AppendLine(" -------------------------");
@@ -291,7 +291,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, FileGroup?[]? entries)
+ private static void Print(StringBuilder builder, FileGroup[]? entries)
{
builder.AppendLine(" File Groups:");
builder.AppendLine(" -------------------------");
@@ -332,7 +332,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, Component?[]? entries)
+ private static void Print(StringBuilder builder, Component[]? entries)
{
builder.AppendLine(" Components:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/LinearExecutable.cs b/SabreTools.Serialization/Printers/LinearExecutable.cs
index d5874136..3bb2fa0a 100644
--- a/SabreTools.Serialization/Printers/LinearExecutable.cs
+++ b/SabreTools.Serialization/Printers/LinearExecutable.cs
@@ -138,7 +138,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ObjectTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, ObjectTableEntry[]? entries)
{
builder.AppendLine(" Object Table Information:");
builder.AppendLine(" -------------------------");
@@ -169,7 +169,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ObjectPageMapEntry?[]? entries)
+ private static void Print(StringBuilder builder, ObjectPageMapEntry[]? entries)
{
builder.AppendLine(" Object Page Map Information:");
builder.AppendLine(" -------------------------");
@@ -197,7 +197,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ResourceTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, ResourceTableEntry[]? entries)
{
builder.AppendLine(" Resource Table Information:");
builder.AppendLine(" -------------------------");
@@ -227,7 +227,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ResidentNamesTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, ResidentNamesTableEntry[]? entries)
{
builder.AppendLine(" Resident Names Table Information:");
builder.AppendLine(" -------------------------");
@@ -255,7 +255,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, EntryTableBundle?[]? bundles)
+ private static void Print(StringBuilder builder, EntryTableBundle[]? bundles)
{
builder.AppendLine(" Entry Table Information:");
builder.AppendLine(" -------------------------");
@@ -341,7 +341,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ModuleFormatDirectivesTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, ModuleFormatDirectivesTableEntry[]? entries)
{
builder.AppendLine(" Module Format Directives Table Information:");
builder.AppendLine(" -------------------------");
@@ -369,7 +369,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, VerifyRecordDirectiveTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, VerifyRecordDirectiveTableEntry[]? entries)
{
builder.AppendLine(" Verify Record Directive Table Information:");
builder.AppendLine(" -------------------------");
@@ -401,7 +401,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, FixupPageTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, FixupPageTableEntry[]? entries)
{
builder.AppendLine(" Fix-up Page Table Information:");
builder.AppendLine(" -------------------------");
@@ -427,7 +427,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, FixupRecordTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, FixupRecordTableEntry[]? entries)
{
builder.AppendLine(" Fix-up Record Table Information:");
builder.AppendLine(" -------------------------");
@@ -655,7 +655,7 @@ namespace SabreTools.Serialization.Printers
}
}
- private static void Print(StringBuilder builder, ImportModuleNameTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, ImportModuleNameTableEntry[]? entries)
{
builder.AppendLine(" Import Module Name Table Information:");
builder.AppendLine(" -------------------------");
@@ -682,7 +682,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ImportModuleProcedureNameTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, ImportModuleProcedureNameTableEntry[]? entries)
{
builder.AppendLine(" Import Module Procedure Name Table Information:");
builder.AppendLine(" -------------------------");
@@ -709,7 +709,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, PerPageChecksumTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, PerPageChecksumTableEntry[]? entries)
{
builder.AppendLine(" Per-Page Checksum Table Information:");
builder.AppendLine(" -------------------------");
@@ -735,7 +735,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, NonResidentNamesTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, NonResidentNamesTableEntry[]? entries)
{
builder.AppendLine(" Non-Resident Names Table Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/MSDOS.cs b/SabreTools.Serialization/Printers/MSDOS.cs
index 4ed2dbaf..5288107f 100644
--- a/SabreTools.Serialization/Printers/MSDOS.cs
+++ b/SabreTools.Serialization/Printers/MSDOS.cs
@@ -48,7 +48,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, RelocationEntry?[]? entries)
+ private static void Print(StringBuilder builder, RelocationEntry[]? entries)
{
builder.AppendLine(" Relocation Table Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/MicrosoftCabinet.cs b/SabreTools.Serialization/Printers/MicrosoftCabinet.cs
index 8a953c16..1c6b135b 100644
--- a/SabreTools.Serialization/Printers/MicrosoftCabinet.cs
+++ b/SabreTools.Serialization/Printers/MicrosoftCabinet.cs
@@ -81,7 +81,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, CFFOLDER?[]? entries)
+ private static void Print(StringBuilder builder, CFFOLDER[]? entries)
{
builder.AppendLine(" Folders:");
builder.AppendLine(" -------------------------");
@@ -137,7 +137,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, CFFILE?[]? entries)
+ private static void Print(StringBuilder builder, CFFILE[]? entries)
{
builder.AppendLine(" Files:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/MoPaQ.cs b/SabreTools.Serialization/Printers/MoPaQ.cs
index 3c2276c9..c4704b52 100644
--- a/SabreTools.Serialization/Printers/MoPaQ.cs
+++ b/SabreTools.Serialization/Printers/MoPaQ.cs
@@ -162,7 +162,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, HashEntry?[]? entries)
+ private static void Print(StringBuilder builder, HashEntry[]? entries)
{
builder.AppendLine(" Hash Table Information:");
builder.AppendLine(" -------------------------");
@@ -192,7 +192,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, BlockEntry?[]? entries)
+ private static void Print(StringBuilder builder, BlockEntry[]? entries)
{
builder.AppendLine(" Block Table Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/N3DS.cs b/SabreTools.Serialization/Printers/N3DS.cs
index 658a009d..e1bac33f 100644
--- a/SabreTools.Serialization/Printers/N3DS.cs
+++ b/SabreTools.Serialization/Printers/N3DS.cs
@@ -264,7 +264,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, NCCHHeader?[]? entries)
+ private static void Print(StringBuilder builder, NCCHHeader[]? entries)
{
builder.AppendLine(" NCCH Partition Header Information:");
builder.AppendLine(" -------------------------");
@@ -344,7 +344,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, NCCHExtendedHeader?[]? entries)
+ private static void Print(StringBuilder builder, NCCHExtendedHeader[]? entries)
{
builder.AppendLine(" NCCH Extended Header Information:");
builder.AppendLine(" -------------------------");
@@ -580,7 +580,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ExeFSHeader?[]? entries)
+ private static void Print(StringBuilder builder, ExeFSHeader[]? entries)
{
builder.AppendLine(" ExeFS Header Information:");
builder.AppendLine(" -------------------------");
@@ -650,7 +650,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, RomFSHeader?[]? entries)
+ private static void Print(StringBuilder builder, RomFSHeader[]? entries)
{
builder.AppendLine(" RomFS Header Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/NCF.cs b/SabreTools.Serialization/Printers/NCF.cs
index 0ef9a558..d5e6c288 100644
--- a/SabreTools.Serialization/Printers/NCF.cs
+++ b/SabreTools.Serialization/Printers/NCF.cs
@@ -91,7 +91,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryEntry?[]? entries, Dictionary? entryNames)
+ private static void Print(StringBuilder builder, DirectoryEntry[]? entries, Dictionary? entryNames)
{
builder.AppendLine(" Directory Entries Information:");
builder.AppendLine(" -------------------------");
@@ -124,7 +124,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryInfo1Entry?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryInfo1Entry[]? entries)
{
builder.AppendLine(" Directory Info 1 Entries Information:");
builder.AppendLine(" -------------------------");
@@ -150,7 +150,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryInfo2Entry?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryInfo2Entry[]? entries)
{
builder.AppendLine(" Directory Info 2 Entries Information:");
builder.AppendLine(" -------------------------");
@@ -176,7 +176,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryCopyEntry?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryCopyEntry[]? entries)
{
builder.AppendLine(" Directory Copy Entries Information:");
builder.AppendLine(" -------------------------");
@@ -202,7 +202,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryLocalEntry?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryLocalEntry[]? entries)
{
builder.AppendLine(" Directory Local Entries Information:");
builder.AppendLine(" -------------------------");
@@ -244,7 +244,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, UnknownEntry?[]? entries)
+ private static void Print(StringBuilder builder, UnknownEntry[]? entries)
{
builder.AppendLine(" Unknown Entries Information:");
builder.AppendLine(" -------------------------");
@@ -304,7 +304,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ChecksumMapEntry?[]? entries)
+ private static void Print(StringBuilder builder, ChecksumMapEntry[]? entries)
{
builder.AppendLine(" Checksum Map Entries Information:");
builder.AppendLine(" -------------------------");
@@ -331,7 +331,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ChecksumEntry?[]? entries)
+ private static void Print(StringBuilder builder, ChecksumEntry[]? entries)
{
builder.AppendLine(" Checksum Entries Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/NewExecutable.cs b/SabreTools.Serialization/Printers/NewExecutable.cs
index 10b041b6..5619b3e7 100644
--- a/SabreTools.Serialization/Printers/NewExecutable.cs
+++ b/SabreTools.Serialization/Printers/NewExecutable.cs
@@ -2,7 +2,6 @@ using System.Collections.Generic;
using System.Text;
using SabreTools.Models.NewExecutable;
using SabreTools.Serialization.Interfaces;
-using static SabreTools.Serialization.Extensions;
namespace SabreTools.Serialization.Printers
{
@@ -116,7 +115,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, SegmentTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, SegmentTableEntry[]? entries)
{
builder.AppendLine(" Segment Table Information:");
builder.AppendLine(" -------------------------");
@@ -227,7 +226,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ResidentNameTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, ResidentNameTableEntry[]? entries)
{
builder.AppendLine(" Resident-Name Table Information:");
builder.AppendLine(" -------------------------");
@@ -255,7 +254,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ModuleReferenceTableEntry?[]? entries, Models.MSDOS.ExecutableHeader? stub, ExecutableHeader? header)
+ private static void Print(StringBuilder builder, ModuleReferenceTableEntry[]? entries, Models.MSDOS.ExecutableHeader? stub, ExecutableHeader? header)
{
builder.AppendLine(" Module-Reference Table Information:");
builder.AppendLine(" -------------------------");
@@ -308,7 +307,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, EntryTableBundle?[]? entries)
+ private static void Print(StringBuilder builder, EntryTableBundle[]? entries)
{
builder.AppendLine(" Entry Table Information:");
builder.AppendLine(" -------------------------");
@@ -348,7 +347,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, NonResidentNameTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, NonResidentNameTableEntry[]? entries)
{
builder.AppendLine(" Nonresident-Name Table Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/Nitro.cs b/SabreTools.Serialization/Printers/Nitro.cs
index cb71fca0..b78e9648 100644
--- a/SabreTools.Serialization/Printers/Nitro.cs
+++ b/SabreTools.Serialization/Printers/Nitro.cs
@@ -163,7 +163,7 @@ namespace SabreTools.Serialization.Printers
Print(builder, table.NameList);
}
- private static void Print(StringBuilder builder, FolderAllocationTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, FolderAllocationTableEntry[]? entries)
{
builder.AppendLine(" Folder Allocation Table:");
builder.AppendLine(" -------------------------");
@@ -200,7 +200,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, NameListEntry?[]? entries)
+ private static void Print(StringBuilder builder, NameListEntry[]? entries)
{
builder.AppendLine(" Name List:");
builder.AppendLine(" -------------------------");
@@ -229,7 +229,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, FileAllocationTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, FileAllocationTableEntry[]? entries)
{
builder.AppendLine(" File Allocation Table:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/PAK.cs b/SabreTools.Serialization/Printers/PAK.cs
index 50143461..1057e2fa 100644
--- a/SabreTools.Serialization/Printers/PAK.cs
+++ b/SabreTools.Serialization/Printers/PAK.cs
@@ -37,7 +37,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryItem?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryItem[]? entries)
{
builder.AppendLine(" Directory Items Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/PFF.cs b/SabreTools.Serialization/Printers/PFF.cs
index 71306ac3..28258d82 100644
--- a/SabreTools.Serialization/Printers/PFF.cs
+++ b/SabreTools.Serialization/Printers/PFF.cs
@@ -40,7 +40,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, Segment?[]? segments)
+ private static void Print(StringBuilder builder, Segment[]? segments)
{
builder.AppendLine(" Segments Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/PIC.cs b/SabreTools.Serialization/Printers/PIC.cs
index bf082a20..c5af20d3 100644
--- a/SabreTools.Serialization/Printers/PIC.cs
+++ b/SabreTools.Serialization/Printers/PIC.cs
@@ -22,7 +22,7 @@ namespace SabreTools.Serialization.Printers
Print(builder, di.Units);
}
- private static void Print(StringBuilder builder, DiscInformationUnit?[]? entries)
+ private static void Print(StringBuilder builder, DiscInformationUnit[]? entries)
{
builder.AppendLine(" Disc Information Units:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/PKZIP.cs b/SabreTools.Serialization/Printers/PKZIP.cs
index a01518a0..db12ecf8 100644
--- a/SabreTools.Serialization/Printers/PKZIP.cs
+++ b/SabreTools.Serialization/Printers/PKZIP.cs
@@ -96,7 +96,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, CentralDirectoryFileHeader?[]? headers)
+ private static void Print(StringBuilder builder, CentralDirectoryFileHeader[]? headers)
{
builder.AppendLine(" Central Directory File Headers Information:");
builder.AppendLine(" -------------------------");
@@ -166,10 +166,10 @@ namespace SabreTools.Serialization.Printers
private static void Print(StringBuilder builder,
LocalFileHeader[]? localFileHeaders,
- byte[]?[]? encryptionHeaders,
+ byte[][]? encryptionHeaders,
byte[][]? fileData,
- DataDescriptor?[]? dataDescriptors,
- DataDescriptor64?[]? zip64DataDescriptors)
+ DataDescriptor[]? dataDescriptors,
+ DataDescriptor64[]? zip64DataDescriptors)
{
builder.AppendLine(" Local File Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/PlayJAudioFile.cs b/SabreTools.Serialization/Printers/PlayJAudioFile.cs
index df5284db..47eac41a 100644
--- a/SabreTools.Serialization/Printers/PlayJAudioFile.cs
+++ b/SabreTools.Serialization/Printers/PlayJAudioFile.cs
@@ -150,7 +150,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, uint count, DataFile?[]? entries)
+ private static void Print(StringBuilder builder, uint count, DataFile[]? entries)
{
builder.AppendLine(" Data Files Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/PlayJPlaylist.cs b/SabreTools.Serialization/Printers/PlayJPlaylist.cs
index e8170799..accd1aba 100644
--- a/SabreTools.Serialization/Printers/PlayJPlaylist.cs
+++ b/SabreTools.Serialization/Printers/PlayJPlaylist.cs
@@ -36,7 +36,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, AudioFile?[]? entries)
+ private static void Print(StringBuilder builder, AudioFile[]? entries)
{
builder.AppendLine(" Audio Files Information:");
builder.AppendLine(" -------------------------");
@@ -193,7 +193,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, uint count, DataFile?[]? entries)
+ private static void Print(StringBuilder builder, uint count, DataFile[]? entries)
{
builder.AppendLine(" Data Files Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/PortableExecutable.cs b/SabreTools.Serialization/Printers/PortableExecutable.cs
index d8751cea..1ed2b056 100644
--- a/SabreTools.Serialization/Printers/PortableExecutable.cs
+++ b/SabreTools.Serialization/Printers/PortableExecutable.cs
@@ -102,7 +102,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, OptionalHeader? header, SectionHeader?[]? table)
+ private static void Print(StringBuilder builder, OptionalHeader? header, SectionHeader[]? table)
{
builder.AppendLine(" Optional Header Information:");
builder.AppendLine(" -------------------------");
@@ -274,7 +274,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, SectionHeader?[]? table)
+ private static void Print(StringBuilder builder, SectionHeader[]? table)
{
builder.AppendLine(" Section Table Information:");
builder.AppendLine(" -------------------------");
@@ -312,7 +312,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, COFFSymbolTableEntry?[]? symbolTable)
+ private static void Print(StringBuilder builder, COFFSymbolTableEntry[]? symbolTable)
{
builder.AppendLine(" COFF Symbol Table Information:");
builder.AppendLine(" -------------------------");
@@ -469,7 +469,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, AttributeCertificateTableEntry?[]? entries)
+ private static void Print(StringBuilder builder, AttributeCertificateTableEntry[]? entries)
{
builder.AppendLine(" Attribute Certificate Table Information:");
builder.AppendLine(" -------------------------");
@@ -560,7 +560,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, BaseRelocationBlock?[]? entries, SectionHeader?[]? table)
+ private static void Print(StringBuilder builder, BaseRelocationBlock[]? entries, SectionHeader[]? table)
{
builder.AppendLine(" Base Relocation Table Information:");
builder.AppendLine(" -------------------------");
@@ -753,7 +753,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ImportTable? table, SectionHeader?[]? sectionTable)
+ private static void Print(StringBuilder builder, ImportTable? table, SectionHeader[]? sectionTable)
{
builder.AppendLine(" Import Table Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/Quantum.cs b/SabreTools.Serialization/Printers/Quantum.cs
index ec1de9c2..c277b692 100644
--- a/SabreTools.Serialization/Printers/Quantum.cs
+++ b/SabreTools.Serialization/Printers/Quantum.cs
@@ -42,7 +42,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, FileDescriptor?[]? entries)
+ private static void Print(StringBuilder builder, FileDescriptor[]? entries)
{
builder.AppendLine(" File List Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/SGA.cs b/SabreTools.Serialization/Printers/SGA.cs
index 4e945f8e..dac02d3f 100644
--- a/SabreTools.Serialization/Printers/SGA.cs
+++ b/SabreTools.Serialization/Printers/SGA.cs
@@ -4,13 +4,13 @@ using SabreTools.Serialization.Interfaces;
namespace SabreTools.Serialization.Printers
{
- public class SGA : IPrinter
+ public class SGA : IPrinter
{
///
- public void PrintInformation(StringBuilder builder, File model)
+ public void PrintInformation(StringBuilder builder, Archive model)
=> Print(builder, model);
- public static void Print(StringBuilder builder, File file)
+ public static void Print(StringBuilder builder, Archive file)
{
builder.AppendLine("SGA Information:");
builder.AppendLine("-------------------------");
@@ -175,7 +175,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, Section4?[]? sections)
+ private static void Print(StringBuilder builder, Section4[]? sections)
{
builder.AppendLine(" Sections Information:");
builder.AppendLine(" -------------------------");
@@ -207,7 +207,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, Section5?[]? sections)
+ private static void Print(StringBuilder builder, Section5[]? sections)
{
builder.AppendLine(" Sections Information:");
builder.AppendLine(" -------------------------");
@@ -239,7 +239,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, Folder4?[]? folders)
+ private static void Print(StringBuilder builder, Folder4[]? folders)
{
builder.AppendLine(" Folders Information:");
builder.AppendLine(" -------------------------");
@@ -270,7 +270,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, Folder5?[]? folders)
+ private static void Print(StringBuilder builder, Folder5[]? folders)
{
builder.AppendLine(" Folders Information:");
builder.AppendLine(" -------------------------");
@@ -301,7 +301,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, File4?[]? files)
+ private static void Print(StringBuilder builder, File4[]? files)
{
builder.AppendLine(" Files Information:");
builder.AppendLine(" -------------------------");
@@ -334,7 +334,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, File6?[]? files)
+ private static void Print(StringBuilder builder, File6[]? files)
{
builder.AppendLine(" Files Information:");
builder.AppendLine(" -------------------------");
@@ -368,7 +368,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, File7?[]? files)
+ private static void Print(StringBuilder builder, File7[]? files)
{
builder.AppendLine(" Files Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/VPK.cs b/SabreTools.Serialization/Printers/VPK.cs
index 3e1fac13..f7477016 100644
--- a/SabreTools.Serialization/Printers/VPK.cs
+++ b/SabreTools.Serialization/Printers/VPK.cs
@@ -57,7 +57,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, ArchiveHash?[]? entries)
+ private static void Print(StringBuilder builder, ArchiveHash[]? entries)
{
builder.AppendLine(" Archive Hashes Information:");
builder.AppendLine(" -------------------------");
@@ -86,7 +86,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryItem?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryItem[]? entries)
{
builder.AppendLine(" Directory Items Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/WAD3.cs b/SabreTools.Serialization/Printers/WAD3.cs
index da2867f4..32ed76a8 100644
--- a/SabreTools.Serialization/Printers/WAD3.cs
+++ b/SabreTools.Serialization/Printers/WAD3.cs
@@ -38,7 +38,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirEntry?[]? entries)
+ private static void Print(StringBuilder builder, DirEntry[]? entries)
{
builder.AppendLine(" Directory Entries Information:");
builder.AppendLine(" -------------------------");
@@ -70,7 +70,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, FileEntry?[]? entries)
+ private static void Print(StringBuilder builder, FileEntry[]? entries)
{
builder.AppendLine(" File Entries Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/Printers/XZP.cs b/SabreTools.Serialization/Printers/XZP.cs
index b62b02e1..02ae552f 100644
--- a/SabreTools.Serialization/Printers/XZP.cs
+++ b/SabreTools.Serialization/Printers/XZP.cs
@@ -47,7 +47,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryEntry?[]? entries, string prefix)
+ private static void Print(StringBuilder builder, DirectoryEntry[]? entries, string prefix)
{
builder.AppendLine($" {prefix} Entries Information:");
builder.AppendLine(" -------------------------");
@@ -75,7 +75,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryMapping?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryMapping[]? entries)
{
builder.AppendLine(" Preload Directory Mappings Information:");
builder.AppendLine(" -------------------------");
@@ -101,7 +101,7 @@ namespace SabreTools.Serialization.Printers
builder.AppendLine();
}
- private static void Print(StringBuilder builder, DirectoryItem?[]? entries)
+ private static void Print(StringBuilder builder, DirectoryItem[]? entries)
{
builder.AppendLine(" Directory Items Information:");
builder.AppendLine(" -------------------------");
diff --git a/SabreTools.Serialization/SabreTools.Serialization.csproj b/SabreTools.Serialization/SabreTools.Serialization.csproj
index 830ba0c9..74ffeb18 100644
--- a/SabreTools.Serialization/SabreTools.Serialization.csproj
+++ b/SabreTools.Serialization/SabreTools.Serialization.csproj
@@ -32,8 +32,8 @@
-
-
+
+
\ No newline at end of file
diff --git a/SabreTools.Serialization/Serializers/AttractMode.cs b/SabreTools.Serialization/Serializers/AttractMode.cs
index 955e4030..c29c66eb 100644
--- a/SabreTools.Serialization/Serializers/AttractMode.cs
+++ b/SabreTools.Serialization/Serializers/AttractMode.cs
@@ -165,7 +165,7 @@ namespace SabreTools.Serialization.Serializers
/// Array of Row objects representing the rows information
/// SeparatedValueWriter representing the output
/// True if the long variant of the row should be written, false otherwise
- private static void WriteRows(Row?[]? rows, SeparatedValueWriter writer, bool longHeader)
+ private static void WriteRows(Row[]? rows, SeparatedValueWriter writer, bool longHeader)
{
// If the games information is missing, we can't do anything
if (rows == null || rows.Length == 0)
diff --git a/SabreTools.Serialization/Serializers/ClrMamePro.cs b/SabreTools.Serialization/Serializers/ClrMamePro.cs
index 72c7e4f9..54e6ea7a 100644
--- a/SabreTools.Serialization/Serializers/ClrMamePro.cs
+++ b/SabreTools.Serialization/Serializers/ClrMamePro.cs
@@ -137,7 +137,7 @@ namespace SabreTools.Serialization.Serializers
///
/// Array of GameBase objects representing the games information
/// ClrMameProWriter representing the output
- private static void WriteGames(GameBase?[]? games, ClrMameProWriter writer)
+ private static void WriteGames(GameBase[]? games, ClrMameProWriter writer)
{
// If the games information is missing, we can't do anything
if (games == null || games.Length == 0)
diff --git a/SabreTools.Serialization/Wrappers/AACSMediaKeyBlock.cs b/SabreTools.Serialization/Wrappers/AACSMediaKeyBlock.cs
index 5b335e1d..959722bb 100644
--- a/SabreTools.Serialization/Wrappers/AACSMediaKeyBlock.cs
+++ b/SabreTools.Serialization/Wrappers/AACSMediaKeyBlock.cs
@@ -17,7 +17,7 @@ namespace SabreTools.Serialization.Wrappers
///
/// Media key block records
///
- public Record?[] Records => Model.Records ?? [];
+ public Record[] Records => Model.Records ?? [];
#endregion
diff --git a/SabreTools.Serialization/Wrappers/GCF.cs b/SabreTools.Serialization/Wrappers/GCF.cs
index 8cd5e1c3..a3d62285 100644
--- a/SabreTools.Serialization/Wrappers/GCF.cs
+++ b/SabreTools.Serialization/Wrappers/GCF.cs
@@ -365,7 +365,7 @@ namespace SabreTools.Serialization.Wrappers
///
/// Array of block entries
///
- public Models.GCF.BlockEntry?[]? BlockEntries;
+ public Models.GCF.BlockEntry[]? BlockEntries;
}
#endregion
diff --git a/SabreTools.Serialization/Wrappers/N3DS.cs b/SabreTools.Serialization/Wrappers/N3DS.cs
index da724bd9..cbdebbf2 100644
--- a/SabreTools.Serialization/Wrappers/N3DS.cs
+++ b/SabreTools.Serialization/Wrappers/N3DS.cs
@@ -24,7 +24,7 @@ namespace SabreTools.Serialization.Wrappers
///
/// ExeFS headers
///
- public ExeFSHeader?[] ExeFSHeaders => Model.ExeFSHeaders ?? [];
+ public ExeFSHeader[] ExeFSHeaders => Model.ExeFSHeaders ?? [];
///
/// Media unit size in bytes
@@ -43,12 +43,12 @@ namespace SabreTools.Serialization.Wrappers
///
/// Partitions data table
///
- public NCCHHeader?[] Partitions => Model.Partitions ?? [];
+ public NCCHHeader[] Partitions => Model.Partitions ?? [];
///
/// Partitions header table
///
- public PartitionTableEntry?[] PartitionsTable => Model.Header?.PartitionsTable ?? [];
+ public PartitionTableEntry[] PartitionsTable => Model.Header?.PartitionsTable ?? [];
#region Named Partition Entries
diff --git a/SabreTools.Serialization/Wrappers/PAK.cs b/SabreTools.Serialization/Wrappers/PAK.cs
index 904de0d2..03f5b5d7 100644
--- a/SabreTools.Serialization/Wrappers/PAK.cs
+++ b/SabreTools.Serialization/Wrappers/PAK.cs
@@ -15,7 +15,7 @@ namespace SabreTools.Serialization.Wrappers
#region Extension Properties
///
- public DirectoryItem?[] DirectoryItems => Model.DirectoryItems ?? [];
+ public DirectoryItem[] DirectoryItems => Model.DirectoryItems ?? [];
#endregion
diff --git a/SabreTools.Serialization/Wrappers/PFF.cs b/SabreTools.Serialization/Wrappers/PFF.cs
index 2ac449df..cb432471 100644
--- a/SabreTools.Serialization/Wrappers/PFF.cs
+++ b/SabreTools.Serialization/Wrappers/PFF.cs
@@ -20,7 +20,7 @@ namespace SabreTools.Serialization.Wrappers
public long FileCount => Model.Header?.NumberOfFiles ?? 0;
///
- public Segment?[] Segments => Model.Segments ?? [];
+ public Segment[] Segments => Model.Segments ?? [];
#endregion
diff --git a/SabreTools.Serialization/Wrappers/PIC.cs b/SabreTools.Serialization/Wrappers/PIC.cs
index 6bcb9899..2e04da80 100644
--- a/SabreTools.Serialization/Wrappers/PIC.cs
+++ b/SabreTools.Serialization/Wrappers/PIC.cs
@@ -15,7 +15,7 @@ namespace SabreTools.Serialization.Wrappers
#region Extension Properties
///
- public DiscInformationUnit?[] Units => Model.Units ?? [];
+ public DiscInformationUnit[] Units => Model.Units ?? [];
#endregion
diff --git a/SabreTools.Serialization/Wrappers/SGA.cs b/SabreTools.Serialization/Wrappers/SGA.cs
index 989e07e1..2685ad11 100644
--- a/SabreTools.Serialization/Wrappers/SGA.cs
+++ b/SabreTools.Serialization/Wrappers/SGA.cs
@@ -1,9 +1,10 @@
using System;
using System.IO;
+using SabreTools.Models.SGA;
namespace SabreTools.Serialization.Wrappers
{
- public class SGA : WrapperBase
+ public class SGA : WrapperBase
{
#region Descriptive Properties
@@ -28,10 +29,10 @@ namespace SabreTools.Serialization.Wrappers
{
return Directory switch
{
- Models.SGA.Directory4 d4 => d4.Files?.Length ?? 0,
- Models.SGA.Directory5 d5 => d5.Files?.Length ?? 0,
- Models.SGA.Directory6 d6 => d6.Files?.Length ?? 0,
- Models.SGA.Directory7 d7 => d7.Files?.Length ?? 0,
+ Directory4 d4 => d4.Files?.Length ?? 0,
+ Directory5 d5 => d5.Files?.Length ?? 0,
+ Directory6 d6 => d6.Files?.Length ?? 0,
+ Directory7 d7 => d7.Files?.Length ?? 0,
_ => 0,
};
}
@@ -46,8 +47,8 @@ namespace SabreTools.Serialization.Wrappers
{
return Model.Header switch
{
- Models.SGA.Header4 h4 => h4.FileDataOffset,
- Models.SGA.Header6 h6 => h6.FileDataOffset,
+ Header4 h4 => h4.FileDataOffset,
+ Header6 h6 => h6.FileDataOffset,
_ => -1,
};
}
@@ -58,14 +59,14 @@ namespace SabreTools.Serialization.Wrappers
#region Constructors
///
- public SGA(Models.SGA.File? model, byte[]? data, int offset)
+ public SGA(Archive? model, byte[]? data, int offset)
: base(model, data, offset)
{
// All logic is handled by the base class
}
///
- public SGA(Models.SGA.File? model, Stream? data)
+ public SGA(Archive? model, Stream? data)
: base(model, data)
{
// All logic is handled by the base class
@@ -152,7 +153,7 @@ namespace SabreTools.Serialization.Wrappers
///
/// Get a file header from the archive
///
- public Models.SGA.File4? GetFile(int index)
+ public Models.SGA.File? GetFile(int index)
{
// If the index is invalid
if (index < 0 || index >= FileCount)
@@ -160,10 +161,10 @@ namespace SabreTools.Serialization.Wrappers
return Directory switch
{
- Models.SGA.Directory4 d4 => d4.Files![index],
- Models.SGA.Directory5 d5 => d5.Files![index],
- Models.SGA.Directory6 d6 => d6.Files![index],
- Models.SGA.Directory7 d7 => d7.Files![index],
+ Directory4 d4 => d4.Files![index],
+ Directory5 d5 => d5.Files![index],
+ Directory6 d6 => d6.Files![index],
+ Directory7 d7 => d7.Files![index],
_ => null,
};
}
@@ -206,20 +207,20 @@ namespace SabreTools.Serialization.Wrappers
return null;
// Get the folder
- object? folder = Directory switch
+ Folder? folder = Directory switch
{
- Models.SGA.Directory4 d4 => Array.Find(d4.Folders ?? [], f => f != null && index >= f.FileStartIndex && index <= f.FileEndIndex),
- Models.SGA.Directory5 d5 => Array.Find(d5.Folders ?? [], f => f != null && index >= f.FileStartIndex && index <= f.FileEndIndex),
- Models.SGA.Directory6 d6 => Array.Find(d6.Folders ?? [], f => f != null && index >= f.FileStartIndex && index <= f.FileEndIndex),
- Models.SGA.Directory7 d7 => Array.Find(d7.Folders ?? [], f => f != null && index >= f.FileStartIndex && index <= f.FileEndIndex),
+ Directory4 d4 => Array.Find(d4.Folders ?? [], f => f != null && index >= f.FileStartIndex && index <= f.FileEndIndex),
+ Directory5 d5 => Array.Find(d5.Folders ?? [], f => f != null && index >= f.FileStartIndex && index <= f.FileEndIndex),
+ Directory6 d6 => Array.Find(d6.Folders ?? [], f => f != null && index >= f.FileStartIndex && index <= f.FileEndIndex),
+ Directory7 d7 => Array.Find(d7.Folders ?? [], f => f != null && index >= f.FileStartIndex && index <= f.FileEndIndex),
_ => default,
};
// Get the folder name
return folder switch
{
- Models.SGA.Folder4 f4 => f4.Name,
- Models.SGA.Folder5 f5 => f5.Name,
+ Folder4 f4 => f4.Name,
+ Folder5 f5 => f5.Name,
_ => null,
};
}
diff --git a/SabreTools.Serialization/Wrappers/WrapperFactory.cs b/SabreTools.Serialization/Wrappers/WrapperFactory.cs
index 89880d61..f5878f11 100644
--- a/SabreTools.Serialization/Wrappers/WrapperFactory.cs
+++ b/SabreTools.Serialization/Wrappers/WrapperFactory.cs
@@ -92,35 +92,22 @@ namespace SabreTools.Serialization.Wrappers
}
// New Executable
-#if NET20
- else if (Matching.Extensions.StartsWith(magic, Models.NewExecutable.Constants.SignatureBytes))
-#else
else if (magic.StartsWith(Models.NewExecutable.Constants.SignatureBytes))
-#endif
{
stream.Seek(0, SeekOrigin.Begin);
return NewExecutable.Create(stream);
}
// Linear Executable
-#if NET20
- else if (Matching.Extensions.StartsWith(magic, Models.LinearExecutable.Constants.LESignatureBytes)
- || Matching.Extensions.StartsWith(magic, Models.LinearExecutable.Constants.LXSignatureBytes))
-#else
else if (magic.StartsWith(Models.LinearExecutable.Constants.LESignatureBytes)
|| magic.StartsWith(Models.LinearExecutable.Constants.LXSignatureBytes))
-#endif
{
stream.Seek(0, SeekOrigin.Begin);
return LinearExecutable.Create(stream);
}
// Portable Executable
-#if NET20
- else if (Matching.Extensions.StartsWith(magic, Models.PortableExecutable.Constants.SignatureBytes))
-#else
else if (magic.StartsWith(Models.PortableExecutable.Constants.SignatureBytes))
-#endif
{
stream.Seek(0, SeekOrigin.Begin);
return PortableExecutable.Create(stream);
@@ -147,19 +134,11 @@ namespace SabreTools.Serialization.Wrappers
#region AACSMediaKeyBlock
// Block starting with verify media key record
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x81, 0x00, 0x00, 0x14 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x81, 0x00, 0x00, 0x14 }))
-#endif
+ if (magic.StartsWith([0x81, 0x00, 0x00, 0x14]))
return WrapperType.AACSMediaKeyBlock;
// Block starting with type and version record
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x10, 0x00, 0x00, 0x0C }))
-#else
- if (magic.StartsWith(new byte?[] { 0x10, 0x00, 0x00, 0x0C }))
-#endif
+ if (magic.StartsWith([0x10, 0x00, 0x00, 0x0C]))
return WrapperType.AACSMediaKeyBlock;
// Shares an extension with INF setup information so it can't be used accurately
@@ -175,11 +154,7 @@ namespace SabreTools.Serialization.Wrappers
#region BDPlusSVM
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x42, 0x44, 0x53, 0x56, 0x4D, 0x5F, 0x43, 0x43 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x42, 0x44, 0x53, 0x56, 0x4D, 0x5F, 0x43, 0x43 }))
-#endif
+ if (magic.StartsWith([0x42, 0x44, 0x53, 0x56, 0x4D, 0x5F, 0x43, 0x43]))
return WrapperType.BDPlusSVM;
if (extension.Equals("svm", StringComparison.OrdinalIgnoreCase))
@@ -189,11 +164,7 @@ namespace SabreTools.Serialization.Wrappers
#region BFPK
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x42, 0x46, 0x50, 0x4b }))
-#else
- if (magic.StartsWith(new byte?[] { 0x42, 0x46, 0x50, 0x4b }))
-#endif
+ if (magic.StartsWith([0x42, 0x46, 0x50, 0x4b]))
return WrapperType.BFPK;
#endregion
@@ -202,31 +173,19 @@ namespace SabreTools.Serialization.Wrappers
// Shares a first 4 bytes with some .mc files
// Shares an extension with VBSP
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x1d, 0x00, 0x00, 0x00 }) && extension.Equals("bsp", StringComparison.OrdinalIgnoreCase))
-#else
- if (magic.StartsWith(new byte?[] { 0x1d, 0x00, 0x00, 0x00 }) && extension.Equals("bsp", StringComparison.OrdinalIgnoreCase))
-#endif
+ if (magic.StartsWith([0x1d, 0x00, 0x00, 0x00]) && extension.Equals("bsp", StringComparison.OrdinalIgnoreCase))
return WrapperType.BSP;
// Shares a first 4 bytes with some .mc files
// Shares an extension with VBSP
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x1e, 0x00, 0x00, 0x00 }) && extension.Equals("bsp", StringComparison.OrdinalIgnoreCase))
-#else
- if (magic.StartsWith(new byte?[] { 0x1e, 0x00, 0x00, 0x00 }) && extension.Equals("bsp", StringComparison.OrdinalIgnoreCase))
-#endif
+ if (magic.StartsWith([0x1e, 0x00, 0x00, 0x00]) && extension.Equals("bsp", StringComparison.OrdinalIgnoreCase))
return WrapperType.BSP;
#endregion
#region BZip2
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x42, 0x52, 0x68 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x42, 0x52, 0x68 }))
-#endif
+ if (magic.StartsWith([0x42, 0x52, 0x68]))
return WrapperType.BZip2;
if (extension.Equals("bz2", StringComparison.OrdinalIgnoreCase))
@@ -236,11 +195,7 @@ namespace SabreTools.Serialization.Wrappers
#region CFB
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 }))
-#else
- if (magic.StartsWith(new byte?[] { 0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1 }))
-#endif
+ if (magic.StartsWith([0xD0, 0xCF, 0x11, 0xE0, 0xA1, 0xB1, 0x1A, 0xE1]))
return WrapperType.CFB;
// Installer package
@@ -267,11 +222,7 @@ namespace SabreTools.Serialization.Wrappers
#region CHD
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x4D, 0x43, 0x6F, 0x6D, 0x70, 0x72, 0x48, 0x44 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x4D, 0x43, 0x6F, 0x6D, 0x70, 0x72, 0x48, 0x44 }))
-#endif
+ if (magic.StartsWith([0x4D, 0x43, 0x6F, 0x6D, 0x70, 0x72, 0x48, 0x44]))
return WrapperType.CHD;
#endregion
@@ -286,63 +237,34 @@ namespace SabreTools.Serialization.Wrappers
#region Executable
// DOS MZ executable file format (and descendants)
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x4d, 0x5a }))
-#else
- if (magic.StartsWith(new byte?[] { 0x4d, 0x5a }))
-#endif
+ if (magic.StartsWith([0x4d, 0x5a]))
return WrapperType.Executable;
- /*
// None of the following are supported yet
-
+ /*
// Executable and Linkable Format
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x7f, 0x45, 0x4c, 0x46 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x7f, 0x45, 0x4c, 0x46 }))
-#endif
- return FileTypes.Executable;
+ if (magic.StartsWith([0x7f, 0x45, 0x4c, 0x46]))
+ return WrapperType.Executable;
// Mach-O binary (32-bit)
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0xfe, 0xed, 0xfa, 0xce }))
-#else
- if (magic.StartsWith(new byte?[] { 0xfe, 0xed, 0xfa, 0xce }))
-#endif
- return FileTypes.Executable;
+ if (magic.StartsWith([0xfe, 0xed, 0xfa, 0xce]))
+ return WrapperType.Executable;
// Mach-O binary (32-bit, reverse byte ordering scheme)
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0xce, 0xfa, 0xed, 0xfe }))
-#else
- if (magic.StartsWith(new byte?[] { 0xce, 0xfa, 0xed, 0xfe }))
-#endif
- return FileTypes.Executable;
+ if (magic.StartsWith([0xce, 0xfa, 0xed, 0xfe]))
+ return WrapperType.Executable;
// Mach-O binary (64-bit)
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0xfe, 0xed, 0xfa, 0xcf }))
-#else
- if (magic.StartsWith(new byte?[] { 0xfe, 0xed, 0xfa, 0xcf }))
-#endif
- return FileTypes.Executable;
+ if (magic.StartsWith([0xfe, 0xed, 0xfa, 0xcf]))
+ return WrapperType.Executable;
// Mach-O binary (64-bit, reverse byte ordering scheme)
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0xcf, 0xfa, 0xed, 0xfe }))
-#else
- if (magic.StartsWith(new byte?[] { 0xcf, 0xfa, 0xed, 0xfe }))
-#endif
- return FileTypes.Executable;
+ if (magic.StartsWith([0xcf, 0xfa, 0xed, 0xfe]))
+ return WrapperType.Executable;
// Prefrred Executable File Format
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x4a, 0x6f, 0x79, 0x21, 0x70, 0x65, 0x66, 0x66 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x4a, 0x6f, 0x79, 0x21, 0x70, 0x65, 0x66, 0x66 }))
-#endif
- return FileTypes.Executable;
+ if (magic.StartsWith([0x4a, 0x6f, 0x79, 0x21, 0x70, 0x65, 0x66, 0x66]))
+ return WrapperType.Executable;
*/
// DOS MZ executable file format (and descendants)
@@ -357,11 +279,7 @@ namespace SabreTools.Serialization.Wrappers
#region GCF
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00 }))
-#endif
+ if (magic.StartsWith([0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00]))
return WrapperType.GCF;
if (extension.Equals("gcf", StringComparison.OrdinalIgnoreCase))
@@ -371,11 +289,7 @@ namespace SabreTools.Serialization.Wrappers
#region GZIP
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x1f, 0x8b }))
-#else
- if (magic.StartsWith(new byte?[] { 0x1f, 0x8b }))
-#endif
+ if (magic.StartsWith([0x1f, 0x8b]))
return WrapperType.GZIP;
if (extension.Equals("gz", StringComparison.OrdinalIgnoreCase))
@@ -392,11 +306,7 @@ namespace SabreTools.Serialization.Wrappers
#region InstallShieldArchiveV3
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x13, 0x5D, 0x65, 0x8C }))
-#else
- if (magic.StartsWith(new byte?[] { 0x13, 0x5D, 0x65, 0x8C }))
-#endif
+ if (magic.StartsWith([0x13, 0x5D, 0x65, 0x8C]))
return WrapperType.InstallShieldArchiveV3;
if (extension.Equals("z", StringComparison.OrdinalIgnoreCase))
@@ -406,11 +316,7 @@ namespace SabreTools.Serialization.Wrappers
#region InstallShieldCAB
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x49, 0x53, 0x63 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x49, 0x53, 0x63 }))
-#endif
+ if (magic.StartsWith([0x49, 0x53, 0x63]))
return WrapperType.InstallShieldCAB;
// Both InstallShieldCAB and MicrosoftCAB share the same extension
@@ -419,22 +325,14 @@ namespace SabreTools.Serialization.Wrappers
#region LDSCRYPT
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x4C, 0x44, 0x53, 0x43, 0x52, 0x59, 0x50, 0x54 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x4C, 0x44, 0x53, 0x43, 0x52, 0x59, 0x50, 0x54 }))
-#endif
+ if (magic.StartsWith([0x4C, 0x44, 0x53, 0x43, 0x52, 0x59, 0x50, 0x54]))
return WrapperType.LDSCRYPT;
#endregion
#region MicrosoftCAB
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x4d, 0x53, 0x43, 0x46 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x4d, 0x53, 0x43, 0x46 }))
-#endif
+ if (magic.StartsWith([0x4d, 0x53, 0x43, 0x46]))
return WrapperType.MicrosoftCAB;
// Both InstallShieldCAB and MicrosoftCAB share the same extension
@@ -443,29 +341,17 @@ namespace SabreTools.Serialization.Wrappers
#region MicrosoftLZ
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x53, 0x5a, 0x44, 0x44, 0x88, 0xf0, 0x27, 0x33 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x53, 0x5a, 0x44, 0x44, 0x88, 0xf0, 0x27, 0x33 }))
-#endif
+ if (magic.StartsWith([0x53, 0x5a, 0x44, 0x44, 0x88, 0xf0, 0x27, 0x33]))
return WrapperType.MicrosoftLZ;
#endregion
#region MoPaQ
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x4d, 0x50, 0x51, 0x1a }))
-#else
- if (magic.StartsWith(new byte?[] { 0x4d, 0x50, 0x51, 0x1a }))
-#endif
+ if (magic.StartsWith([0x4d, 0x50, 0x51, 0x1a]))
return WrapperType.MoPaQ;
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x4d, 0x50, 0x51, 0x1b }))
-#else
- if (magic.StartsWith(new byte?[] { 0x4d, 0x50, 0x51, 0x1b }))
-#endif
+ if (magic.StartsWith([0x4d, 0x50, 0x51, 0x1b]))
return WrapperType.MoPaQ;
if (extension.Equals("mpq", StringComparison.OrdinalIgnoreCase))
@@ -487,11 +373,7 @@ namespace SabreTools.Serialization.Wrappers
#region NCF
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00 }))
-#endif
+ if (magic.StartsWith([0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00]))
return WrapperType.NCF;
if (extension.Equals("ncf", StringComparison.OrdinalIgnoreCase))
@@ -521,11 +403,7 @@ namespace SabreTools.Serialization.Wrappers
#region PAK
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x50, 0x41, 0x43, 0x4B }))
-#else
- if (magic.StartsWith(new byte?[] { 0x50, 0x41, 0x43, 0x4B }))
-#endif
+ if (magic.StartsWith([0x50, 0x41, 0x43, 0x4B]))
return WrapperType.PAK;
// Both PAK and Quantum share one extension
@@ -537,27 +415,15 @@ namespace SabreTools.Serialization.Wrappers
#region PFF
// Version 2
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x14, 0x00, 0x00, 0x00, 0x50, 0x46, 0x46, 0x32 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x14, 0x00, 0x00, 0x00, 0x50, 0x46, 0x46, 0x32 }))
-#endif
+ if (magic.StartsWith([0x14, 0x00, 0x00, 0x00, 0x50, 0x46, 0x46, 0x32]))
return WrapperType.PFF;
// Version 3
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x14, 0x00, 0x00, 0x00, 0x50, 0x46, 0x46, 0x33 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x14, 0x00, 0x00, 0x00, 0x50, 0x46, 0x46, 0x33 }))
-#endif
+ if (magic.StartsWith([0x14, 0x00, 0x00, 0x00, 0x50, 0x46, 0x46, 0x33]))
return WrapperType.PFF;
// Version 4
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x14, 0x00, 0x00, 0x00, 0x50, 0x46, 0x46, 0x34 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x14, 0x00, 0x00, 0x00, 0x50, 0x46, 0x46, 0x34 }))
-#endif
+ if (magic.StartsWith([0x14, 0x00, 0x00, 0x00, 0x50, 0x46, 0x46, 0x34]))
return WrapperType.PFF;
if (extension.Equals("pff", StringComparison.OrdinalIgnoreCase))
@@ -568,35 +434,19 @@ namespace SabreTools.Serialization.Wrappers
#region PKZIP
// PKZIP (Unknown)
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x50, 0x4b, 0x00, 0x00 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x50, 0x4b, 0x00, 0x00 }))
-#endif
+ if (magic.StartsWith([0x50, 0x4b, 0x00, 0x00]))
return WrapperType.PKZIP;
// PKZIP
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x50, 0x4b, 0x03, 0x04 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x50, 0x4b, 0x03, 0x04 }))
-#endif
+ if (magic.StartsWith([0x50, 0x4b, 0x03, 0x04]))
return WrapperType.PKZIP;
// PKZIP (Empty Archive)
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x50, 0x4b, 0x05, 0x06 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x50, 0x4b, 0x05, 0x06 }))
-#endif
+ if (magic.StartsWith([0x50, 0x4b, 0x05, 0x06]))
return WrapperType.PKZIP;
// PKZIP (Spanned Archive)
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x50, 0x4b, 0x07, 0x08 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x50, 0x4b, 0x07, 0x08 }))
-#endif
+ if (magic.StartsWith([0x50, 0x4b, 0x07, 0x08]))
return WrapperType.PKZIP;
// PKZIP
@@ -688,11 +538,7 @@ namespace SabreTools.Serialization.Wrappers
#region PLJ
// https://www.iana.org/assignments/media-types/audio/vnd.everad.plj
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0xFF, 0x9D, 0x53, 0x4B }))
-#else
- if (magic.StartsWith(new byte?[] { 0xFF, 0x9D, 0x53, 0x4B }))
-#endif
+ if (magic.StartsWith([0xFF, 0x9D, 0x53, 0x4B]))
return WrapperType.PlayJAudioFile;
// https://www.iana.org/assignments/media-types/audio/vnd.everad.plj
@@ -703,11 +549,7 @@ namespace SabreTools.Serialization.Wrappers
#region Quantum
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x44, 0x53 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x44, 0x53 }))
-#endif
+ if (magic.StartsWith([0x44, 0x53]))
return WrapperType.Quantum;
if (extension.Equals("q", StringComparison.OrdinalIgnoreCase))
@@ -722,19 +564,11 @@ namespace SabreTools.Serialization.Wrappers
#region RAR
// RAR archive version 1.50 onwards
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00 }))
-#endif
+ if (magic.StartsWith([0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x00]))
return WrapperType.RAR;
// RAR archive version 5.0 onwards
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00 }))
-#endif
+ if (magic.StartsWith([0x52, 0x61, 0x72, 0x21, 0x1a, 0x07, 0x01, 0x00]))
return WrapperType.RAR;
if (extension.Equals("rar", StringComparison.OrdinalIgnoreCase))
@@ -746,31 +580,19 @@ namespace SabreTools.Serialization.Wrappers
// RASGI2.0
// Found in the ".rgs files in IA item "Nova_RealArcadeCD_USA".
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x52, 0x41, 0x53, 0x47, 0x49, 0x32, 0x2E, 0x30 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x52, 0x41, 0x53, 0x47, 0x49, 0x32, 0x2E, 0x30 }))
-#endif
+ if (magic.StartsWith([0x52, 0x41, 0x53, 0x47, 0x49, 0x32, 0x2E, 0x30]))
return WrapperType.RealArcadeInstaller;
// XZip2.0
// Found in the ".mez" files in IA item "Nova_RealArcadeCD_USA".
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x58, 0x5A, 0x69, 0x70, 0x32, 0x2E, 0x30 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x58, 0x5A, 0x69, 0x70, 0x32, 0x2E, 0x30 }))
-#endif
+ if (magic.StartsWith([0x58, 0x5A, 0x69, 0x70, 0x32, 0x2E, 0x30]))
return WrapperType.RealArcadeMezzanine;
#endregion
#region SevenZip
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x37, 0x7a, 0xbc, 0xaf, 0x27, 0x1c }))
-#else
- if (magic.StartsWith(new byte?[] { 0x37, 0x7a, 0xbc, 0xaf, 0x27, 0x1c }))
-#endif
+ if (magic.StartsWith([0x37, 0x7a, 0xbc, 0xaf, 0x27, 0x1c]))
return WrapperType.SevenZip;
if (extension.Equals("7z", StringComparison.OrdinalIgnoreCase))
@@ -781,22 +603,14 @@ namespace SabreTools.Serialization.Wrappers
#region SFFS
// Found in Redump entry 81756, confirmed to be "StarForce Filesystem" by PiD.
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x53, 0x46, 0x46, 0x53 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x53, 0x46, 0x46, 0x53 }))
-#endif
+ if (magic.StartsWith([0x53, 0x46, 0x46, 0x53]))
return WrapperType.SFFS;
#endregion
#region SGA
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x5F, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x5F, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45 }))
-#endif
+ if (magic.StartsWith([0x5F, 0x41, 0x52, 0x43, 0x48, 0x49, 0x56, 0x45]))
return WrapperType.SGA;
if (extension.Equals("sga", StringComparison.OrdinalIgnoreCase))
@@ -806,18 +620,10 @@ namespace SabreTools.Serialization.Wrappers
#region TapeArchive
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x75, 0x73, 0x74, 0x61, 0x72, 0x00, 0x30, 0x30 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x75, 0x73, 0x74, 0x61, 0x72, 0x00, 0x30, 0x30 }))
-#endif
+ if (magic.StartsWith([0x75, 0x73, 0x74, 0x61, 0x72, 0x00, 0x30, 0x30]))
return WrapperType.TapeArchive;
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00 }))
-#endif
+ if (magic.StartsWith([0x75, 0x73, 0x74, 0x61, 0x72, 0x20, 0x20, 0x00]))
return WrapperType.TapeArchive;
if (extension.Equals("tar", StringComparison.OrdinalIgnoreCase))
@@ -830,60 +636,32 @@ namespace SabreTools.Serialization.Wrappers
// Not all textfiles can be determined through magic number
// HTML
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x3c, 0x68, 0x74, 0x6d, 0x6c }))
-#else
- if (magic.StartsWith(new byte?[] { 0x3c, 0x68, 0x74, 0x6d, 0x6c }))
-#endif
+ if (magic.StartsWith([0x3c, 0x68, 0x74, 0x6d, 0x6c]))
return WrapperType.Textfile;
// HTML and XML
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45 }))
-#endif
+ if (magic.StartsWith([0x3c, 0x21, 0x44, 0x4f, 0x43, 0x54, 0x59, 0x50, 0x45]))
return WrapperType.Textfile;
// InstallShield Compiled Rules
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x61, 0x4C, 0x75, 0x5A }))
-#else
- if (magic.StartsWith(new byte?[] { 0x61, 0x4C, 0x75, 0x5A }))
-#endif
+ if (magic.StartsWith([0x61, 0x4C, 0x75, 0x5A]))
return WrapperType.Textfile;
// Microsoft Office File (old)
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1 }))
-#else
- if (magic.StartsWith(new byte?[] { 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1 }))
-#endif
+ if (magic.StartsWith([0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1]))
return WrapperType.Textfile;
// Rich Text File
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x7b, 0x5c, 0x72, 0x74, 0x66, 0x31 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x7b, 0x5c, 0x72, 0x74, 0x66, 0x31 }))
-#endif
+ if (magic.StartsWith([0x7b, 0x5c, 0x72, 0x74, 0x66, 0x31]))
return WrapperType.Textfile;
// Windows Help File
-#if NET20
- if (Matching.Extensions.StartsWith(magic, new byte?[] { 0x3F, 0x5F, 0x03, 0x00 }))
-#else
- if (magic.StartsWith(new byte?[] { 0x3F, 0x5F, 0x03, 0x00 }))
-#endif
+ if (magic.StartsWith([0x3F, 0x5F, 0x03, 0x00]))
return WrapperType.Textfile;
// XML
// "