diff --git a/SabreTools.Serialization/Models/SecuROM/AddD.cs b/SabreTools.Serialization/Models/SecuROM/AddD.cs index d9b64d62..533c8f3b 100644 --- a/SabreTools.Serialization/Models/SecuROM/AddD.cs +++ b/SabreTools.Serialization/Models/SecuROM/AddD.cs @@ -13,7 +13,7 @@ /// /// "AddD" /// - public string? Signature { get; set; } + public string Signature { get; set; } /// s /// Entry count @@ -24,13 +24,13 @@ /// Version, null-terminated /// /// Always 8 bytes? - public string? Version { get; set; } + public string Version { get; set; } /// /// Build number /// /// 4 bytes - public string? Build { get; set; } + public string Build { get; set; } /// /// Unknown @@ -44,7 +44,7 @@ /// /// 10 bytes, only present in 4.84.00.0054, 4.84.69.0037, 4.84.76.7966, 4.84.76.7968, 4.85.07.0009 /// - public string? ProductId { get; set; } + public string ProductId { get; set; } /// /// Unknown @@ -57,6 +57,6 @@ /// /// Entry table /// - public AddDEntry[]? Entries { get; set; } + public AddDEntry[] Entries { get; set; } } } diff --git a/SabreTools.Serialization/Models/SecuROM/AddDEntry.cs b/SabreTools.Serialization/Models/SecuROM/AddDEntry.cs index cfea2587..6ee676ab 100644 --- a/SabreTools.Serialization/Models/SecuROM/AddDEntry.cs +++ b/SabreTools.Serialization/Models/SecuROM/AddDEntry.cs @@ -112,7 +112,7 @@ namespace SabreTools.Data.Models.SecuROM /// /// 12 bytes long in all samples [MarshalAs(UnmanagedType.LPStr)] - public string? FileName; + public string FileName; /// /// Unknown (0x2C) diff --git a/SabreTools.Serialization/Models/SecuROM/Constants.cs b/SabreTools.Serialization/Models/SecuROM/Constants.cs index a00aa0e1..d61344bb 100644 --- a/SabreTools.Serialization/Models/SecuROM/Constants.cs +++ b/SabreTools.Serialization/Models/SecuROM/Constants.cs @@ -127,4 +127,4 @@ namespace SabreTools.Data.Models.SecuROM #endregion } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/SecuROM/DFAFile.cs b/SabreTools.Serialization/Models/SecuROM/DFAFile.cs index e4222881..296f400e 100644 --- a/SabreTools.Serialization/Models/SecuROM/DFAFile.cs +++ b/SabreTools.Serialization/Models/SecuROM/DFAFile.cs @@ -22,6 +22,6 @@ namespace SabreTools.Data.Models.SecuROM /// /// All entries in the file /// - public DFAEntry[]? Entries { get; set; } + public DFAEntry[] Entries { get; set; } } } diff --git a/SabreTools.Serialization/Models/SecuROM/Enums.cs b/SabreTools.Serialization/Models/SecuROM/Enums.cs index 6290e538..01868517 100644 --- a/SabreTools.Serialization/Models/SecuROM/Enums.cs +++ b/SabreTools.Serialization/Models/SecuROM/Enums.cs @@ -29,8 +29,8 @@ namespace SabreTools.Data.Models.SecuROM Dependency = 0x04, /// - /// Similar use to + /// Similar use to /// Unknown0x08 = 0x08, } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/SecuROM/MatroshkaEntry.cs b/SabreTools.Serialization/Models/SecuROM/MatroshkaEntry.cs index 3ee4c7f4..cd59e531 100644 --- a/SabreTools.Serialization/Models/SecuROM/MatroshkaEntry.cs +++ b/SabreTools.Serialization/Models/SecuROM/MatroshkaEntry.cs @@ -10,7 +10,7 @@ namespace SabreTools.Data.Models.SecuROM /// Versions with key values either are 256 or 512 bytes. /// Stored as a string as the rest of the 256/512 bytes are just padding. /// - public string? Path { get; set; } + public string Path { get; set; } /// /// Type of the entry data diff --git a/SabreTools.Serialization/Models/SecuROM/MatroshkaPackage.cs b/SabreTools.Serialization/Models/SecuROM/MatroshkaPackage.cs index cc63a401..a5c8747b 100644 --- a/SabreTools.Serialization/Models/SecuROM/MatroshkaPackage.cs +++ b/SabreTools.Serialization/Models/SecuROM/MatroshkaPackage.cs @@ -19,7 +19,7 @@ namespace SabreTools.Data.Models.SecuROM /// "MatR" /// /// 4 bytes - public string? Signature { get; set; } + public string Signature { get; set; } /// /// Number of internal entries @@ -79,8 +79,8 @@ namespace SabreTools.Data.Models.SecuROM #endregion /// - /// Entries array whose length is given by + /// Entries array whose length is given by /// - public MatroshkaEntry[]? Entries { get; set; } + public MatroshkaEntry[] Entries { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Wrappers/SecuROMDFA.Printing.cs b/SabreTools.Serialization/Wrappers/SecuROMDFA.Printing.cs index 2435b72e..339ca567 100644 --- a/SabreTools.Serialization/Wrappers/SecuROMDFA.Printing.cs +++ b/SabreTools.Serialization/Wrappers/SecuROMDFA.Printing.cs @@ -24,11 +24,11 @@ namespace SabreTools.Serialization.Wrappers Print(builder, Model.Entries); } - private static void Print(StringBuilder builder, DFAEntry[]? entries) + private static void Print(StringBuilder builder, DFAEntry[] entries) { builder.AppendLine(" Entries Information:"); builder.AppendLine(" -------------------------"); - if (entries == null || entries.Length == 0) + if (entries.Length == 0) { builder.AppendLine(" No entries"); builder.AppendLine(); @@ -38,24 +38,14 @@ namespace SabreTools.Serialization.Wrappers for (int i = 0; i < entries.Length; i++) { var entry = entries[i]; - Print(builder, entry, i); + + builder.AppendLine($" Entry {i}"); + builder.AppendLine(entry.Name, " Name"); + builder.AppendLine(entry.Length, " Length"); + builder.AppendLine(entry.Value, " Value"); } builder.AppendLine(); } - - private static void Print(StringBuilder builder, DFAEntry? entry, int index) - { - builder.AppendLine($" Entry {index}"); - if (entry == null) - { - builder.AppendLine(" [NULL]"); - return; - } - - builder.AppendLine(entry.Name, " Name"); - builder.AppendLine(entry.Length, " Length"); - builder.AppendLine(entry.Value, " Value"); - } } } diff --git a/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.Extraction.cs b/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.Extraction.cs index 4e71cad3..b5bbbf58 100644 --- a/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.Extraction.cs +++ b/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.Extraction.cs @@ -11,7 +11,7 @@ namespace SabreTools.Serialization.Wrappers public bool Extract(string outputDirectory, bool includeDebug) { // If we have no entries - if (Entries == null || Entries.Length == 0) + if (Entries.Length == 0) return false; // Loop through and extract all files to the output @@ -34,7 +34,7 @@ namespace SabreTools.Serialization.Wrappers public bool ExtractFile(int index, string outputDirectory, bool includeDebug) { // If we have no entries - if (Entries == null || Entries.Length == 0) + if (Entries.Length == 0) return false; // If the entry index is invalid @@ -128,4 +128,4 @@ namespace SabreTools.Serialization.Wrappers return fileData; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.Printing.cs b/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.Printing.cs index ace2db3d..1424b872 100644 --- a/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.Printing.cs +++ b/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.Printing.cs @@ -29,11 +29,11 @@ namespace SabreTools.Serialization.Wrappers Print(builder, Model.Entries); } - private static void Print(StringBuilder builder, MatroshkaEntry[]? entries) + private static void Print(StringBuilder builder, MatroshkaEntry[] entries) { builder.AppendLine(" Entries Information:"); builder.AppendLine(" -------------------------"); - if (entries == null || entries.Length == 0) + if (entries.Length == 0) { builder.AppendLine(" No entries"); builder.AppendLine(); diff --git a/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.cs b/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.cs index 538c1c40..0de8391d 100644 --- a/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.cs +++ b/SabreTools.Serialization/Wrappers/SecuROMMatroschkaPackage.cs @@ -36,7 +36,7 @@ namespace SabreTools.Serialization.Wrappers public uint? Padding => Model.Padding; /// - public MatroshkaEntry[]? Entries => Model.Entries; + public MatroshkaEntry[] Entries => Model.Entries; #endregion