diff --git a/SabreTools.Serialization/Models/IRD/File.cs b/SabreTools.Serialization/Models/IRD/File.cs index 24dbbdf2..ec7dd3aa 100644 --- a/SabreTools.Serialization/Models/IRD/File.cs +++ b/SabreTools.Serialization/Models/IRD/File.cs @@ -19,7 +19,7 @@ namespace SabreTools.Data.Models.IRD /// The same value stored in PARAM.SFO / TITLE_ID /// /// 9 bytes, ASCII, stored without dashes - public string? TitleID { get; set; } + public string TitleID { get; set; } /// /// Number of bytes that follow containing the title @@ -30,25 +30,25 @@ namespace SabreTools.Data.Models.IRD /// The same value stored in PARAM.SFO / TITLE /// /// bytes, ASCII - public string? Title { get; set; } + public string Title { get; set; } /// /// The same value stored in PARAM.SFO / PS3_SYSTEM_VER /// /// 4 bytes, ASCII, missing uses "0000" - public string? SystemVersion { get; set; } + public string SystemVersion { get; set; } /// /// The same value stored in PARAM.SFO / VERSION /// /// 5 bytes, ASCII - public string? GameVersion { get; set; } + public string GameVersion { get; set; } /// /// The same value stored in PARAM.SFO / APP_VER /// /// 5 bytes, ASCII - public string? AppVersion { get; set; } + public string AppVersion { get; set; } /// /// Length of the gzip-compressed header data @@ -79,7 +79,7 @@ namespace SabreTools.Data.Models.IRD /// MD5 hashes for all complete regions in the image /// /// regions, 16-bytes per hash - public byte[][]? RegionHashes { get; set; } + public byte[][] RegionHashes { get; set; } /// /// Number of decrypted files in the image @@ -90,13 +90,13 @@ namespace SabreTools.Data.Models.IRD /// Starting sector for each decrypted file /// /// files, alternating with each entry - public ulong[]? FileKeys { get; set; } + public ulong[] FileKeys { get; set; } /// /// MD5 hashes for all decrypted files in the image /// /// files, 16-bytes per hash, alternating with each entry - public byte[][]? FileHashes { get; set; } + public byte[][] FileHashes { get; set; } /// /// Extra Config, usually 0x0000 diff --git a/SabreTools.Serialization/Wrappers/IRD.Printing.cs b/SabreTools.Serialization/Wrappers/IRD.Printing.cs index 38035434..e550a9c4 100644 --- a/SabreTools.Serialization/Wrappers/IRD.Printing.cs +++ b/SabreTools.Serialization/Wrappers/IRD.Printing.cs @@ -27,22 +27,23 @@ namespace SabreTools.Serialization.Wrappers builder.AppendLine(Model.Header, "Header"); builder.AppendLine(Model.FooterLength, "Footer length"); builder.AppendLine(Model.Footer, "Footer"); + builder.AppendLine(Model.RegionCount, "Region count"); - if (Model.RegionCount != 0 && Model.RegionHashes != null && Model.RegionHashes.Length != 0) + if (Model.RegionCount != 0 && Model.RegionHashes.Length != 0) { for (int i = 0; i < Model.RegionCount; i++) { builder.AppendLine(Model.RegionHashes[i], $"Region {i} hash"); } } + builder.AppendLine(Model.FileCount, "File count"); for (int i = 0; i < Model.FileCount; i++) { - if (Model.FileKeys != null) - builder.AppendLine(Model.FileKeys[i], $"File {i} key"); - if (Model.FileHashes != null) - builder.AppendLine(Model.FileHashes[i], $"File {i} hash"); + builder.AppendLine(Model.FileKeys[i], $"File {i} key"); + builder.AppendLine(Model.FileHashes[i], $"File {i} hash"); } + builder.AppendLine(Model.ExtraConfig, "Extra config"); builder.AppendLine(Model.Attachments, "Attachments"); builder.AppendLine(Model.Data1Key, "Data 1 key"); diff --git a/SabreTools.Serialization/Writers/IRD.cs b/SabreTools.Serialization/Writers/IRD.cs index 1916baaa..79e4233a 100644 --- a/SabreTools.Serialization/Writers/IRD.cs +++ b/SabreTools.Serialization/Writers/IRD.cs @@ -23,31 +23,31 @@ namespace SabreTools.Serialization.Writers return null; // If any static-length fields aren't the correct length - if (obj.TitleID == null || obj.TitleID.Length != 9) + if (obj.TitleID.Length != 9) return null; - if (obj.Title == null || obj.Title.Length != obj.TitleLength) + if (obj.Title.Length != obj.TitleLength) return null; - if (obj.SystemVersion == null || obj.SystemVersion.Length != 4) + if (obj.SystemVersion.Length != 4) return null; - if (obj.GameVersion == null || obj.GameVersion.Length != 5) + if (obj.GameVersion.Length != 5) return null; - if (obj.AppVersion == null || obj.AppVersion.Length != 5) + if (obj.AppVersion.Length != 5) return null; - if (obj.Header == null || obj.Header.Length != obj.HeaderLength) + if (obj.Header.Length != obj.HeaderLength) return null; - if (obj.Footer == null || obj.Footer.Length != obj.FooterLength) + if (obj.Footer.Length != obj.FooterLength) return null; - if (obj.RegionHashes == null || obj.RegionHashes.Length != obj.RegionCount || !Array.TrueForAll(obj.RegionHashes, h => h == null || h.Length != 16)) + if (obj.RegionHashes.Length != obj.RegionCount || !Array.TrueForAll(obj.RegionHashes, h => h == null || h.Length != 16)) return null; - if (obj.FileKeys == null || obj.FileKeys.Length != obj.FileCount) + if (obj.FileKeys.Length != obj.FileCount) return null; - if (obj.FileHashes == null || obj.FileHashes.Length != obj.FileCount || !Array.TrueForAll(obj.FileHashes, h => h == null || h.Length != 16)) + if (obj.FileHashes.Length != obj.FileCount || !Array.TrueForAll(obj.FileHashes, h => h == null || h.Length != 16)) return null; - if (obj.PIC == null || obj.PIC.Length != 115) + if (obj.PIC.Length != 115) return null; - if (obj.Data1Key == null || obj.Data1Key.Length != 16) + if (obj.Data1Key.Length != 16) return null; - if (obj.Data2Key == null || obj.Data2Key.Length != 16) + if (obj.Data2Key.Length != 16) return null; // Create the output stream