diff --git a/InfoPrint/Features/MainFeature.cs b/InfoPrint/Features/MainFeature.cs index 4682c53a..57fb3fc7 100644 --- a/InfoPrint/Features/MainFeature.cs +++ b/InfoPrint/Features/MainFeature.cs @@ -159,8 +159,7 @@ namespace InfoPrint.Features using Stream stream = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); // Read the first 8 bytes - byte[]? magic = stream.ReadBytes(8); - stream.SeekIfPossible(0, SeekOrigin.Begin); + byte[] magic = stream.PeekBytes(8); // Get the file type string extension = Path.GetExtension(file).TrimStart('.'); diff --git a/SabreTools.Serialization/Extensions/PortableExecutable.cs b/SabreTools.Serialization/Extensions/PortableExecutable.cs index ad4152b7..9414bc13 100644 --- a/SabreTools.Serialization/Extensions/PortableExecutable.cs +++ b/SabreTools.Serialization/Extensions/PortableExecutable.cs @@ -898,9 +898,8 @@ namespace SabreTools.Data.Extensions messageResourceEntry.Flags = entry.Data.ReadUInt16LittleEndian(ref offset); Encoding textEncoding = messageResourceEntry.Flags == 0x0001 ? Encoding.Unicode : Encoding.ASCII; - byte[]? textArray = entry.Data.ReadBytes(ref offset, messageResourceEntry.Length - 4); - if (textArray != null) - messageResourceEntry.Text = textEncoding.GetString(textArray); + byte[] textArray = entry.Data.ReadBytes(ref offset, messageResourceEntry.Length - 4); + messageResourceEntry.Text = textEncoding.GetString(textArray); messageResourceEntries[j] = messageResourceEntry; } @@ -1007,7 +1006,7 @@ namespace SabreTools.Data.Extensions // Create the output table var stringTable = new Dictionary(); - // Loop through and add + // Loop through and add while (offset < entry.Data.Length) { string? stringValue = entry.Data.ReadPrefixedUnicodeString(ref offset); diff --git a/SabreTools.Serialization/Models/AACS/DriveRevocationListEntry.cs b/SabreTools.Serialization/Models/AACS/DriveRevocationListEntry.cs index 92083f6f..4af279f6 100644 --- a/SabreTools.Serialization/Models/AACS/DriveRevocationListEntry.cs +++ b/SabreTools.Serialization/Models/AACS/DriveRevocationListEntry.cs @@ -20,6 +20,6 @@ namespace SabreTools.Data.Models.AACS /// case of a non-zero Range value). /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] - public byte[]? DriveID; + public byte[] DriveID = new byte[6]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/AACS/EndOfMediaKeyBlockRecord.cs b/SabreTools.Serialization/Models/AACS/EndOfMediaKeyBlockRecord.cs index 5b083f11..98c7b488 100644 --- a/SabreTools.Serialization/Models/AACS/EndOfMediaKeyBlockRecord.cs +++ b/SabreTools.Serialization/Models/AACS/EndOfMediaKeyBlockRecord.cs @@ -18,6 +18,7 @@ namespace SabreTools.Data.Models.AACS /// determines that the signature does not verify or is omitted, it /// must refuse to use the Media Key. /// - public byte[]? SignatureData { get; set; } + /// -4 bytes + public byte[] SignatureData { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/AACS/GenericRecord.cs b/SabreTools.Serialization/Models/AACS/GenericRecord.cs index 159c98c1..9711fb4d 100644 --- a/SabreTools.Serialization/Models/AACS/GenericRecord.cs +++ b/SabreTools.Serialization/Models/AACS/GenericRecord.cs @@ -8,6 +8,6 @@ namespace SabreTools.Data.Models.AACS /// /// Unparsed data comprising the record after the header /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/AACS/HostRevocationListEntry.cs b/SabreTools.Serialization/Models/AACS/HostRevocationListEntry.cs index 2e4bb00f..66848c73 100644 --- a/SabreTools.Serialization/Models/AACS/HostRevocationListEntry.cs +++ b/SabreTools.Serialization/Models/AACS/HostRevocationListEntry.cs @@ -20,6 +20,6 @@ namespace SabreTools.Data.Models.AACS /// Range value). /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] - public byte[]? HostID; + public byte[] HostID = new byte[6]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/AACS/VerifyMediaKeyRecord.cs b/SabreTools.Serialization/Models/AACS/VerifyMediaKeyRecord.cs index 2e65a4e0..03780af7 100644 --- a/SabreTools.Serialization/Models/AACS/VerifyMediaKeyRecord.cs +++ b/SabreTools.Serialization/Models/AACS/VerifyMediaKeyRecord.cs @@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.AACS /// where 0xXXXXXXXXXXXXXXXX is an arbitrary 8-byte value, and Km is /// the correct final Media Key value. /// - public byte[]? CiphertextValue { get; set; } + public byte[] CiphertextValue { get; set; } = new byte[0x10]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BDPlus/SVM.cs b/SabreTools.Serialization/Models/BDPlus/SVM.cs index 7e58e7f9..142007f1 100644 --- a/SabreTools.Serialization/Models/BDPlus/SVM.cs +++ b/SabreTools.Serialization/Models/BDPlus/SVM.cs @@ -15,7 +15,7 @@ namespace SabreTools.Data.Models.BDPlus /// Unknown data /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] - public byte[]? Unknown1 = new byte[5]; + public byte[] Unknown1 = new byte[5]; /// /// Version year @@ -43,8 +43,8 @@ namespace SabreTools.Data.Models.BDPlus public uint Length; /// - /// Length bytes of data + /// bytes of data /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspFace.cs b/SabreTools.Serialization/Models/BSP/BspFace.cs index e149bf96..b8e2595a 100644 --- a/SabreTools.Serialization/Models/BSP/BspFace.cs +++ b/SabreTools.Serialization/Models/BSP/BspFace.cs @@ -4,7 +4,7 @@ namespace SabreTools.Data.Models.BSP { /// /// The face lump contains the surfaces of the scene. - /// + /// /// The first number of this data structure is an index into /// the planes lump giving a plane which is parallel to this /// face (meaning they share the same normal). The second @@ -22,7 +22,7 @@ namespace SabreTools.Data.Models.BSP /// an offset in byes giving the beginning of the binary lightmap /// data of this face in the lighting lump. /// - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class BspFace { @@ -55,7 +55,7 @@ namespace SabreTools.Data.Models.BSP /// Specify lighting styles /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - public byte[]? LightingStyles = new byte[4]; + public byte[] LightingStyles = new byte[4]; /// /// Offsets into the raw lightmap data; if less than zero, @@ -63,4 +63,4 @@ namespace SabreTools.Data.Models.BSP /// public int LightmapOffset; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspLeaf.cs b/SabreTools.Serialization/Models/BSP/BspLeaf.cs index cbf1bd1f..df36e61a 100644 --- a/SabreTools.Serialization/Models/BSP/BspLeaf.cs +++ b/SabreTools.Serialization/Models/BSP/BspLeaf.cs @@ -4,7 +4,7 @@ namespace SabreTools.Data.Models.BSP { /// /// The leaves lump contains the leaves of the BSP tree. - /// + /// /// The first entry of this struct is the type of the content /// of this leaf. It can be one of the predefined values, found /// in the compiler source codes, and is litte relevant for the @@ -22,7 +22,7 @@ namespace SabreTools.Data.Models.BSP /// specify the volume of ambient sounds in Quake, but are unused in /// GoldSrc. /// - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class BspLeaf { @@ -62,6 +62,6 @@ namespace SabreTools.Data.Models.BSP /// Ambient sound levels /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - public byte[]? AmbientLevels = new byte[4]; + public byte[] AmbientLevels = new byte[4]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/LzmaHeader.cs b/SabreTools.Serialization/Models/BSP/LzmaHeader.cs index e5a100ae..c538ce79 100644 --- a/SabreTools.Serialization/Models/BSP/LzmaHeader.cs +++ b/SabreTools.Serialization/Models/BSP/LzmaHeader.cs @@ -8,12 +8,12 @@ namespace SabreTools.Data.Models.BSP /// In this case, the lump data starts with the following header /// (from public/tier1/lzmaDecoder.h), which is used in place of /// the standard 13-byte LZMA header. - /// + /// /// lzmaSize denotes the size (in bytes) of compressed data, it /// is equal to the size of a lump minus 17 bytes (lzma header). /// actualSize denotes the size of decompressed data. properties[5] /// field are used solely for LZMA decoding. - /// + /// /// There are two special cases for compression: LUMP_PAKFILE is never /// compressed as a lump (the contents of the zip are compressed instead) /// and each of the game lumps in LUMP_GAME_LUMP are compressed individually. @@ -35,6 +35,6 @@ namespace SabreTools.Data.Models.BSP public uint LzmaSize; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] - public byte[]? Properties = new byte[5]; + public byte[] Properties = new byte[5]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/PakfileLump.cs b/SabreTools.Serialization/Models/BSP/PakfileLump.cs index 67a33dd1..d7c9f36d 100644 --- a/SabreTools.Serialization/Models/BSP/PakfileLump.cs +++ b/SabreTools.Serialization/Models/BSP/PakfileLump.cs @@ -13,31 +13,31 @@ namespace SabreTools.Data.Models.BSP /// These files are integrated into the game engine's file system /// and will be loaded preferentially before externally located /// files are used. - /// + /// /// The format of the Pakfile lump is identical to that used by the /// Zip compression utility when no compression is specified (i.e., /// the individual files are stored in uncompressed format). In some /// branches, such as , LZMA compression can be used as well. If the /// Pakfile lump is extracted and written to a file, it can therefore /// be opened with WinZip and similar programs. - /// + /// /// The header public/zip_uncompressed.h defines the structures /// present in the Pakfile lump. The last element in the lump is a /// ZIP_EndOfCentralDirRecord structure. This points to an array of /// ZIP_FileHeader structures immediately preceeding it, one for each /// file present in the Pak. Each of these headers then point to /// ZIP_LocalFileHeader structures that are followed by that file's - /// data. - /// + /// data. + /// /// The Pakfile lump is usually the last element of the bsp file. /// - /// + /// public sealed class PakfileLump { /// /// Pakfile data /// /// TODO: Split and/or decompress data? - public byte[]? Data; + public byte[] Data; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/PhysModel.cs b/SabreTools.Serialization/Models/BSP/PhysModel.cs index 1851f8aa..6d855b29 100644 --- a/SabreTools.Serialization/Models/BSP/PhysModel.cs +++ b/SabreTools.Serialization/Models/BSP/PhysModel.cs @@ -30,13 +30,13 @@ namespace SabreTools.Data.Models.BSP public int SolidCount; /// - /// Collision data of length + /// Collision data of length /// public PhysSolid[]? Solids; /// - /// Key data of size + /// Key data of size /// - public byte[]? TextData; + public byte[] TextData; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/PhysSolid.cs b/SabreTools.Serialization/Models/BSP/PhysSolid.cs index 21c35c4f..b0ba6ec4 100644 --- a/SabreTools.Serialization/Models/BSP/PhysSolid.cs +++ b/SabreTools.Serialization/Models/BSP/PhysSolid.cs @@ -18,8 +18,8 @@ namespace SabreTools.Data.Models.BSP public int Size; /// - /// Collision data of length + /// Collision data of length /// - public byte[]? CollisionData; + public byte[] CollisionData; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspFace.cs b/SabreTools.Serialization/Models/BSP/VbspFace.cs index bf16ce40..7fc457b0 100644 --- a/SabreTools.Serialization/Models/BSP/VbspFace.cs +++ b/SabreTools.Serialization/Models/BSP/VbspFace.cs @@ -10,7 +10,7 @@ namespace SabreTools.Data.Models.BSP /// the faces of brushes created in Hammer. Faces are always flat, /// convex polygons, though they can contain edges that are co-linear. /// - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class VbspFace { @@ -58,7 +58,7 @@ namespace SabreTools.Data.Models.BSP /// Switchable lighting info /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - public byte[]? Styles = new byte[4]; + public byte[] Styles = new byte[4]; /// /// Offset into lightmap lump @@ -102,4 +102,4 @@ namespace SabreTools.Data.Models.BSP /// public uint SmoothingGroups; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspLumpEntry.cs b/SabreTools.Serialization/Models/BSP/VbspLumpEntry.cs index 460aeb5d..09aad2e7 100644 --- a/SabreTools.Serialization/Models/BSP/VbspLumpEntry.cs +++ b/SabreTools.Serialization/Models/BSP/VbspLumpEntry.cs @@ -17,6 +17,6 @@ namespace SabreTools.Data.Models.BSP /// /// Default to 0, 0, 0, 0 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - public byte[]? FourCC = new byte[4]; + public byte[] FourCC = new byte[4]; } } diff --git a/SabreTools.Serialization/Models/BZip2/BlockHeader.cs b/SabreTools.Serialization/Models/BZip2/BlockHeader.cs index 04a41087..edbbd0ad 100644 --- a/SabreTools.Serialization/Models/BZip2/BlockHeader.cs +++ b/SabreTools.Serialization/Models/BZip2/BlockHeader.cs @@ -9,7 +9,7 @@ namespace SabreTools.Data.Models.BZip2 /// from the footer. /// /// This may not be byte-aligned - public byte[]? Magic { get; set; } + public byte[] Magic { get; set; } = new byte[6]; /// /// The CRC-32 checksum of the uncompressed data contained diff --git a/SabreTools.Serialization/Models/BZip2/Footer.cs b/SabreTools.Serialization/Models/BZip2/Footer.cs index 0bfdcee2..547fc035 100644 --- a/SabreTools.Serialization/Models/BZip2/Footer.cs +++ b/SabreTools.Serialization/Models/BZip2/Footer.cs @@ -9,7 +9,7 @@ namespace SabreTools.Data.Models.BZip2 /// from the footer. /// /// This may not be byte-aligned - public byte[]? Magic { get; set; } + public byte[] Magic { get; set; } = new byte[6]; /// /// Contains a custom checksum computed using each of diff --git a/SabreTools.Serialization/Models/CFB/FileHeader.cs b/SabreTools.Serialization/Models/CFB/FileHeader.cs index b9062aa5..75d04938 100644 --- a/SabreTools.Serialization/Models/CFB/FileHeader.cs +++ b/SabreTools.Serialization/Models/CFB/FileHeader.cs @@ -40,10 +40,10 @@ namespace SabreTools.Data.Models.CFB /// This field MUST be set to 0x0009, or 0x000c, depending on the Major /// Version field. This field specifies the sector size of the compound file /// as a power of 2. - /// + /// /// If Major Version is 3, the Sector Shift MUST be 0x0009, specifying a /// sector size of 512 bytes. - /// + /// /// If Major Version is 4, the Sector Shift MUST be 0x000C, specifying a /// sector size of 4096 bytes. /// @@ -61,12 +61,12 @@ namespace SabreTools.Data.Models.CFB /// /// 6 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] - public byte[]? Reserved; + public byte[] Reserved = new byte[6]; /// /// This integer field contains the count of the number of directory sectors /// in the compound file. - /// + /// /// If Major Version is 3, the Number of Directory Sectors MUST be zero. This /// field is not supported for version 3 compound files. /// @@ -130,4 +130,4 @@ namespace SabreTools.Data.Models.CFB [MarshalAs(UnmanagedType.ByValArray, SizeConst = 109)] public SectorNumber[]? DIFAT; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/CFB/SummaryInformation.cs b/SabreTools.Serialization/Models/CFB/SummaryInformation.cs index 5d5388f2..523d11b7 100644 --- a/SabreTools.Serialization/Models/CFB/SummaryInformation.cs +++ b/SabreTools.Serialization/Models/CFB/SummaryInformation.cs @@ -36,7 +36,7 @@ namespace SabreTools.Data.Models.CFB /// /// 4 bytes of reserved data /// - public byte[]? Reserved { get; set; } + public byte[] Reserved { get; set; } = new byte[4]; #endregion @@ -50,7 +50,7 @@ namespace SabreTools.Data.Models.CFB /// /// 16 bytes of unknown data /// - public byte[]? Unknown { get; set; } + public byte[] Unknown { get; set; } = new byte[16]; #endregion @@ -79,4 +79,4 @@ namespace SabreTools.Data.Models.CFB #endregion } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/CHD/HeaderV2.cs b/SabreTools.Serialization/Models/CHD/HeaderV2.cs index bafbcf07..d7c1217a 100644 --- a/SabreTools.Serialization/Models/CHD/HeaderV2.cs +++ b/SabreTools.Serialization/Models/CHD/HeaderV2.cs @@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.CHD { - /// + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public class HeaderV2 : Header { @@ -47,13 +47,13 @@ namespace SabreTools.Data.Models.CHD /// MD5 checksum of raw data /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[]? MD5 = new byte[16]; + public byte[] MD5 = new byte[16]; /// /// MD5 checksum of parent file /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[]? ParentMD5 = new byte[16]; + public byte[] ParentMD5 = new byte[16]; /// /// Number of bytes per sector diff --git a/SabreTools.Serialization/Models/CHD/HeaderV3.cs b/SabreTools.Serialization/Models/CHD/HeaderV3.cs index 67d527ea..ae99f3be 100644 --- a/SabreTools.Serialization/Models/CHD/HeaderV3.cs +++ b/SabreTools.Serialization/Models/CHD/HeaderV3.cs @@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.CHD { - /// + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public class HeaderV3 : Header { @@ -37,13 +37,13 @@ namespace SabreTools.Data.Models.CHD /// MD5 checksum of raw data /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[]? MD5 = new byte[16]; + public byte[] MD5 = new byte[16]; /// /// MD5 checksum of parent file /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[]? ParentMD5 = new byte[16]; + public byte[] ParentMD5 = new byte[16]; /// /// Number of bytes per hunk @@ -54,12 +54,12 @@ namespace SabreTools.Data.Models.CHD /// SHA1 checksum of raw data /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? SHA1 = new byte[20]; + public byte[] SHA1 = new byte[20]; /// /// SHA1 checksum of parent file /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? ParentSHA1 = new byte[20]; + public byte[] ParentSHA1 = new byte[20]; } } diff --git a/SabreTools.Serialization/Models/CHD/HeaderV4.cs b/SabreTools.Serialization/Models/CHD/HeaderV4.cs index 4d3da0be..0bbd188a 100644 --- a/SabreTools.Serialization/Models/CHD/HeaderV4.cs +++ b/SabreTools.Serialization/Models/CHD/HeaderV4.cs @@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.CHD { - /// + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public class HeaderV4 : Header { @@ -42,18 +42,18 @@ namespace SabreTools.Data.Models.CHD /// Combined raw+meta SHA1 /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? SHA1 = new byte[20]; + public byte[] SHA1 = new byte[20]; /// /// Combined raw+meta SHA1 of parent /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? ParentSHA1 = new byte[20]; + public byte[] ParentSHA1 = new byte[20]; /// /// Raw data SHA1 /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? RawSHA1 = new byte[20]; + public byte[] RawSHA1 = new byte[20]; } } diff --git a/SabreTools.Serialization/Models/CHD/HeaderV5.cs b/SabreTools.Serialization/Models/CHD/HeaderV5.cs index c6870356..bc9e02c8 100644 --- a/SabreTools.Serialization/Models/CHD/HeaderV5.cs +++ b/SabreTools.Serialization/Models/CHD/HeaderV5.cs @@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.CHD { - /// + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public class HeaderV5 : Header { @@ -40,16 +40,16 @@ namespace SabreTools.Data.Models.CHD /// /// Raw data SHA1 /// - public byte[]? RawSHA1 { get; set; } + public byte[] RawSHA1 { get; set; } = new byte[20]; /// /// Combined raw+meta SHA1 /// - public byte[]? SHA1 { get; set; } + public byte[] SHA1 { get; set; } = new byte[20]; /// /// Combined raw+meta SHA1 of parent /// - public byte[]? ParentSHA1 { get; set; } + public byte[] ParentSHA1 { get; set; } = new byte[20]; } } diff --git a/SabreTools.Serialization/Models/CHD/MetadataHash.cs b/SabreTools.Serialization/Models/CHD/MetadataHash.cs index c08f1fbe..0bff5940 100644 --- a/SabreTools.Serialization/Models/CHD/MetadataHash.cs +++ b/SabreTools.Serialization/Models/CHD/MetadataHash.cs @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; namespace SabreTools.Data.Models.CHD { - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class MetadataHash { @@ -15,6 +15,6 @@ namespace SabreTools.Data.Models.CHD /// Hash data /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? SHA1; + public byte[] SHA1 = new byte[20]; } } diff --git a/SabreTools.Serialization/Models/COFF/SectionHeader.cs b/SabreTools.Serialization/Models/COFF/SectionHeader.cs index dfbfaddf..d4c9c32a 100644 --- a/SabreTools.Serialization/Models/COFF/SectionHeader.cs +++ b/SabreTools.Serialization/Models/COFF/SectionHeader.cs @@ -7,12 +7,12 @@ /// Instead, the location of the section table is determined by calculating the /// location of the first byte after the headers. Make sure to use the size of /// the optional header as specified in the file header. - /// + /// /// The number of entries in the section table is given by the NumberOfSections /// field in the file header. Entries in the section table are numbered starting /// from one (1). The code and data memory section entries are in the order chosen /// by the linker. - /// + /// /// In an image file, the VAs for sections must be assigned by the linker so that /// they are in ascending order and adjacent, and they must be a multiple of the /// SectionAlignment value in the optional header. @@ -27,10 +27,10 @@ /// decimal number that is an offset into the string table. Executable images /// do not use a string table and do not support section names longer than 8 /// characters. Long names in object files are truncated if they are emitted - /// to an executable file. + /// to an executable file. /// /// 8 bytes - public byte[]? Name { get; set; } + public byte[] Name { get; set; } = new byte[8]; /// /// The total size of the section when loaded into memory. If this value is @@ -77,7 +77,7 @@ /// /// The file pointer to the beginning of line-number entries for the section. This /// is set to zero if there are no COFF line numbers. This value should be zero for - /// an image because COFF debugging information is deprecated. + /// an image because COFF debugging information is deprecated. /// public uint PointerToLinenumbers { get; set; } diff --git a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/CLRTokenDefinition.cs b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/CLRTokenDefinition.cs index cc29e646..2e663ecf 100644 --- a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/CLRTokenDefinition.cs +++ b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/CLRTokenDefinition.cs @@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries { /// /// Auxiliary Format 6: CLR Token Definition (Object Only) - /// + /// /// This auxiliary symbol generally follows the IMAGE_SYM_CLASS_CLR_TOKEN. It is /// used to associate a token with the COFF symbol table's namespace. /// @@ -28,6 +28,6 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries /// Reserved, must be zero. /// /// 12 bytes - public byte[]? Reserved2 { get; set; } + public byte[] Reserved2 { get; set; } = new byte[12]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/Descriptor.cs b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/Descriptor.cs index 16d0c290..93f4b434 100644 --- a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/Descriptor.cs +++ b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/Descriptor.cs @@ -2,13 +2,13 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries { /// /// Auxiliary Format 2: .bf and .ef Symbols - /// + /// /// For each function definition in the symbol table, three items describe /// the beginning, ending, and number of lines. Each of these symbols has /// storage class FUNCTION (101): - /// + /// /// A symbol record named .bf (begin function). The Value field is unused. - /// + /// /// A symbol record named .lf (lines in function). The Value field gives the /// number of lines in the function. /// @@ -36,7 +36,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries /// Unused /// /// 6 bytes - public byte[]? Unused2 { get; set; } + public byte[] Unused2 { get; set; } = new byte[6]; /// /// The symbol-table index of the next .bf symbol record. If the function is the @@ -50,4 +50,4 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries /// public ushort Unused3 { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/FileRecord.cs b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/FileRecord.cs index 7712cb92..9a3baaae 100644 --- a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/FileRecord.cs +++ b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/FileRecord.cs @@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries { /// /// Auxiliary Format 4: Files - /// + /// /// This format follows a symbol-table record with storage class FILE (103). /// The symbol name itself should be .file, and the auxiliary record that /// follows it gives the name of a source-code file. @@ -15,6 +15,6 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries /// with nulls if it is less than the maximum length. /// /// 18 bytes - public byte[]? FileName { get; set; } + public byte[] FileName { get; set; } = new byte[18]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/SectionDefinition.cs b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/SectionDefinition.cs index 7ca5815e..a69c4ce7 100644 --- a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/SectionDefinition.cs +++ b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/SectionDefinition.cs @@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries { /// /// Auxiliary Format 5: Section Definitions - /// + /// /// This format follows a symbol-table record that defines a section. Such a /// record has a symbol name that is the name of a section (such as .text or /// .drectve) and has storage class STATIC (3). The auxiliary record provides @@ -49,6 +49,6 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries /// Unused /// /// 3 bytes - public byte[]? Unused { get; set; } + public byte[] Unused { get; set; } = new byte[3]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/StandardRecord.cs b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/StandardRecord.cs index 3911d3d9..71390cdf 100644 --- a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/StandardRecord.cs +++ b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/StandardRecord.cs @@ -12,7 +12,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries /// An array of 8 bytes. This array is padded with nulls on the right if /// the name is less than 8 bytes long. /// - public byte[]? ShortName { get; set; } = new byte[8]; + public byte[] ShortName { get; set; } = new byte[8]; /// /// A field that is set to all zeros if the name is longer than 8 bytes. @@ -55,4 +55,4 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries /// public byte NumberOfAuxSymbols { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/WeakExternal.cs b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/WeakExternal.cs index 362ddc2a..63090279 100644 --- a/SabreTools.Serialization/Models/COFF/SymbolTableEntries/WeakExternal.cs +++ b/SabreTools.Serialization/Models/COFF/SymbolTableEntries/WeakExternal.cs @@ -2,13 +2,13 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries { /// /// Auxiliary Format 3: Weak Externals - /// + /// /// "Weak externals" are a mechanism for object files that allows flexibility at /// link time. A module can contain an unresolved external symbol (sym1), but it /// can also include an auxiliary record that indicates that if sym1 is not /// present at link time, another external symbol (sym2) is used to resolve /// references instead. - /// + /// /// If a definition of sym1 is linked, then an external reference to the symbol /// is resolved normally. If a definition of sym1 is not linked, then all references /// to the weak external for sym1 refer to sym2 instead. The external symbol, sym2, @@ -23,7 +23,7 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries public class WeakExternal : BaseEntry { /// - /// The symbol-table index of sym2, the symbol to be linked if sym1 is not found. + /// The symbol-table index of sym2, the symbol to be linked if sym1 is not found. /// public uint TagIndex { get; set; } @@ -40,6 +40,6 @@ namespace SabreTools.Data.Models.COFF.SymbolTableEntries /// Unused /// /// 10 bytes - public byte[]? Unused { get; set; } + public byte[] Unused { get; set; } = new byte[10]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/DVD/AudioSubPictureAttributesTableEntry.cs b/SabreTools.Serialization/Models/DVD/AudioSubPictureAttributesTableEntry.cs index 69f75e86..b71124f9 100644 --- a/SabreTools.Serialization/Models/DVD/AudioSubPictureAttributesTableEntry.cs +++ b/SabreTools.Serialization/Models/DVD/AudioSubPictureAttributesTableEntry.cs @@ -18,6 +18,6 @@ namespace SabreTools.Data.Models.DVD /// Copy of VTS attributes (offset 100 and on from the VTS IFO /// file, usually 0x300 bytes long) /// - public byte[]? AttributesCopy { get; set; } + public byte[] AttributesCopy { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/DVD/VideoManagerIFO.cs b/SabreTools.Serialization/Models/DVD/VideoManagerIFO.cs index c970af3d..8bc603d0 100644 --- a/SabreTools.Serialization/Models/DVD/VideoManagerIFO.cs +++ b/SabreTools.Serialization/Models/DVD/VideoManagerIFO.cs @@ -60,7 +60,7 @@ namespace SabreTools.Data.Models.DVD /// Provider ID /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public byte[]? ProviderID; + public byte[] ProviderID = new byte[32]; /// /// VMG POS @@ -137,7 +137,7 @@ namespace SabreTools.Data.Models.DVD /// Unknown /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[]? Unknown; + public byte[] Unknown = new byte[16]; /// /// Number of subpicture streams in VMGM_VOBS (0 or 1) @@ -148,12 +148,12 @@ namespace SabreTools.Data.Models.DVD /// Subpicture attributes of VMGM_VOBS /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] - public byte[]? SubpictureAttributes; + public byte[] SubpictureAttributes = new byte[6]; /// /// Reserved /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 164)] - public byte[]? Reserved; + public byte[] Reserved = new byte[164]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/DVD/VideoTitleSetIFO.cs b/SabreTools.Serialization/Models/DVD/VideoTitleSetIFO.cs index bf683ad9..0cda952a 100644 --- a/SabreTools.Serialization/Models/DVD/VideoTitleSetIFO.cs +++ b/SabreTools.Serialization/Models/DVD/VideoTitleSetIFO.cs @@ -60,7 +60,7 @@ namespace SabreTools.Data.Models.DVD /// Provider ID /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] - public byte[]? ProviderID; + public byte[] ProviderID = new byte[32]; /// /// VMG POS @@ -147,7 +147,7 @@ namespace SabreTools.Data.Models.DVD /// Unknown /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[]? Unknown; + public byte[] Unknown = new byte[16]; /// /// Number of subpicture streams in VTSM_VOBS (0 or 1) @@ -158,12 +158,12 @@ namespace SabreTools.Data.Models.DVD /// Subpicture attributes of VTSM_VOBS /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] - public byte[]? SubpictureAttributes; + public byte[] SubpictureAttributes = new byte[6]; /// /// Reserved /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 164)] - public byte[]? Reserved; + public byte[] Reserved = new byte[164]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/GZIP/ExtraFieldData.cs b/SabreTools.Serialization/Models/GZIP/ExtraFieldData.cs index 4032590f..09024683 100644 --- a/SabreTools.Serialization/Models/GZIP/ExtraFieldData.cs +++ b/SabreTools.Serialization/Models/GZIP/ExtraFieldData.cs @@ -1,6 +1,6 @@ namespace SabreTools.Data.Models.GZIP { - /// + /// public sealed class ExtraFieldData { /// @@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.GZIP /// public ushort Length { get; set; } - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/IRD/File.cs b/SabreTools.Serialization/Models/IRD/File.cs index 4ee1d76d..24dbbdf2 100644 --- a/SabreTools.Serialization/Models/IRD/File.cs +++ b/SabreTools.Serialization/Models/IRD/File.cs @@ -1,13 +1,13 @@ namespace SabreTools.Data.Models.IRD { - /// - /// + /// + /// public class File { /// /// "3IRD" /// - public byte[]? Magic { get; set; } + public byte[] Magic { get; set; } = new byte[4]; /// /// Version @@ -58,7 +58,7 @@ namespace SabreTools.Data.Models.IRD /// /// Gzip-compressed header data /// - public byte[]? Header { get; set; } + public byte[] Header { get; set; } /// /// Length of the gzip-compressed footer data @@ -68,7 +68,7 @@ namespace SabreTools.Data.Models.IRD /// /// Gzip-compressed footer data /// - public byte[]? Footer { get; set; } + public byte[] Footer { get; set; } /// /// Number of complete regions in the image @@ -112,19 +112,19 @@ namespace SabreTools.Data.Models.IRD /// D1 key /// /// 16 bytes - public byte[]? Data1Key { get; set; } + public byte[] Data1Key { get; set; } = new byte[16]; /// /// D2 key /// /// 16 bytes - public byte[]? Data2Key { get; set; } + public byte[] Data2Key { get; set; } = new byte[16]; /// /// Uncompressed PIC data /// /// 115 bytes, before D1/D2 keys on version 9 - public byte[]? PIC { get; set; } + public byte[] PIC { get; set; } = new byte[115]; /// /// Unique Identifier diff --git a/SabreTools.Serialization/Models/ISO9660/BaseVolumeDescriptor.cs b/SabreTools.Serialization/Models/ISO9660/BaseVolumeDescriptor.cs index 901efd8b..3b5623af 100644 --- a/SabreTools.Serialization/Models/ISO9660/BaseVolumeDescriptor.cs +++ b/SabreTools.Serialization/Models/ISO9660/BaseVolumeDescriptor.cs @@ -18,7 +18,7 @@ namespace SabreTools.Data.Models.ISO9660 /// Supplementary: a1-characters only, padded to the right with spaces /// Enhanced: Some other agreed upon character encoding, padded to the right with filler /// - public byte[] SystemIdentifier { get; set; } + public byte[] SystemIdentifier { get; set; } = new byte[32]; /// /// 32-byte name of the volume @@ -26,12 +26,12 @@ namespace SabreTools.Data.Models.ISO9660 /// Supplementary: d1-characters only, padded to the right with spaces /// Enhanced: Some other agreed upon character encoding, padded to the right with filler /// - public byte[] VolumeIdentifier { get; set; } + public byte[] VolumeIdentifier { get; set; } = new byte[32]; /// /// 8 unused bytes at offset 72, should be all 0x00 /// - public byte[] Unused8Bytes { get; set; } + public byte[] Unused8Bytes { get; set; } = new byte[8]; /// /// Number of logical blocks in this volume @@ -102,7 +102,7 @@ namespace SabreTools.Data.Models.ISO9660 /// Supplementary: d1-characters only, padded to the right with spaces /// Enhanced: Some other agreed upon character encoding, padded to the right with filler /// - public byte[] VolumeSetIdentifier { get; set; } + public byte[] VolumeSetIdentifier { get; set; } = new byte[128]; /// /// 128-byte name of the publisher @@ -112,7 +112,7 @@ namespace SabreTools.Data.Models.ISO9660 /// Supplementary: a1-characters only, padded to the right with spaces /// Enhanced: Some other agreed upon character encoding, padded to the right with filler /// - public byte[] PublisherIdentifier { get; set; } + public byte[] PublisherIdentifier { get; set; } = new byte[128]; /// /// 128-byte name of the data preparer @@ -122,7 +122,7 @@ namespace SabreTools.Data.Models.ISO9660 /// Supplementary: a1-characters only, padded to the right with spaces /// Enhanced: Some other agreed upon character encoding, padded to the right with filler /// - public byte[] DataPreparerIdentifier { get; set; } + public byte[] DataPreparerIdentifier { get; set; } = new byte[128]; /// /// 128-byte name of the application @@ -132,7 +132,7 @@ namespace SabreTools.Data.Models.ISO9660 /// Supplementary: a1-characters only, padded to the right with spaces /// Enhanced: Some other agreed upon character encoding, padded to the right with filler /// - public byte[] ApplicationIdentifier { get; set; } + public byte[] ApplicationIdentifier { get; set; } = new byte[128]; /// /// 37-byte filename of the Copyright file @@ -142,7 +142,7 @@ namespace SabreTools.Data.Models.ISO9660 /// Supplementary: d1-characters only, padded to the right with spaces /// Enhanced: Some other agreed upon character encoding, padded to the right with filler /// - public byte[] CopyrightFileIdentifier { get; set; } + public byte[] CopyrightFileIdentifier { get; set; } = new byte[37]; /// /// 37-byte filename of the Abstract file @@ -152,7 +152,7 @@ namespace SabreTools.Data.Models.ISO9660 /// Supplementary: d1-characters only, padded to the right with spaces /// Enhanced: Some other agreed upon character encoding, padded to the right with filler /// - public byte[] AbstractFileIdentifier { get; set; } + public byte[] AbstractFileIdentifier { get; set; } = new byte[37]; /// /// 37-byte filename of the Bibliographic file @@ -162,7 +162,7 @@ namespace SabreTools.Data.Models.ISO9660 /// Supplementary: d1-characters only, padded to the right with spaces /// Enhanced: Some other agreed upon character encoding, padded to the right with filler /// - public byte[] BibliographicFileIdentifier { get; set; } + public byte[] BibliographicFileIdentifier { get; set; } = new byte[37]; /// /// PVD-style DateTime format for the Creation date/time of the Volume @@ -199,11 +199,11 @@ namespace SabreTools.Data.Models.ISO9660 /// /// 512 bytes for Application Use, contents not defined by ISO9660 /// - public byte[] ApplicationUse { get; set; } + public byte[] ApplicationUse { get; set; } = new byte[512]; /// /// 653 reserved bytes, should be all 0x00 /// - public byte[] Reserved653Bytes { get; set; } + public byte[] Reserved653Bytes { get; set; } = new byte[653]; } } diff --git a/SabreTools.Serialization/Models/ISO9660/BootRecordVolumeDescriptor.cs b/SabreTools.Serialization/Models/ISO9660/BootRecordVolumeDescriptor.cs index 5d57c701..e5d313c6 100644 --- a/SabreTools.Serialization/Models/ISO9660/BootRecordVolumeDescriptor.cs +++ b/SabreTools.Serialization/Models/ISO9660/BootRecordVolumeDescriptor.cs @@ -11,17 +11,17 @@ namespace SabreTools.Data.Models.ISO9660 /// 32-byte name of the intended system that can use this record /// a-characters only /// - public byte[] BootSystemIdentifier { get; set; } + public byte[] BootSystemIdentifier { get; set; } = new byte[32]; /// /// 32-byte name of this boot system /// a-characters only /// - public byte[] BootIdentifier { get; set; } + public byte[] BootIdentifier { get; set; } = new byte[32]; /// /// 1997 bytes for Boot System Use, contents not defined by ISO9660 /// - public byte[] BootSystemUse { get; set; } + public byte[] BootSystemUse { get; set; } = new byte[1997]; } } diff --git a/SabreTools.Serialization/Models/ISO9660/DecDateTime.cs b/SabreTools.Serialization/Models/ISO9660/DecDateTime.cs index e7a37469..5b92bd6a 100644 --- a/SabreTools.Serialization/Models/ISO9660/DecDateTime.cs +++ b/SabreTools.Serialization/Models/ISO9660/DecDateTime.cs @@ -11,37 +11,37 @@ namespace SabreTools.Data.Models.ISO9660 /// /// 4-byte ASCII digits /// - public byte[] Year { get; set; } + public byte[] Year { get; set; } = new byte[4]; /// /// 2-byte ASCII digits /// - public byte[] Month { get; set; } + public byte[] Month { get; set; } = new byte[2]; /// /// 2-byte ASCII digits /// - public byte[] Day { get; set; } + public byte[] Day { get; set; } = new byte[2]; /// /// 2-byte ASCII digits /// - public byte[] Hour { get; set; } + public byte[] Hour { get; set; } = new byte[2]; /// /// 2-byte ASCII digits /// - public byte[] Minute { get; set; } + public byte[] Minute { get; set; } = new byte[2]; /// /// 2-byte ASCII digits /// - public byte[] Second { get; set; } + public byte[] Second { get; set; } = new byte[2]; /// /// 2-byte ASCII digits /// - public byte[] Centisecond { get; set; } + public byte[] Centisecond { get; set; } = new byte[2]; /// /// Time zone offset (from GMT = UTC 0), represented by a single byte diff --git a/SabreTools.Serialization/Models/ISO9660/DirectoryRecord.cs b/SabreTools.Serialization/Models/ISO9660/DirectoryRecord.cs index a899efe5..c1de7bf3 100644 --- a/SabreTools.Serialization/Models/ISO9660/DirectoryRecord.cs +++ b/SabreTools.Serialization/Models/ISO9660/DirectoryRecord.cs @@ -83,6 +83,6 @@ namespace SabreTools.Data.Models.ISO9660 /// Note: This is where SUSP contents are located, including Rock Ridge extension /// Optional field /// - public byte[]? SystemUse { get; set; } + public byte[] SystemUse { get; set; } } } diff --git a/SabreTools.Serialization/Models/ISO9660/ExtendedAttributeRecord.cs b/SabreTools.Serialization/Models/ISO9660/ExtendedAttributeRecord.cs index 13415e81..8d232306 100644 --- a/SabreTools.Serialization/Models/ISO9660/ExtendedAttributeRecord.cs +++ b/SabreTools.Serialization/Models/ISO9660/ExtendedAttributeRecord.cs @@ -69,12 +69,12 @@ namespace SabreTools.Data.Models.ISO9660 /// 32-byte name of the intended system /// Primary: a-characters or a1-characters only, padded to the right with spaces /// - public byte[] SystemIdentifier { get; set; } + public byte[] SystemIdentifier { get; set; } = new byte[32]; /// /// 64-bytes for system use /// - public byte[] SystemUse { get; set; } + public byte[] SystemUse { get; set; } = new byte[64]; /// /// Extended Attribyte Record Version @@ -90,7 +90,7 @@ namespace SabreTools.Data.Models.ISO9660 /// /// 64-bytes reserved (0x00) /// - public byte[] Reserved64Bytes { get; set; } + public byte[] Reserved64Bytes { get; set; } = new byte[64]; /// /// Length of the Application use field @@ -106,6 +106,6 @@ namespace SabreTools.Data.Models.ISO9660 /// EscapeSequencesLength-bytes list of escape sequences to interpret this file /// Optional, and if present, padded to the right with 0x00 /// - public byte[]? EscapeSequences { get; set; } + public byte[] EscapeSequences { get; set; } } } diff --git a/SabreTools.Serialization/Models/ISO9660/FileExtent.cs b/SabreTools.Serialization/Models/ISO9660/FileExtent.cs index ab528c11..a128c204 100644 --- a/SabreTools.Serialization/Models/ISO9660/FileExtent.cs +++ b/SabreTools.Serialization/Models/ISO9660/FileExtent.cs @@ -15,6 +15,6 @@ namespace SabreTools.Data.Models.ISO9660 /// /// Byte array of data within the file extent (after the Extended Attribyte Record) /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } } diff --git a/SabreTools.Serialization/Models/ISO9660/GenericVolumeDescriptor.cs b/SabreTools.Serialization/Models/ISO9660/GenericVolumeDescriptor.cs index fbc1e8cf..b3646f7f 100644 --- a/SabreTools.Serialization/Models/ISO9660/GenericVolumeDescriptor.cs +++ b/SabreTools.Serialization/Models/ISO9660/GenericVolumeDescriptor.cs @@ -10,6 +10,6 @@ namespace SabreTools.Data.Models.ISO9660 /// /// 2041 bytes /// - public byte[] Data { get; set; } + public byte[] Data { get; set; } = new byte[2041]; } } diff --git a/SabreTools.Serialization/Models/ISO9660/PrimaryVolumeDescriptor.cs b/SabreTools.Serialization/Models/ISO9660/PrimaryVolumeDescriptor.cs index 8ee714b5..b9d35ad8 100644 --- a/SabreTools.Serialization/Models/ISO9660/PrimaryVolumeDescriptor.cs +++ b/SabreTools.Serialization/Models/ISO9660/PrimaryVolumeDescriptor.cs @@ -17,6 +17,6 @@ namespace SabreTools.Data.Models.ISO9660 /// 32 unused bytes at offset 88, should be all 0x00 /// Note: These is used for EscapeSequences on SupplementaryVolumeDescriptor /// - public byte[] Unused32Bytes { get; set; } + public byte[] Unused32Bytes { get; set; } = new byte[32]; } } diff --git a/SabreTools.Serialization/Models/ISO9660/SupplementaryVolumerDescriptor.cs b/SabreTools.Serialization/Models/ISO9660/SupplementaryVolumerDescriptor.cs index f431ffd9..1313c754 100644 --- a/SabreTools.Serialization/Models/ISO9660/SupplementaryVolumerDescriptor.cs +++ b/SabreTools.Serialization/Models/ISO9660/SupplementaryVolumerDescriptor.cs @@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.ISO9660 /// If all bytes are set to 0x00, then a1-characters are identical to a-characters /// Note: Joliet Extension implies Constants.JolietEscapeSequences /// - public byte[] EscapeSequences { get; set; } + public byte[] EscapeSequences { get; set; } = new byte[32]; } } diff --git a/SabreTools.Serialization/Models/ISO9660/VolumeDescriptor.cs b/SabreTools.Serialization/Models/ISO9660/VolumeDescriptor.cs index eb9fc6ec..a1ab7853 100644 --- a/SabreTools.Serialization/Models/ISO9660/VolumeDescriptor.cs +++ b/SabreTools.Serialization/Models/ISO9660/VolumeDescriptor.cs @@ -18,7 +18,7 @@ namespace SabreTools.Data.Models.ISO9660 /// Set to Constants.StandardIdentifier ("CD001") /// On non-ISO9660 CD-i discs, set to Constants.StandardIdentifierCDI ("CD-I ") /// - public byte[] Identifier { get; set; } + public byte[] Identifier { get; set; } = new byte[5]; /// /// The Volume Descriptor version number diff --git a/SabreTools.Serialization/Models/ISO9660/VolumeDescriptorSetTerminator.cs b/SabreTools.Serialization/Models/ISO9660/VolumeDescriptorSetTerminator.cs index eb71b723..f9b2315a 100644 --- a/SabreTools.Serialization/Models/ISO9660/VolumeDescriptorSetTerminator.cs +++ b/SabreTools.Serialization/Models/ISO9660/VolumeDescriptorSetTerminator.cs @@ -10,6 +10,6 @@ namespace SabreTools.Data.Models.ISO9660 /// /// 2041 reserved bytes, should be 0x00 /// - public byte[] Reserved2041Bytes { get; set; } + public byte[] Reserved2041Bytes { get; set; } = new byte[2041]; } } diff --git a/SabreTools.Serialization/Models/ISO9660/VolumePartitionDescriptor.cs b/SabreTools.Serialization/Models/ISO9660/VolumePartitionDescriptor.cs index 8b492b52..4b7b8e03 100644 --- a/SabreTools.Serialization/Models/ISO9660/VolumePartitionDescriptor.cs +++ b/SabreTools.Serialization/Models/ISO9660/VolumePartitionDescriptor.cs @@ -18,13 +18,13 @@ namespace SabreTools.Data.Models.ISO9660 /// 32-byte name of the intended system that can use this record /// a-characters only /// - public byte[] SystemIdentifier { get; set; } + public byte[] SystemIdentifier { get; set; } = new byte[32]; /// /// 32-byte name of this volume partition /// d-characters only /// - public byte[] VolumePartitionIdentifier { get; set; } + public byte[] VolumePartitionIdentifier { get; set; } = new byte[32]; /// /// Logical block number of the first logical block allocated to this volume partition @@ -39,6 +39,6 @@ namespace SabreTools.Data.Models.ISO9660 /// /// 1960 bytes for System Use, contents not defined by ISO9660 /// - public byte[] SystemUse { get; set; } + public byte[] SystemUse { get; set; } = new byte[1960]; } } diff --git a/SabreTools.Serialization/Models/InstallShieldCabinet/Component.cs b/SabreTools.Serialization/Models/InstallShieldCabinet/Component.cs index 515737c4..986a742a 100644 --- a/SabreTools.Serialization/Models/InstallShieldCabinet/Component.cs +++ b/SabreTools.Serialization/Models/InstallShieldCabinet/Component.cs @@ -94,13 +94,13 @@ namespace SabreTools.Data.Models.InstallShieldCabinet /// Reserved /// /// 28 bytes, see CompAttrs - public byte[]? Reserved2 { get; set; } + public byte[] Reserved2 { get; set; } = new byte[28]; /// /// Reserved /// /// 2 bytes (<= v5), 1 byte (> v5) - public byte[]? Reserved3 { get; set; } + public byte[] Reserved3 { get; set; } /// /// Number of depends(?) @@ -172,4 +172,4 @@ namespace SabreTools.Data.Models.InstallShieldCabinet /// public uint OnUninstalledOffset { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/InstallShieldCabinet/FileDescriptor.cs b/SabreTools.Serialization/Models/InstallShieldCabinet/FileDescriptor.cs index 3f7fddbf..d83bcdf2 100644 --- a/SabreTools.Serialization/Models/InstallShieldCabinet/FileDescriptor.cs +++ b/SabreTools.Serialization/Models/InstallShieldCabinet/FileDescriptor.cs @@ -41,7 +41,7 @@ namespace SabreTools.Data.Models.InstallShieldCabinet /// /// MD5 of the entry data /// - public byte[]? MD5 { get; set; } + public byte[] MD5 { get; set; } = new byte[0x10]; /// /// Volume number @@ -63,4 +63,4 @@ namespace SabreTools.Data.Models.InstallShieldCabinet /// public LinkFlags LinkFlags { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/LZ/KWAJHeader.cs b/SabreTools.Serialization/Models/LZ/KWAJHeader.cs index 07c05727..54d8a333 100644 --- a/SabreTools.Serialization/Models/LZ/KWAJHeader.cs +++ b/SabreTools.Serialization/Models/LZ/KWAJHeader.cs @@ -13,7 +13,7 @@ namespace SabreTools.Data.Models.LZ /// "KWAJ" signature /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] - public byte[]? Magic; + public byte[] Magic = new byte[8]; /// /// Compression method @@ -32,4 +32,4 @@ namespace SabreTools.Data.Models.LZ [MarshalAs(UnmanagedType.U2)] public KWAJHeaderFlags HeaderFlags; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/LZ/KWAJHeaderExtensions.cs b/SabreTools.Serialization/Models/LZ/KWAJHeaderExtensions.cs index 50da1365..c72a2148 100644 --- a/SabreTools.Serialization/Models/LZ/KWAJHeaderExtensions.cs +++ b/SabreTools.Serialization/Models/LZ/KWAJHeaderExtensions.cs @@ -17,7 +17,7 @@ namespace SabreTools.Data.Models.LZ public ushort? UnknownPurpose { get; set; } /// - /// Length of + /// Length of /// public ushort? UnknownDataLength { get; set; } @@ -25,7 +25,7 @@ namespace SabreTools.Data.Models.LZ /// Unknown purpose data whose length is defined /// by /// - public byte[]? UnknownData { get; set; } + public byte[] UnknownData { get; set; } /// /// Null-terminated string with max length 8: file name @@ -38,7 +38,7 @@ namespace SabreTools.Data.Models.LZ public string? FileExtension { get; set; } /// - /// Length of + /// Length of /// public ushort? ArbitraryTextLength { get; set; } @@ -46,6 +46,6 @@ namespace SabreTools.Data.Models.LZ /// Arbitrary text data whose length is defined /// by /// - public byte[]? ArbitraryText { get; set; } + public byte[] ArbitraryText { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/LZ/QBasicHeader.cs b/SabreTools.Serialization/Models/LZ/QBasicHeader.cs index a95aed28..7894726c 100644 --- a/SabreTools.Serialization/Models/LZ/QBasicHeader.cs +++ b/SabreTools.Serialization/Models/LZ/QBasicHeader.cs @@ -13,11 +13,11 @@ namespace SabreTools.Data.Models.LZ /// "SZ" signature /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] - public byte[]? Magic; + public byte[] Magic = new byte[8]; /// /// The integer length of the file when unpacked /// public uint RealLength; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/LZ/SZDDHeader.cs b/SabreTools.Serialization/Models/LZ/SZDDHeader.cs index 26f7c0ad..91041bac 100644 --- a/SabreTools.Serialization/Models/LZ/SZDDHeader.cs +++ b/SabreTools.Serialization/Models/LZ/SZDDHeader.cs @@ -14,12 +14,12 @@ namespace SabreTools.Data.Models.LZ /// "SZDD" signature /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] - public byte[]? Magic; + public byte[] Magic = new byte[8]; /// /// Compression mode /// - /// Only is supported + /// Only is supported [MarshalAs(UnmanagedType.U1)] public ExpandCompressionType CompressionType; @@ -35,4 +35,4 @@ namespace SabreTools.Data.Models.LZ /// public uint RealLength; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/LinearExecutable/DebugInformation.cs b/SabreTools.Serialization/Models/LinearExecutable/DebugInformation.cs index d781ea0e..d970f79f 100644 --- a/SabreTools.Serialization/Models/LinearExecutable/DebugInformation.cs +++ b/SabreTools.Serialization/Models/LinearExecutable/DebugInformation.cs @@ -5,7 +5,7 @@ /// the linear EXE format or linker. The only data defined by the linear EXE /// format relative to the debug information is it's offset in the EXE file and /// length in bytes as defined in the linear EXE header. - /// + /// /// To support multiple debuggers the first word of the debug information is a /// type field which determines the format of the debug information. /// @@ -30,6 +30,6 @@ /// the responsibility of the linker or debugging tools to follow the convention /// for the type field that is defined here. /// - public byte[]? DebuggerData { get; set; } + public byte[] DebuggerData { get; set; } } } diff --git a/SabreTools.Serialization/Models/MicrosoftCabinet/CFDATA.cs b/SabreTools.Serialization/Models/MicrosoftCabinet/CFDATA.cs index cbbb4441..b77a7049 100644 --- a/SabreTools.Serialization/Models/MicrosoftCabinet/CFDATA.cs +++ b/SabreTools.Serialization/Models/MicrosoftCabinet/CFDATA.cs @@ -34,7 +34,7 @@ /// and the field value is non-zero, this field contains per-datablock application information. /// This field is defined by the application, and it is used for application-defined purposes. /// - public byte[]? ReservedData { get; set; } + public byte[] ReservedData { get; set; } /// /// The compressed data bytes, compressed by using the @@ -44,6 +44,6 @@ /// uncompressed data bytes. In this case, the and field values will be equal unless /// this CFDATA structure entry crosses a cabinet file boundary. /// - public byte[]? CompressedData { get; set; } + public byte[] CompressedData { get; set; } } } diff --git a/SabreTools.Serialization/Models/MicrosoftCabinet/CFFOLDER.cs b/SabreTools.Serialization/Models/MicrosoftCabinet/CFFOLDER.cs index 8d284f2d..c94e10e2 100644 --- a/SabreTools.Serialization/Models/MicrosoftCabinet/CFFOLDER.cs +++ b/SabreTools.Serialization/Models/MicrosoftCabinet/CFFOLDER.cs @@ -5,17 +5,17 @@ /// this cabinet file, as shown in the following packet diagram.The first CFFOLDER structure entry /// immediately follows the CFHEADER structure entry. The CFHEADER.cFolders field indicates how /// many CFFOLDER structure entries are present. - /// + /// /// Folders can start in one cabinet, and continue on to one or more succeeding cabinets. When the /// cabinet file creator detects that a folder has been continued into another cabinet, it will complete /// that folder as soon as the current file has been completely compressed.Any additional files will be /// placed in the next folder.Generally, this means that a folder would span at most two cabinets, but it /// could span more than two cabinets if the file is large enough. - /// + /// /// CFFOLDER structure entries actually refer to folder fragments, not necessarily complete folders. A /// CFFOLDER structure is the beginning of a folder if the iFolder field value in the first file that /// references the folder does not indicate that the folder is continued from the previous cabinet file. - /// + /// /// The typeCompress field can vary from one folder to the next, unless the folder is continued from a /// previous cabinet file. /// @@ -46,7 +46,7 @@ /// and the cbCFFolder field is non-zero, then this field contains per-folder application information. /// This field is defined by the application, and is used for application-defined purposes. /// - public byte[]? ReservedData { get; set; } + public byte[] ReservedData { get; set; } /// /// Data blocks associated with this folder diff --git a/SabreTools.Serialization/Models/MicrosoftCabinet/CFHEADER.cs b/SabreTools.Serialization/Models/MicrosoftCabinet/CFHEADER.cs index de7b5edf..3bd43b14 100644 --- a/SabreTools.Serialization/Models/MicrosoftCabinet/CFHEADER.cs +++ b/SabreTools.Serialization/Models/MicrosoftCabinet/CFHEADER.cs @@ -107,7 +107,7 @@ /// cbCFHeader field is non-zero, this field contains per-cabinet-file application information. This field /// is defined by the application, and is used for application-defined purposes. /// - public byte[]? ReservedData { get; set; } + public byte[] ReservedData { get; set; } /// /// If the flags.cfhdrPREV_CABINET field is not set, this diff --git a/SabreTools.Serialization/Models/MoPaQ/ArchiveHeader.cs b/SabreTools.Serialization/Models/MoPaQ/ArchiveHeader.cs index a5b85e0a..f8353733 100644 --- a/SabreTools.Serialization/Models/MoPaQ/ArchiveHeader.cs +++ b/SabreTools.Serialization/Models/MoPaQ/ArchiveHeader.cs @@ -140,37 +140,37 @@ /// MD5 of the block table before decryption /// /// 0x10 bytes - public byte[]? BlockTableMD5 { get; set; } + public byte[] BlockTableMD5 { get; set; } = new byte[0x10]; /// /// MD5 of the hash table before decryption /// /// 0x10 bytes - public byte[]? HashTableMD5 { get; set; } + public byte[] HashTableMD5 { get; set; } = new byte[0x10]; /// /// MD5 of the hi-block table /// /// 0x10 bytes - public byte[]? HiBlockTableMD5 { get; set; } + public byte[] HiBlockTableMD5 { get; set; } = new byte[0x10]; /// /// MD5 of the BET table before decryption /// /// 0x10 bytes - public byte[]? BetTableMD5 { get; set; } + public byte[] BetTableMD5 { get; set; } = new byte[0x10]; /// /// MD5 of the HET table before decryption /// /// 0x10 bytes - public byte[]? HetTableMD5 { get; set; } + public byte[] HetTableMD5 { get; set; } = new byte[0x10]; /// /// MD5 of the MPQ header from signature to (including) HetTableMD5 /// /// 0x10 bytes - public byte[]? MpqHeaderMD5 { get; set; } + public byte[] MpqHeaderMD5 { get; set; } = new byte[0x10]; #endregion } diff --git a/SabreTools.Serialization/Models/MoPaQ/HetTable.cs b/SabreTools.Serialization/Models/MoPaQ/HetTable.cs index 9886de0c..f547eae7 100644 --- a/SabreTools.Serialization/Models/MoPaQ/HetTable.cs +++ b/SabreTools.Serialization/Models/MoPaQ/HetTable.cs @@ -76,7 +76,7 @@ namespace SabreTools.Data.Models.MoPaQ /// HET hash table. Each entry is 8 bits. /// /// Size is derived from HashTableSize - public byte[]? HashTable { get; set; } + public byte[] HashTable { get; set; } /// /// Array of file indexes. Bit size of each entry is taken from dwTotalIndexSize. diff --git a/SabreTools.Serialization/Models/MoPaQ/PatchHeader.cs b/SabreTools.Serialization/Models/MoPaQ/PatchHeader.cs index 05b894f1..148da4bb 100644 --- a/SabreTools.Serialization/Models/MoPaQ/PatchHeader.cs +++ b/SabreTools.Serialization/Models/MoPaQ/PatchHeader.cs @@ -46,12 +46,12 @@ /// /// MD5 of the original (unpached) file /// - public byte[]? Md5BeforePatch { get; set; } = new byte[0x10]; + public byte[] Md5BeforePatch { get; set; } = new byte[0x10]; /// /// MD5 of the patched file /// - public byte[]? Md5AfterPatch { get; set; } = new byte[0x10]; + public byte[] Md5AfterPatch { get; set; } = new byte[0x10]; #endregion @@ -108,7 +108,7 @@ /// /// File data are simply replaced by the data in the patch. /// - public byte[]? PatchDataCopy { get; set; } + public byte[] PatchDataCopy { get; set; } #endregion } diff --git a/SabreTools.Serialization/Models/MoPaQ/PatchInfo.cs b/SabreTools.Serialization/Models/MoPaQ/PatchInfo.cs index 16a74b6d..0ad35553 100644 --- a/SabreTools.Serialization/Models/MoPaQ/PatchInfo.cs +++ b/SabreTools.Serialization/Models/MoPaQ/PatchInfo.cs @@ -29,7 +29,7 @@ namespace SabreTools.Data.Models.MoPaQ /// /// 0x10 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)] - public byte[]? MD5; + public byte[] MD5 = new byte[0x10]; /// /// The sector offset table (variable length) diff --git a/SabreTools.Serialization/Models/N3DS/ARM11KernelCapabilities.cs b/SabreTools.Serialization/Models/N3DS/ARM11KernelCapabilities.cs index 0f1ec399..2a5769f1 100644 --- a/SabreTools.Serialization/Models/N3DS/ARM11KernelCapabilities.cs +++ b/SabreTools.Serialization/Models/N3DS/ARM11KernelCapabilities.cs @@ -13,14 +13,14 @@ namespace SabreTools.Data.Models.N3DS /// Descriptors /// ------------------- /// Pattern of bits 20-31 Type Fields - /// 0b1110xxxxxxxx Interrupt info + /// 0b1110xxxxxxxx Interrupt info /// 0b11110xxxxxxx System call mask Bits 24-26: System call mask table index; Bits 0-23: mask /// 0b1111110xxxxx Kernel release version Bits 8-15: Major version; Bits 0-7: Minor version /// 0b11111110xxxx Handle table size Bits 0-18: size /// 0b111111110xxx Kernel flags /// 0b11111111100x Map address range Describes a memory mapping like the 0b111111111110 descriptor, but an entire range rather than a single page is mapped.Another 0b11111111100x descriptor must follow this one to denote the(exclusive) end of the address range to map. /// 0b111111111110 Map memory page Bits 0-19: page index to map(virtual address >> 12; the physical address is determined per-page according to Memory layout); Bit 20: Map read-only(otherwise read-write) - /// + /// /// ARM11 Kernel Flags /// ------------------- /// Bit Description @@ -46,6 +46,6 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x10 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)] - public byte[]? Reserved; + public byte[] Reserved = new byte[0x10]; } } diff --git a/SabreTools.Serialization/Models/N3DS/ARM11LocalSystemCapabilities.cs b/SabreTools.Serialization/Models/N3DS/ARM11LocalSystemCapabilities.cs index 75e8fb47..3e284237 100644 --- a/SabreTools.Serialization/Models/N3DS/ARM11LocalSystemCapabilities.cs +++ b/SabreTools.Serialization/Models/N3DS/ARM11LocalSystemCapabilities.cs @@ -70,7 +70,7 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x0F bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0F)] - public byte[]? Reserved; + public byte[] Reserved = new byte[0x0F]; /// /// Resource limit category. (0 = APPLICATION, 1 = SYS_APPLET, 2 = LIB_APPLET, 3 = OTHER (sysmodules running under the BASE memregion)) diff --git a/SabreTools.Serialization/Models/N3DS/CIA.cs b/SabreTools.Serialization/Models/N3DS/CIA.cs index a8508367..8c86955a 100644 --- a/SabreTools.Serialization/Models/N3DS/CIA.cs +++ b/SabreTools.Serialization/Models/N3DS/CIA.cs @@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.N3DS /// titles to the 3DS. CIA files and titles on Nintendo's CDN contain identical data. /// As a consequence, valid CIA files can be generated from CDN content. This also /// means CIA files can contain anything that titles on Nintendo's CDN can contain. - /// + /// /// Under normal circumstances CIA files are used where downloading a title is /// impractical or not possible. Such as distributing a Download Play child, or /// installing forced Gamecard updates. Those CIA(s) are stored by the titles in @@ -46,11 +46,11 @@ namespace SabreTools.Data.Models.N3DS /// Content file data /// /// TODO: Parse the content file data - public byte[]? ContentFileData { get; set; } + public byte[] ContentFileData { get; set; } /// /// Meta file data (Not a necessary component) /// public MetaData? MetaData { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/N3DS/CIAHeader.cs b/SabreTools.Serialization/Models/N3DS/CIAHeader.cs index 374c2817..0eef0b9c 100644 --- a/SabreTools.Serialization/Models/N3DS/CIAHeader.cs +++ b/SabreTools.Serialization/Models/N3DS/CIAHeader.cs @@ -51,6 +51,6 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x2000 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x2000)] - public byte[]? ContentIndex; + public byte[] ContentIndex = new byte[0x2000]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/N3DS/CardInfoHeader.cs b/SabreTools.Serialization/Models/N3DS/CardInfoHeader.cs index 5d635fb8..24ffcf2c 100644 --- a/SabreTools.Serialization/Models/N3DS/CardInfoHeader.cs +++ b/SabreTools.Serialization/Models/N3DS/CardInfoHeader.cs @@ -21,7 +21,7 @@ namespace SabreTools.Data.Models.N3DS /// /// 0xF8 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xF8)] - public byte[]? Reserved1; + public byte[] Reserved1 = new byte[0xF8]; /// /// Filled size of cartridge @@ -33,7 +33,7 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x0C bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0C)] - public byte[]? Reserved2; + public byte[] Reserved2 = new byte[0x0C]; /// /// Title version @@ -50,14 +50,14 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x0C bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0C)] - public byte[]? Reserved3; + public byte[] Reserved3 = new byte[0x0C]; /// /// Title ID of CVer in included update partition /// /// 8 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public byte[]? CVerTitleID; + public byte[] CVerTitleID = new byte[8]; /// /// Version number of CVer in included update partition @@ -69,7 +69,7 @@ namespace SabreTools.Data.Models.N3DS /// /// 0xCD6 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xCD6)] - public byte[]? Reserved4; + public byte[] Reserved4 = new byte[0xCD6]; /// /// This data is returned by 16-byte cartridge command 0x82. diff --git a/SabreTools.Serialization/Models/N3DS/Certificate.cs b/SabreTools.Serialization/Models/N3DS/Certificate.cs index 2af9b45c..17923e19 100644 --- a/SabreTools.Serialization/Models/N3DS/Certificate.cs +++ b/SabreTools.Serialization/Models/N3DS/Certificate.cs @@ -27,12 +27,12 @@ namespace SabreTools.Data.Models.N3DS /// /// Signature /// - public byte[]? Signature { get; set; } + public byte[] Signature { get; set; } /// /// Padding to align next data to 0x40 bytes /// - public byte[]? Padding { get; set; } + public byte[] Padding { get; set; } /// /// Issuer @@ -60,7 +60,7 @@ namespace SabreTools.Data.Models.N3DS /// /// Modulus /// - public byte[]? RSAModulus { get; set; } + public byte[] RSAModulus { get; set; } /// /// Public Exponent @@ -70,7 +70,7 @@ namespace SabreTools.Data.Models.N3DS /// /// Padding /// - public byte[]? RSAPadding { get; set; } + public byte[] RSAPadding { get; set; } #endregion @@ -80,12 +80,12 @@ namespace SabreTools.Data.Models.N3DS /// /// Public Key /// - public byte[]? ECCPublicKey { get; set; } + public byte[] ECCPublicKey { get; set; } /// /// Padding /// - public byte[]? ECCPadding { get; set; } + public byte[] ECCPadding { get; set; } #endregion } diff --git a/SabreTools.Serialization/Models/N3DS/ContentChunkRecord.cs b/SabreTools.Serialization/Models/N3DS/ContentChunkRecord.cs index 0537dcc6..5da4b43c 100644 --- a/SabreTools.Serialization/Models/N3DS/ContentChunkRecord.cs +++ b/SabreTools.Serialization/Models/N3DS/ContentChunkRecord.cs @@ -38,6 +38,6 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? SHA256Hash; + public byte[] SHA256Hash = new byte[0x20]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/N3DS/ContentInfoRecord.cs b/SabreTools.Serialization/Models/N3DS/ContentInfoRecord.cs index 88b2c102..ed9b447d 100644 --- a/SabreTools.Serialization/Models/N3DS/ContentInfoRecord.cs +++ b/SabreTools.Serialization/Models/N3DS/ContentInfoRecord.cs @@ -24,6 +24,6 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? UnhashedContentRecordsSHA256Hash; + public byte[] UnhashedContentRecordsSHA256Hash = new byte[0x20]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/N3DS/DevelopmentCardInfoHeader.cs b/SabreTools.Serialization/Models/N3DS/DevelopmentCardInfoHeader.cs index 7f7b50bd..549133ea 100644 --- a/SabreTools.Serialization/Models/N3DS/DevelopmentCardInfoHeader.cs +++ b/SabreTools.Serialization/Models/N3DS/DevelopmentCardInfoHeader.cs @@ -11,21 +11,21 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x200 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)] - public byte[]? CardDeviceReserved1; + public byte[] CardDeviceReserved1 = new byte[0x200]; /// /// TitleKey /// /// 0x10 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)] - public byte[]? TitleKey; + public byte[] TitleKey = new byte[0x10]; /// /// CardDeviceReserved2 /// /// 0x1BF0 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x1BF0)] - public byte[]? CardDeviceReserved2; + public byte[] CardDeviceReserved2 = new byte[0x1BF0]; /// /// TestData diff --git a/SabreTools.Serialization/Models/N3DS/ExeFSHeader.cs b/SabreTools.Serialization/Models/N3DS/ExeFSHeader.cs index fac6f354..90152ef4 100644 --- a/SabreTools.Serialization/Models/N3DS/ExeFSHeader.cs +++ b/SabreTools.Serialization/Models/N3DS/ExeFSHeader.cs @@ -2,8 +2,8 @@ { /// /// ExeFS or Executable Filesystem contains information related to the - /// executable program, and is the part of the CXI format. - /// + /// executable program, and is the part of the CXI format. + /// /// The ExeFS usually contains one or more of the following files: /// - .code Contains the code binary, which can be optionally reverse-LZSS compressed via an exheader flag. /// - logo Contains distribution licensing Binary data. @@ -22,7 +22,7 @@ /// Reserved /// /// 0x20 bytes - public byte[]? Reserved { get; set; } + public byte[] Reserved { get; set; } = new byte[0x20]; /// /// File hashes (10 hashes maximum, 32 bytes each, one for each header) diff --git a/SabreTools.Serialization/Models/N3DS/InitialData.cs b/SabreTools.Serialization/Models/N3DS/InitialData.cs index b0edb73f..efd9cd0f 100644 --- a/SabreTools.Serialization/Models/N3DS/InitialData.cs +++ b/SabreTools.Serialization/Models/N3DS/InitialData.cs @@ -11,35 +11,35 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x10 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)] - public byte[]? CardSeedKeyY; + public byte[] CardSeedKeyY = new byte[0x10]; /// /// Encrypted card seed (AES-CCM, keyslot 0x3B for retail cards, see CTRCARD_SECSEED) /// /// 0x10 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)] - public byte[]? EncryptedCardSeed; + public byte[] EncryptedCardSeed = new byte[0x10]; /// /// Card seed AES-MAC /// /// 0x10 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)] - public byte[]? CardSeedAESMAC; + public byte[] CardSeedAESMAC = new byte[0x10]; /// /// Card seed nonce /// /// 0x0C bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0C)] - public byte[]? CardSeedNonce; + public byte[] CardSeedNonce = new byte[0x0C]; /// /// Reserved3 /// /// 0xC4 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xC4)] - public byte[]? Reserved; + public byte[] Reserved = new byte[0xC4]; /// /// Copy of first NCCH header (excluding RSA signature) diff --git a/SabreTools.Serialization/Models/N3DS/MetaData.cs b/SabreTools.Serialization/Models/N3DS/MetaData.cs index a1e93b42..bba28d2f 100644 --- a/SabreTools.Serialization/Models/N3DS/MetaData.cs +++ b/SabreTools.Serialization/Models/N3DS/MetaData.cs @@ -12,14 +12,14 @@ namespace SabreTools.Data.Models.N3DS /// TODO: Determine numeric format of each entry /// 0x180 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x180)] - public byte[]? TitleIDDependencyList; + public byte[] TitleIDDependencyList = new byte[0x180]; /// /// Reserved /// /// 0x180 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x180)] - public byte[]? Reserved1; + public byte[] Reserved1 = new byte[0x180]; /// /// Core Version @@ -31,13 +31,13 @@ namespace SabreTools.Data.Models.N3DS /// /// 0xFC bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xFC)] - public byte[]? Reserved2; + public byte[] Reserved2 = new byte[0xFC]; /// /// Icon Data(.ICN) - Taken from the application's ExeFS /// /// 0x36C0 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x36C0)] - public byte[]? IconData; + public byte[] IconData = new byte[0x36C0]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/N3DS/NCCHExtendedHeader.cs b/SabreTools.Serialization/Models/N3DS/NCCHExtendedHeader.cs index 432926b2..1282ae8c 100644 --- a/SabreTools.Serialization/Models/N3DS/NCCHExtendedHeader.cs +++ b/SabreTools.Serialization/Models/N3DS/NCCHExtendedHeader.cs @@ -26,14 +26,14 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x100 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x100)] - public byte[]? AccessDescSignature; + public byte[] AccessDescSignature = new byte[0x100]; /// /// NCCH HDR RSA-2048 public key /// /// 0x100 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x100)] - public byte[]? NCCHHDRPublicKey; + public byte[] NCCHHDRPublicKey = new byte[0x100]; /// /// ACI (for limitation of first ACI) diff --git a/SabreTools.Serialization/Models/N3DS/NCCHHeader.cs b/SabreTools.Serialization/Models/N3DS/NCCHHeader.cs index 17d53055..88108ec5 100644 --- a/SabreTools.Serialization/Models/N3DS/NCCHHeader.cs +++ b/SabreTools.Serialization/Models/N3DS/NCCHHeader.cs @@ -11,7 +11,7 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x100 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x100)] - public byte[]? RSA2048Signature; + public byte[] RSA2048Signature = new byte[0x100]; /// /// Magic ID, always 'NCCH' @@ -53,21 +53,21 @@ namespace SabreTools.Data.Models.N3DS /// /// 8 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public byte[]? ProgramId; + public byte[] ProgramId = new byte[8]; /// /// Reserved /// /// 0x10 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)] - public byte[]? Reserved1; + public byte[] Reserved1 = new byte[0x10]; /// /// Logo Region SHA-256 hash. (For applications built with SDK 5+) (Supported from firmware: 5.0.0-11) /// /// 0x20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? LogoRegionHash; + public byte[] LogoRegionHash = new byte[0x20]; /// /// Product code @@ -81,7 +81,7 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? ExtendedHeaderHash; + public byte[] ExtendedHeaderHash = new byte[0x20]; /// /// Extended header size, in bytes @@ -164,7 +164,7 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? ExeFSSuperblockHash; + public byte[] ExeFSSuperblockHash = new byte[0x20]; /// /// RomFS superblock SHA-256 hash - (SHA-256 hash, starting at 0x0 of the RomFS over the number @@ -172,6 +172,6 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? RomFSSuperblockHash; + public byte[] RomFSSuperblockHash = new byte[0x20]; } } diff --git a/SabreTools.Serialization/Models/N3DS/NCSDHeader.cs b/SabreTools.Serialization/Models/N3DS/NCSDHeader.cs index 01c41076..7428d201 100644 --- a/SabreTools.Serialization/Models/N3DS/NCSDHeader.cs +++ b/SabreTools.Serialization/Models/N3DS/NCSDHeader.cs @@ -4,7 +4,7 @@ /// There are two known specialisations of the NCSD container format: /// - The CTR Cart Image (CCI) format, the 3DS' raw NAND format /// - CCI is the format of game ROM images. - /// + /// /// CTR System Update (CSU) is a variant of CCI, where the only difference /// is in the file extension. /// @@ -16,7 +16,8 @@ /// /// RSA-2048 SHA-256 signature of the NCSD header /// - public byte[]? RSA2048Signature { get; set; } + /// 0x100 bytes + public byte[] RSA2048Signature { get; set; } = new byte[0x100]; /// /// Magic Number 'NCSD' @@ -31,7 +32,8 @@ /// /// Media ID /// - public byte[]? MediaId { get; set; } + /// 8 bytes + public byte[] MediaId { get; set; } = new byte[8]; /// /// Partitions FS type (0=None, 1=Normal, 3=FIRM, 4=AGB_FIRM save) @@ -41,7 +43,8 @@ /// /// Partitions crypt type (each byte corresponds to a partition in the partition table) /// - public byte[]? PartitionsCryptType { get; set; } + /// 8 bytes + public byte[] PartitionsCryptType { get; set; } = new byte[8]; /// /// Offset & Length partition table, in media units @@ -55,7 +58,8 @@ /// /// Exheader SHA-256 hash /// - public byte[]? ExheaderHash { get; set; } + /// 0x20 bytes + public byte[] ExheaderHash { get; set; } = new byte[0x200]; /// /// Additional header size @@ -70,7 +74,7 @@ /// /// Partition Flags /// - public byte[]? PartitionFlags { get; set; } + public byte[] PartitionFlags { get; set; } /// /// Partition ID table @@ -80,12 +84,14 @@ /// /// Reserved /// - public byte[]? Reserved1 { get; set; } + /// 0x20 bytes + public byte[] Reserved1 { get; set; } = new byte[0x20]; /// /// Reserved? /// - public byte[]? Reserved2 { get; set; } + /// 0x0E bytes + public byte[] Reserved2 { get; set; } = new byte[0x0E]; /// /// Support for this was implemented with 9.6.0-X FIRM. Bit0=1 enables using bits 1-2, it's unknown @@ -107,12 +113,14 @@ /// /// Unknown /// - public byte[]? Unknown { get; set; } + /// 0x5E bytes + public byte[] Unknown { get; set; } = new byte[0x5E]; /// /// Encrypted MBR partition-table, for the TWL partitions(key-data used for this keyslot is console-unique). /// - public byte[]? EncryptedMBR { get; set; } + /// 0x42 bytes + public byte[] EncryptedMBR { get; set; } = new byte[0x42]; #endregion } diff --git a/SabreTools.Serialization/Models/N3DS/StorageInfo.cs b/SabreTools.Serialization/Models/N3DS/StorageInfo.cs index 9d1b6d8f..534ee628 100644 --- a/SabreTools.Serialization/Models/N3DS/StorageInfo.cs +++ b/SabreTools.Serialization/Models/N3DS/StorageInfo.cs @@ -19,14 +19,14 @@ namespace SabreTools.Data.Models.N3DS /// /// 8 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public byte[]? SystemSavedataIDs; + public byte[] SystemSavedataIDs = new byte[8]; /// /// Storage accessible unique IDs /// /// 8 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public byte[]? StorageAccessibleUniqueIDs; + public byte[] StorageAccessibleUniqueIDs = new byte[8]; /// /// Filesystem access info @@ -35,7 +35,7 @@ namespace SabreTools.Data.Models.N3DS /// TODO: Combine with "other attributes" /// 7 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] - public byte[]? FileSystemAccessInfo; + public byte[] FileSystemAccessInfo = new byte[7]; /// /// Other attributes diff --git a/SabreTools.Serialization/Models/N3DS/SystemControlInfo.cs b/SabreTools.Serialization/Models/N3DS/SystemControlInfo.cs index 85581259..01b69fb5 100644 --- a/SabreTools.Serialization/Models/N3DS/SystemControlInfo.cs +++ b/SabreTools.Serialization/Models/N3DS/SystemControlInfo.cs @@ -18,7 +18,7 @@ namespace SabreTools.Data.Models.N3DS /// /// 5 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] - public byte[]? Reserved1; + public byte[] Reserved1 = new byte[5]; /// /// Flag (bit 0: CompressExefsCode, bit 1: SDApplication) diff --git a/SabreTools.Serialization/Models/N3DS/SystemInfo.cs b/SabreTools.Serialization/Models/N3DS/SystemInfo.cs index 0c810112..8a8f6610 100644 --- a/SabreTools.Serialization/Models/N3DS/SystemInfo.cs +++ b/SabreTools.Serialization/Models/N3DS/SystemInfo.cs @@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.N3DS /// /// 0x30 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x30)] - public byte[]? Reserved; + public byte[] Reserved = new byte[0x30]; } } diff --git a/SabreTools.Serialization/Models/N3DS/TestData.cs b/SabreTools.Serialization/Models/N3DS/TestData.cs index e0ad1cb2..7c7f27f8 100644 --- a/SabreTools.Serialization/Models/N3DS/TestData.cs +++ b/SabreTools.Serialization/Models/N3DS/TestData.cs @@ -14,63 +14,63 @@ namespace SabreTools.Data.Models.N3DS /// /// 8 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public byte[]? Signature; + public byte[] Signature = new byte[8]; /// /// An ascending byte sequence equal to the offset mod 256 (08 09 0A ... FE FF 00 01 ... FF). /// /// 0x1F8 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x1F8)] - public byte[]? AscendingByteSequence; + public byte[] AscendingByteSequence = new byte[0x1F8]; /// /// A descending byte sequence equal to 255 minus the offset mod 256 (FF FE FD ... 00 FF DE ... 00). /// /// 0x200 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)] - public byte[]? DescendingByteSequence; + public byte[] DescendingByteSequence = new byte[0x200]; /// /// Filled with 00 (0b00000000) bytes. /// /// 0x200 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)] - public byte[]? Filled00; + public byte[] Filled00 = new byte[0x200]; /// /// Filled with FF (0b11111111) bytes. /// /// 0x200 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)] - public byte[]? FilledFF; + public byte[] FilledFF = new byte[0x200]; /// /// Filled with 0F (0b00001111) bytes. /// /// 0x200 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)] - public byte[]? Filled0F; + public byte[] Filled0F = new byte[0x200]; /// /// Filled with F0 (0b11110000) bytes. /// /// 0x200 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)] - public byte[]? FilledF0; + public byte[] FilledF0 = new byte[0x200]; /// /// Filled with 55 (0b01010101) bytes. /// /// 0x200 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x200)] - public byte[]? Filled55; + public byte[] Filled55 = new byte[0x200]; /// /// Filled with AA (0b10101010) bytes. /// /// 0x1FF bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x1FF)] - public byte[]? FilledAA; + public byte[] FilledAA = new byte[0x1FF]; /// /// The final byte is 00 (0b00000000). diff --git a/SabreTools.Serialization/Models/N3DS/Ticket.cs b/SabreTools.Serialization/Models/N3DS/Ticket.cs index 0888c918..bfb90aea 100644 --- a/SabreTools.Serialization/Models/N3DS/Ticket.cs +++ b/SabreTools.Serialization/Models/N3DS/Ticket.cs @@ -25,12 +25,12 @@ namespace SabreTools.Data.Models.N3DS /// /// Signature /// - public byte[]? Signature { get; set; } + public byte[] Signature { get; set; } /// /// Padding /// - public byte[]? Padding { get; set; } + public byte[] Padding { get; set; } /// /// Issuer @@ -40,7 +40,8 @@ namespace SabreTools.Data.Models.N3DS /// /// ECC PublicKey /// - public byte[]? ECCPublicKey { get; set; } + /// 0x3C bytes + public byte[] ECCPublicKey { get; set; } = new byte[0x3C]; /// /// Version (For 3DS this is always 1) @@ -61,17 +62,19 @@ namespace SabreTools.Data.Models.N3DS /// TitleKey (normal-key encrypted using one of the common keyYs; see below) /// /// + /// 0x10 bytes + /// /// The titlekey is decrypted by using the AES engine with the ticket common-key keyslot. /// The keyY is selected through an index (ticket offset 0xB1) into a plaintext array /// of 6 keys ("common keyYs") stored in the data section of Process9. AES-CBC mode is used /// where the IV is the big-endian titleID. Note that on a retail unit index0 is a retail keyY, /// while on a dev-unit index0 is the dev common-key which is a normal-key. /// (On retail for these keyYs, the hardware key-scrambler is used) - /// + /// /// The titlekey is used to decrypt content downloaded from the CDN using 128-bit AES-CBC with /// the content index (as big endian u16, padded with trailing zeroes) as the IV. /// - public byte[]? TitleKey { get; set; } + public byte[] TitleKey { get; set; } = new byte[0x10]; /// /// Reserved @@ -96,7 +99,8 @@ namespace SabreTools.Data.Models.N3DS /// /// Reserved /// - public byte[]? Reserved2 { get; set; } + /// 2 bytes + public byte[] Reserved2 { get; set; } = new byte[2]; /// /// Ticket title version @@ -110,7 +114,8 @@ namespace SabreTools.Data.Models.N3DS /// /// Reserved /// - public byte[]? Reserved3 { get; set; } + /// 8 bytes + public byte[] Reserved3 { get; set; } = new byte[8]; /// /// License Type @@ -125,7 +130,8 @@ namespace SabreTools.Data.Models.N3DS /// /// Reserved /// - public byte[]? Reserved4 { get; set; } + /// 0x2A bytes + public byte[] Reserved4 { get; set; } = new byte[0x2A]; /// /// eShop Account ID? @@ -145,7 +151,8 @@ namespace SabreTools.Data.Models.N3DS /// /// Reserved /// - public byte[]? Reserved6 { get; set; } + /// 0x42 bytes + public byte[] Reserved6 { get; set; } = new byte[0x42]; /// /// Limits @@ -165,7 +172,7 @@ namespace SabreTools.Data.Models.N3DS /// /// Content Index /// - public byte[]? ContentIndex { get; set; } + public byte[] ContentIndex { get; set; } /// /// Certificate chain diff --git a/SabreTools.Serialization/Models/N3DS/TitleMetadata.cs b/SabreTools.Serialization/Models/N3DS/TitleMetadata.cs index 2dd67823..67612403 100644 --- a/SabreTools.Serialization/Models/N3DS/TitleMetadata.cs +++ b/SabreTools.Serialization/Models/N3DS/TitleMetadata.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.N3DS /// /// A format used to store information about a title (installed title, DLC, etc.) /// and all its installed contents, including which contents they consist of and - /// their SHA256 hashes. + /// their SHA256 hashes. /// /// public sealed class TitleMetadata @@ -26,12 +26,12 @@ namespace SabreTools.Data.Models.N3DS /// /// Signature /// - public byte[]? Signature { get; set; } + public byte[] Signature { get; set; } /// /// Padding /// - public byte[]? Padding1 { get; set; } + public byte[] Padding1 { get; set; } /// /// Signature Issuer @@ -42,7 +42,7 @@ namespace SabreTools.Data.Models.N3DS /// Version /// public byte Version { get; set; } - + /// /// CaCrlVersion /// @@ -91,7 +91,8 @@ namespace SabreTools.Data.Models.N3DS /// /// Reserved /// - public byte[]? Reserved2 { get; set; } + /// 4 bytes + public byte[] Reserved2 { get; set; } = new byte[4]; /// /// SRL Flag @@ -101,7 +102,8 @@ namespace SabreTools.Data.Models.N3DS /// /// Reserved /// - public byte[]? Reserved3 { get; set; } + /// 0x31 bytes + public byte[] Reserved3 { get; set; } = new byte[0x31]; /// /// Access Rights @@ -126,12 +128,14 @@ namespace SabreTools.Data.Models.N3DS /// /// Padding /// - public byte[]? Padding2 { get; set; } + /// 2 bytes + public byte[] Padding2 { get; set; } = new byte[2]; /// /// SHA-256 Hash of the Content Info Records /// - public byte[]? SHA256HashContentInfoRecords { get; set; } + /// 0x20 bytes + public byte[] SHA256HashContentInfoRecords { get; set; } = new byte[0x20]; /// /// There are 64 of these records, usually only the first is used. @@ -152,4 +156,4 @@ namespace SabreTools.Data.Models.N3DS /// public Certificate[]? CertificateChain { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/NewExecutable/ImportedNameTableEntry.cs b/SabreTools.Serialization/Models/NewExecutable/ImportedNameTableEntry.cs index 78ea207e..8a60baf6 100644 --- a/SabreTools.Serialization/Models/NewExecutable/ImportedNameTableEntry.cs +++ b/SabreTools.Serialization/Models/NewExecutable/ImportedNameTableEntry.cs @@ -20,6 +20,6 @@ /// /// ASCII text of the name string. /// - public byte[]? NameString { get; set; } + public byte[] NameString { get; set; } } } diff --git a/SabreTools.Serialization/Models/NewExecutable/NonResidentNameTableEntry.cs b/SabreTools.Serialization/Models/NewExecutable/NonResidentNameTableEntry.cs index d64f9d30..c1a67497 100644 --- a/SabreTools.Serialization/Models/NewExecutable/NonResidentNameTableEntry.cs +++ b/SabreTools.Serialization/Models/NewExecutable/NonResidentNameTableEntry.cs @@ -20,7 +20,7 @@ /// /// ASCII text of the name string. /// - public byte[]? NameString { get; set; } + public byte[] NameString { get; set; } /// /// Ordinal number (index into entry table). This value is ignored diff --git a/SabreTools.Serialization/Models/NewExecutable/ResidentNameTableEntry.cs b/SabreTools.Serialization/Models/NewExecutable/ResidentNameTableEntry.cs index b0d56e14..ba393e1b 100644 --- a/SabreTools.Serialization/Models/NewExecutable/ResidentNameTableEntry.cs +++ b/SabreTools.Serialization/Models/NewExecutable/ResidentNameTableEntry.cs @@ -19,7 +19,7 @@ /// /// ASCII text of the name string. /// - public byte[]? NameString { get; set; } + public byte[] NameString { get; set; } /// /// Ordinal number (index into entry table). This value is ignored diff --git a/SabreTools.Serialization/Models/NewExecutable/ResourceTypeAndNameString.cs b/SabreTools.Serialization/Models/NewExecutable/ResourceTypeAndNameString.cs index 8b9c1fc2..7e464135 100644 --- a/SabreTools.Serialization/Models/NewExecutable/ResourceTypeAndNameString.cs +++ b/SabreTools.Serialization/Models/NewExecutable/ResourceTypeAndNameString.cs @@ -18,6 +18,6 @@ /// /// ASCII text of the type or name string. /// - public byte[]? Text { get; set; } + public byte[] Text { get; set; } } } diff --git a/SabreTools.Serialization/Models/NewExecutable/SegmentTableEntry.cs b/SabreTools.Serialization/Models/NewExecutable/SegmentTableEntry.cs index 1e3358a1..125321a7 100644 --- a/SabreTools.Serialization/Models/NewExecutable/SegmentTableEntry.cs +++ b/SabreTools.Serialization/Models/NewExecutable/SegmentTableEntry.cs @@ -45,7 +45,7 @@ namespace SabreTools.Data.Models.NewExecutable /// Data is not sequential to the entry header. It lives at /// the and has a size of /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } /// /// Per-segment data diff --git a/SabreTools.Serialization/Models/Nitro/Cart.cs b/SabreTools.Serialization/Models/Nitro/Cart.cs index 59814549..c7861e6f 100644 --- a/SabreTools.Serialization/Models/Nitro/Cart.cs +++ b/SabreTools.Serialization/Models/Nitro/Cart.cs @@ -18,7 +18,8 @@ namespace SabreTools.Data.Models.Nitro /// /// Secure area, may be encrypted or decrypted /// - public byte[]? SecureArea { get; set; } + /// 0x800 bytes + public byte[] SecureArea { get; set; } = new byte[0x800]; /// /// Name table (folder allocation table, name list) @@ -30,4 +31,4 @@ namespace SabreTools.Data.Models.Nitro /// public FileAllocationTableEntry[]? FileAllocationTable { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/Nitro/CommonHeader.cs b/SabreTools.Serialization/Models/Nitro/CommonHeader.cs index 22caaa2a..80dbc206 100644 --- a/SabreTools.Serialization/Models/Nitro/CommonHeader.cs +++ b/SabreTools.Serialization/Models/Nitro/CommonHeader.cs @@ -49,7 +49,7 @@ namespace SabreTools.Data.Models.Nitro /// /// 7 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)] - public byte[]? Reserved1; + public byte[] Reserved1 = new byte[7]; /// /// Game Revision (used by DSi titles) @@ -186,7 +186,7 @@ namespace SabreTools.Data.Models.Nitro /// /// 8 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public byte[]? SecureDisable; + public byte[] SecureDisable = new byte[8]; /// /// NTR region ROM size (excluding DSi area) @@ -203,14 +203,14 @@ namespace SabreTools.Data.Models.Nitro /// /// 56 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 56)] - public byte[]? Reserved2; + public byte[] Reserved2 = new byte[56]; /// /// Nintendo Logo /// /// 156 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 156)] - public byte[]? NintendoLogo; + public byte[] NintendoLogo = new byte[156]; /// /// Nintendo Logo CRC @@ -227,6 +227,6 @@ namespace SabreTools.Data.Models.Nitro /// /// 0x20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? DebuggerReserved; + public byte[] DebuggerReserved = new byte[0x20]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/Nitro/ExtendedDSiHeader.cs b/SabreTools.Serialization/Models/Nitro/ExtendedDSiHeader.cs index 5cb8bcb4..dd4016d4 100644 --- a/SabreTools.Serialization/Models/Nitro/ExtendedDSiHeader.cs +++ b/SabreTools.Serialization/Models/Nitro/ExtendedDSiHeader.cs @@ -165,7 +165,7 @@ namespace SabreTools.Data.Models.Nitro /// /// 12 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] - public byte[]? Unknown2; + public byte[] Unknown2 = new byte[12]; /// /// Modcrypt area 1 offset @@ -192,7 +192,7 @@ namespace SabreTools.Data.Models.Nitro /// /// 8 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public byte[]? TitleID; + public byte[] TitleID = new byte[8]; /// /// DSiWare: "public.sav" size @@ -209,90 +209,90 @@ namespace SabreTools.Data.Models.Nitro /// /// 176 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 176)] - public byte[]? ReservedZero; + public byte[] ReservedZero = new byte[176]; /// /// Unknown (used by DSi) /// /// 16 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[]? Unknown3; + public byte[] Unknown3 = new byte[16]; /// /// ARM9 (with encrypted secure area) SHA1 HMAC hash /// /// 20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? ARM9WithSecureAreaSHA1HMACHash; + public byte[] ARM9WithSecureAreaSHA1HMACHash = new byte[20]; /// /// ARM7 SHA1 HMAC hash /// /// 20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? ARM7SHA1HMACHash; + public byte[] ARM7SHA1HMACHash = new byte[20]; /// /// Digest master SHA1 HMAC hash /// /// 20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? DigestMasterSHA1HMACHash; + public byte[] DigestMasterSHA1HMACHash = new byte[20]; /// /// Banner SHA1 HMAC hash /// /// 20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? BannerSHA1HMACHash; + public byte[] BannerSHA1HMACHash = new byte[20]; /// /// ARM9i (decrypted) SHA1 HMAC hash /// /// 20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? ARM9iDecryptedSHA1HMACHash; + public byte[] ARM9iDecryptedSHA1HMACHash = new byte[20]; /// /// ARM7i (decrypted) SHA1 HMAC hash /// /// 20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? ARM7iDecryptedSHA1HMACHash; + public byte[] ARM7iDecryptedSHA1HMACHash = new byte[20]; /// /// Reserved /// /// 40 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 40)] - public byte[]? Reserved5; + public byte[] Reserved5 = new byte[40]; /// /// ARM9 (without secure area) SHA1 HMAC hash /// /// 20 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] - public byte[]? ARM9NoSecureAreaSHA1HMACHash; + public byte[] ARM9NoSecureAreaSHA1HMACHash = new byte[20]; /// /// Reserved /// /// 2636 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2636)] - public byte[]? Reserved6; + public byte[] Reserved6 = new byte[2636]; /// /// Reserved and unchecked region, always zero. Used for passing arguments in debug environment. /// /// 0x180 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x180)] - public byte[]? ReservedAndUnchecked; + public byte[] ReservedAndUnchecked = new byte[0x180]; /// /// RSA signature (the first 0xE00 bytes of the header are signed with an 1024-bit RSA signature). /// /// 0x80 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x80)] - public byte[]? RSASignature; + public byte[] RSASignature = new byte[0x80]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/OLE/BLOB.cs b/SabreTools.Serialization/Models/OLE/BLOB.cs index b6e0b392..d14548c8 100644 --- a/SabreTools.Serialization/Models/OLE/BLOB.cs +++ b/SabreTools.Serialization/Models/OLE/BLOB.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.OLE /// /// The BLOB packet represents binary data /// - /// + /// public class BLOB { /// @@ -14,6 +14,6 @@ namespace SabreTools.Data.Models.OLE /// /// MUST be an array of bytes, followed by zero padding to a multiple of 4 bytes. /// - public byte[]? Bytes { get; set; } + public byte[] Bytes { get; set; } } } diff --git a/SabreTools.Serialization/Models/OLE/ClipboardData.cs b/SabreTools.Serialization/Models/OLE/ClipboardData.cs index dd17c0bc..7245ed20 100644 --- a/SabreTools.Serialization/Models/OLE/ClipboardData.cs +++ b/SabreTools.Serialization/Models/OLE/ClipboardData.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.OLE /// /// The ClipboardData packet represents clipboard data /// - /// + /// public class ClipboardData { /// @@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.OLE /// /// MUST be an array of bytes, followed by zero padding to a multiple of 4 bytes /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } } diff --git a/SabreTools.Serialization/Models/OLE/GUID.cs b/SabreTools.Serialization/Models/OLE/GUID.cs index d3f32954..ab6cf856 100644 --- a/SabreTools.Serialization/Models/OLE/GUID.cs +++ b/SabreTools.Serialization/Models/OLE/GUID.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.OLE /// /// The GUID (Packet Version) packet represents a GUID /// - /// + /// public class GUID { /// @@ -24,6 +24,6 @@ namespace SabreTools.Data.Models.OLE /// /// The value of the Data4 field specified in [MS-DTYP] section 2.3.4 /// - public byte[]? Data4 { get; set; } + public byte[] Data4 { get; set; } = new byte[8]; } } diff --git a/SabreTools.Serialization/Models/OLE/TypedPropertyValue.cs b/SabreTools.Serialization/Models/OLE/TypedPropertyValue.cs index c47c4f75..8e68a523 100644 --- a/SabreTools.Serialization/Models/OLE/TypedPropertyValue.cs +++ b/SabreTools.Serialization/Models/OLE/TypedPropertyValue.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.OLE /// /// The TypedPropertyValue structure represents the typed value of a property in a property set /// - /// + /// public class TypedPropertyValue { /// @@ -22,6 +22,6 @@ namespace SabreTools.Data.Models.OLE /// the value of Type as follows. /// /// See documentation for required lengths - public byte[]? Value { get; set; } + public byte[] Value { get; set; } } } diff --git a/SabreTools.Serialization/Models/PIC/DiscInformationUnitBody.cs b/SabreTools.Serialization/Models/PIC/DiscInformationUnitBody.cs index 32e33107..a06a63f9 100644 --- a/SabreTools.Serialization/Models/PIC/DiscInformationUnitBody.cs +++ b/SabreTools.Serialization/Models/PIC/DiscInformationUnitBody.cs @@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.PIC /// DI Unit Format dependent contents /// /// 52 bytes for BD-ROM, 100 bytes for BD-R/RE - public byte[]? FormatDependentContents { get; set; } + public byte[] FormatDependentContents { get; set; } } } diff --git a/SabreTools.Serialization/Models/PIC/DiscInformationUnitTrailer.cs b/SabreTools.Serialization/Models/PIC/DiscInformationUnitTrailer.cs index 45b131bd..5b3ad8a7 100644 --- a/SabreTools.Serialization/Models/PIC/DiscInformationUnitTrailer.cs +++ b/SabreTools.Serialization/Models/PIC/DiscInformationUnitTrailer.cs @@ -15,14 +15,14 @@ namespace SabreTools.Data.Models.PIC /// /// 6 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] - public byte[]? DiscManufacturerID; + public byte[] DiscManufacturerID = new byte[6]; /// /// Media Type ID /// /// 3 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] - public byte[]? MediaTypeID; + public byte[] MediaTypeID = new byte[3]; /// /// Time Stamp diff --git a/SabreTools.Serialization/Models/PKZIP/AS400ExtraFieldAttribute.cs b/SabreTools.Serialization/Models/PKZIP/AS400ExtraFieldAttribute.cs index 536fa640..91ab2835 100644 --- a/SabreTools.Serialization/Models/PKZIP/AS400ExtraFieldAttribute.cs +++ b/SabreTools.Serialization/Models/PKZIP/AS400ExtraFieldAttribute.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.PKZIP /// /// AS/400 Extra Field (0x0065) Attribute [APPENDIX A] /// - /// + /// public class AS400ExtraFieldAttribute : ExtensibleDataField { /// @@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.PKZIP /// Data /// /// Variable byte length based on field code - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/Archive.cs b/SabreTools.Serialization/Models/PKZIP/Archive.cs index ae3fbbcd..658c235b 100644 --- a/SabreTools.Serialization/Models/PKZIP/Archive.cs +++ b/SabreTools.Serialization/Models/PKZIP/Archive.cs @@ -15,7 +15,7 @@ namespace SabreTools.Data.Models.PKZIP /// Optional archive decryption header, appears after all entries /// /// TODO: Determine the model - public byte[]? ArchiveDecryptionHeader { get; set; } + public byte[] ArchiveDecryptionHeader { get; set; } /// /// Optional archive extra data record, appears after either diff --git a/SabreTools.Serialization/Models/PKZIP/ArchiveExtraDataRecord.cs b/SabreTools.Serialization/Models/PKZIP/ArchiveExtraDataRecord.cs index c9d1c70d..3fabda5c 100644 --- a/SabreTools.Serialization/Models/PKZIP/ArchiveExtraDataRecord.cs +++ b/SabreTools.Serialization/Models/PKZIP/ArchiveExtraDataRecord.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.PKZIP /// /// Archive extra data record /// - /// + /// public class ArchiveExtraDataRecord { /// @@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.PKZIP /// /// Extra field data (variable size) /// - public byte[]? ExtraFieldData { get; set; } + public byte[] ExtraFieldData { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/DataStreamAlignment.cs b/SabreTools.Serialization/Models/PKZIP/DataStreamAlignment.cs index f79070f9..2ce29050 100644 --- a/SabreTools.Serialization/Models/PKZIP/DataStreamAlignment.cs +++ b/SabreTools.Serialization/Models/PKZIP/DataStreamAlignment.cs @@ -4,10 +4,10 @@ namespace SabreTools.Data.Models.PKZIP /// (per Zbynek Vyskovsky) Defines alignment of data stream of this /// entry within the zip archive. Additionally, indicates whether the /// compression method should be kept when re-compressing the zip file. - /// + /// /// The purpose of this extra field is to align specific resources to /// word or page boundaries so they can be easily mapped into memory. - /// + /// /// The alignment field (lower 15 bits) defines the minimal alignment /// required by the data stream. Bit 15 of alignment field indicates /// whether the compression method of this entry can be changed when @@ -18,7 +18,7 @@ namespace SabreTools.Data.Models.PKZIP /// alignment changes. (see https://issues.apache.org/jira/browse/COMPRESS-391) /// /// Header ID = 0xa11e - /// + /// public class DataStreamAlignment : ExtensibleDataField { /// @@ -29,6 +29,6 @@ namespace SabreTools.Data.Models.PKZIP /// /// 0x00-padding /// - public byte[]? Padding { get; set; } + public byte[] Padding { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/DigitalSignature.cs b/SabreTools.Serialization/Models/PKZIP/DigitalSignature.cs index da374e72..a756c4b9 100644 --- a/SabreTools.Serialization/Models/PKZIP/DigitalSignature.cs +++ b/SabreTools.Serialization/Models/PKZIP/DigitalSignature.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.PKZIP /// /// Digital signature /// - /// + /// public class DigitalSignature { /// @@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.PKZIP /// /// Signature data (variable size) /// - public byte[]? SignatureData { get; set; } + public byte[] SignatureData { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/EndOfCentralDirectoryRecord64.cs b/SabreTools.Serialization/Models/PKZIP/EndOfCentralDirectoryRecord64.cs index 05ea9123..8fc836c5 100644 --- a/SabreTools.Serialization/Models/PKZIP/EndOfCentralDirectoryRecord64.cs +++ b/SabreTools.Serialization/Models/PKZIP/EndOfCentralDirectoryRecord64.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.PKZIP /// /// Zip64 end of central directory record /// - /// + /// public class EndOfCentralDirectoryRecord64 { /// @@ -67,6 +67,6 @@ namespace SabreTools.Data.Models.PKZIP /// /// ZIP64 extensible data sector /// - public byte[]? ExtensibleDataSector { get; set; } + public byte[] ExtensibleDataSector { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/FWKCSMD5ExtraField.cs b/SabreTools.Serialization/Models/PKZIP/FWKCSMD5ExtraField.cs index ad143eb6..8968123e 100644 --- a/SabreTools.Serialization/Models/PKZIP/FWKCSMD5ExtraField.cs +++ b/SabreTools.Serialization/Models/PKZIP/FWKCSMD5ExtraField.cs @@ -5,35 +5,35 @@ namespace SabreTools.Data.Models.PKZIP /// automatically identifying files independent of file name, /// optionally adds and uses an extra field to support the /// rapid creation of an enhanced contents_signature. - /// + /// /// When FWKCS revises a .ZIP file central directory to add /// this extra field for a file, it also replaces the /// central directory entry for that file's uncompressed /// file length with a measured value. - /// + /// /// FWKCS provides an option to strip this extra field, if /// present, from a .ZIP file central directory. In adding /// this extra field, FWKCS preserves .ZIP file Authenticity /// Verification; if stripping this extra field, FWKCS /// preserves all versions of AV through PKZIP version 2.04g. - /// + /// /// FWKCS, and FWKCS Contents_Signature System, are /// trademarks of Frederick W. Kantor. /// /// Header ID = 0x4b46 - /// + /// public class FWKCSMD5ExtraField : ExtensibleDataField { /// /// "MD5" /// /// 3 bytes - public byte[]? Preface { get; set; } + public byte[] Preface { get; set; } = new byte[3]; /// /// Uncompressed file's MD5 hash, low byte first /// /// 16 bytes - public byte[]? MD5 { get; set; } + public byte[] MD5 { get; set; } = new byte[16]; } } diff --git a/SabreTools.Serialization/Models/PKZIP/KeyProviderRecordExtraField.cs b/SabreTools.Serialization/Models/PKZIP/KeyProviderRecordExtraField.cs index 719d4728..ff194770 100644 --- a/SabreTools.Serialization/Models/PKZIP/KeyProviderRecordExtraField.cs +++ b/SabreTools.Serialization/Models/PKZIP/KeyProviderRecordExtraField.cs @@ -11,12 +11,12 @@ namespace SabreTools.Data.Models.PKZIP /// Product" for more information. /// /// Header ID = 0x0022 - /// + /// public class KeyProviderRecordExtraField : ExtensibleDataField { /// /// Data about the key /// - public byte[]? TData { get; set; } + public byte[] TData { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/LocalFile.cs b/SabreTools.Serialization/Models/PKZIP/LocalFile.cs index d443024e..56caaffd 100644 --- a/SabreTools.Serialization/Models/PKZIP/LocalFile.cs +++ b/SabreTools.Serialization/Models/PKZIP/LocalFile.cs @@ -3,8 +3,8 @@ namespace SabreTools.Data.Models.PKZIP /// /// PKZIP local file /// - /// - /// + /// + /// public class LocalFile { /// @@ -16,24 +16,24 @@ namespace SabreTools.Data.Models.PKZIP /// Encryption header /// /// TODO: Determine the model for the encryption headers - public byte[]? EncryptionHeaders { get; set; } + public byte[] EncryptionHeaders { get; set; } /// /// File data, appears after the encryption header /// if it exists or after the local file header otherwise /// - public byte[]? FileData { get; set; } + public byte[] FileData { get; set; } /// /// Data descriptors, appears after the file data /// - /// Cannot exist if is populated + /// Cannot exist if is populated public DataDescriptor? DataDescriptor { get; set; } /// /// ZIP64 Data descriptors, appears after the file data /// - /// Cannot exist if is populated + /// Cannot exist if is populated public DataDescriptor64? ZIP64DataDescriptor { get; set; } } diff --git a/SabreTools.Serialization/Models/PKZIP/MVSExtraField.cs b/SabreTools.Serialization/Models/PKZIP/MVSExtraField.cs index 33d9ce86..1ee572b7 100644 --- a/SabreTools.Serialization/Models/PKZIP/MVSExtraField.cs +++ b/SabreTools.Serialization/Models/PKZIP/MVSExtraField.cs @@ -4,7 +4,7 @@ namespace SabreTools.Data.Models.PKZIP /// The following is the layout of the MVS "extra" block. /// /// Header ID = 0x0065 - /// + /// public class MVSExtraField : ExtensibleDataField { /// @@ -16,6 +16,6 @@ namespace SabreTools.Data.Models.PKZIP /// /// Attribute data (see APPENDIX B) /// - public byte[]? Var { get; set; } + public byte[] Var { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/MicrosoftOpenPackagingGrowthHint.cs b/SabreTools.Serialization/Models/PKZIP/MicrosoftOpenPackagingGrowthHint.cs index a8ef596d..8e0550e3 100644 --- a/SabreTools.Serialization/Models/PKZIP/MicrosoftOpenPackagingGrowthHint.cs +++ b/SabreTools.Serialization/Models/PKZIP/MicrosoftOpenPackagingGrowthHint.cs @@ -1,7 +1,7 @@ namespace SabreTools.Data.Models.PKZIP { /// Header ID = 0xa220 - /// + /// public class MicrosoftOpenPackagingGrowthHint : ExtensibleDataField { /// @@ -17,6 +17,6 @@ namespace SabreTools.Data.Models.PKZIP /// /// Filled with NULL characters /// - public byte[]? Padding { get; set; } + public byte[] Padding { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/OS2ExtraField.cs b/SabreTools.Serialization/Models/PKZIP/OS2ExtraField.cs index 509b99b5..dc212408 100644 --- a/SabreTools.Serialization/Models/PKZIP/OS2ExtraField.cs +++ b/SabreTools.Serialization/Models/PKZIP/OS2ExtraField.cs @@ -3,14 +3,14 @@ namespace SabreTools.Data.Models.PKZIP /// /// The following is the layout of the OS/2 attributes "extra" /// block. (Last Revision 09/05/95) - /// + /// /// The OS/2 extended attribute structure (FEA2LIST) is /// compressed and then stored in its entirety within this /// structure. There will only ever be one "block" of data in /// VarFields[]. /// /// Header ID = 0x0009 - /// + /// public class OS2ExtraField : ExtensibleDataField { /// @@ -31,6 +31,6 @@ namespace SabreTools.Data.Models.PKZIP /// /// Compressed block /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/OS400ExtraField.cs b/SabreTools.Serialization/Models/PKZIP/OS400ExtraField.cs index 520df391..50bcd4d6 100644 --- a/SabreTools.Serialization/Models/PKZIP/OS400ExtraField.cs +++ b/SabreTools.Serialization/Models/PKZIP/OS400ExtraField.cs @@ -4,7 +4,7 @@ namespace SabreTools.Data.Models.PKZIP /// The following is the layout of the OS/400 "extra" block. /// /// Header ID = 0x0065 - /// + /// public class OS400ExtraField : ExtensibleDataField { /// @@ -16,6 +16,6 @@ namespace SabreTools.Data.Models.PKZIP /// /// Attribute data (see APPENDIX A) /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/PKCS7EncryptionRecipientCertificateList.cs b/SabreTools.Serialization/Models/PKZIP/PKCS7EncryptionRecipientCertificateList.cs index 89d3f45a..93da5607 100644 --- a/SabreTools.Serialization/Models/PKZIP/PKCS7EncryptionRecipientCertificateList.cs +++ b/SabreTools.Serialization/Models/PKZIP/PKCS7EncryptionRecipientCertificateList.cs @@ -8,14 +8,14 @@ namespace SabreTools.Data.Models.PKZIP /// serves only to aid archive modifications by preserving public /// encryption key data. Individual security requirements may dictate /// that this data be omitted to deter information exposure. - /// + /// /// See the section describing the Strong Encryption Specification /// for details. Refer to the section in this document entitled /// "Incorporating PKWARE Proprietary Technology into Your Product" /// for more information. /// /// Header ID = 0x0019 - /// + /// public class PKCS7EncryptionRecipientCertificateList : ExtensibleDataField { /// @@ -26,6 +26,6 @@ namespace SabreTools.Data.Models.PKZIP /// /// PKCS#7 data blob /// - public byte[]? CStore { get; set; } + public byte[] CStore { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/PKCS7Store.cs b/SabreTools.Serialization/Models/PKZIP/PKCS7Store.cs index 97a265dd..92c29c32 100644 --- a/SabreTools.Serialization/Models/PKZIP/PKCS7Store.cs +++ b/SabreTools.Serialization/Models/PKZIP/PKCS7Store.cs @@ -9,12 +9,12 @@ namespace SabreTools.Data.Models.PKZIP /// other record. /// /// Header ID = 0x0014 - /// + /// public class PKCS7Store : ExtensibleDataField { /// /// Data about the store /// - public byte[]? TData { get; set; } + public byte[] TData { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/PolicyDecryptionKeyRecordExtraField.cs b/SabreTools.Serialization/Models/PKZIP/PolicyDecryptionKeyRecordExtraField.cs index e0f40613..69195591 100644 --- a/SabreTools.Serialization/Models/PKZIP/PolicyDecryptionKeyRecordExtraField.cs +++ b/SabreTools.Serialization/Models/PKZIP/PolicyDecryptionKeyRecordExtraField.cs @@ -11,12 +11,12 @@ namespace SabreTools.Data.Models.PKZIP /// Product" for more information. /// /// Header ID = 0x0021 - /// + /// public class PolicyDecryptionKeyRecordExtraField : ExtensibleDataField { /// /// Data about the key /// - public byte[]? TData { get; set; } + public byte[] TData { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/PolicyKeyDataRecordRecordExtraField.cs b/SabreTools.Serialization/Models/PKZIP/PolicyKeyDataRecordRecordExtraField.cs index 193e7fe1..edd536c2 100644 --- a/SabreTools.Serialization/Models/PKZIP/PolicyKeyDataRecordRecordExtraField.cs +++ b/SabreTools.Serialization/Models/PKZIP/PolicyKeyDataRecordRecordExtraField.cs @@ -6,17 +6,17 @@ namespace SabreTools.Data.Models.PKZIP /// information about encryptions and/or encryption key sources. /// Contact PKWARE for information on current TData structures. /// Information in this "extra" block may aternatively be placed - /// within comment fields. Refer to the section in this document + /// within comment fields. Refer to the section in this document /// entitled "Incorporating PKWARE Proprietary Technology into Your /// Product" for more information. /// /// Header ID = 0x0023 - /// + /// public class PolicyKeyDataRecordRecordExtraField : ExtensibleDataField { /// /// Data about the key /// - public byte[]? TData { get; set; } + public byte[] TData { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/SpecialPurposeDataHeader.cs b/SabreTools.Serialization/Models/PKZIP/SpecialPurposeDataHeader.cs index bbafe59d..b258aa0f 100644 --- a/SabreTools.Serialization/Models/PKZIP/SpecialPurposeDataHeader.cs +++ b/SabreTools.Serialization/Models/PKZIP/SpecialPurposeDataHeader.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.PKZIP /// /// Special purpose data for ZIP64 extensible data field /// - /// + /// public class SpecialPurposeDataHeader { /// @@ -20,6 +20,6 @@ namespace SabreTools.Data.Models.PKZIP /// Data (variable size) /// /// TODO: Implement models for all extra field types - 4.5.3 - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/StrongEncryptionHeader.cs b/SabreTools.Serialization/Models/PKZIP/StrongEncryptionHeader.cs index 0626cdd9..ef9f120c 100644 --- a/SabreTools.Serialization/Models/PKZIP/StrongEncryptionHeader.cs +++ b/SabreTools.Serialization/Models/PKZIP/StrongEncryptionHeader.cs @@ -7,7 +7,7 @@ namespace SabreTools.Data.Models.PKZIP /// for more information. /// /// Header ID = 0x0017 - /// + /// public class StrongEncryptionHeader : ExtensibleDataField { /// @@ -39,6 +39,6 @@ namespace SabreTools.Data.Models.PKZIP /// Certificate Processing Method under /// the Strong Encryption Specification /// - public byte[]? CertData { get; set; } + public byte[] CertData { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/TagSizeVar.cs b/SabreTools.Serialization/Models/PKZIP/TagSizeVar.cs index 6a72c15c..671858fc 100644 --- a/SabreTools.Serialization/Models/PKZIP/TagSizeVar.cs +++ b/SabreTools.Serialization/Models/PKZIP/TagSizeVar.cs @@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.PKZIP /// /// Variable-length data /// - public byte[]? Var { get; set; } + public byte[] Var { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/UnixExtraField.cs b/SabreTools.Serialization/Models/PKZIP/UnixExtraField.cs index 914a4ba5..6e2060a1 100644 --- a/SabreTools.Serialization/Models/PKZIP/UnixExtraField.cs +++ b/SabreTools.Serialization/Models/PKZIP/UnixExtraField.cs @@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.PKZIP { /// /// The following is the layout of the UNIX "extra" block. - /// + /// /// The variable length data field will contain file type /// specific data. Currently the only values allowed are /// the original "linked to" file names for hard or symbolic @@ -18,7 +18,7 @@ namespace SabreTools.Data.Models.PKZIP /// device number. /// /// Header ID = 0x000D - /// + /// public class UnixExtraField : ExtensibleDataField { /// @@ -44,6 +44,6 @@ namespace SabreTools.Data.Models.PKZIP /// /// Variable length data field /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/UnknownExtraField.cs b/SabreTools.Serialization/Models/PKZIP/UnknownExtraField.cs index 0a8468ae..48819a20 100644 --- a/SabreTools.Serialization/Models/PKZIP/UnknownExtraField.cs +++ b/SabreTools.Serialization/Models/PKZIP/UnknownExtraField.cs @@ -8,8 +8,8 @@ namespace SabreTools.Data.Models.PKZIP public class UnknownExtraField : ExtensibleDataField { /// - /// + /// /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/X509CentralDirectory.cs b/SabreTools.Serialization/Models/PKZIP/X509CentralDirectory.cs index df90db00..b77cc974 100644 --- a/SabreTools.Serialization/Models/PKZIP/X509CentralDirectory.cs +++ b/SabreTools.Serialization/Models/PKZIP/X509CentralDirectory.cs @@ -8,12 +8,12 @@ namespace SabreTools.Data.Models.PKZIP /// otherwise it will appear in the first central directory record. /// /// Header ID = 0x0016 - /// + /// public class X509CentralDirectory : ExtensibleDataField { /// /// Data /// - public byte[]? TData { get; set; } + public byte[] TData { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/X509IndividualFile.cs b/SabreTools.Serialization/Models/PKZIP/X509IndividualFile.cs index 6e2b382a..73ddb901 100644 --- a/SabreTools.Serialization/Models/PKZIP/X509IndividualFile.cs +++ b/SabreTools.Serialization/Models/PKZIP/X509IndividualFile.cs @@ -7,12 +7,12 @@ namespace SabreTools.Data.Models.PKZIP /// times, but can only appear once per certificate. /// /// Header ID = 0x0015 - /// + /// public class X509IndividualFile : ExtensibleDataField { /// /// Signature Data /// - public byte[]? TData { get; set; } + public byte[] TData { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/ZOSExtraFieldAttribute.cs b/SabreTools.Serialization/Models/PKZIP/ZOSExtraFieldAttribute.cs index 4a6c6fb3..692cdba0 100644 --- a/SabreTools.Serialization/Models/PKZIP/ZOSExtraFieldAttribute.cs +++ b/SabreTools.Serialization/Models/PKZIP/ZOSExtraFieldAttribute.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.PKZIP /// /// z/OS Extra Field (0x0065) Attribute [APPENDIX B] /// - /// + /// public class ZOSExtraFieldAttribute : ExtensibleDataField { /// @@ -21,6 +21,6 @@ namespace SabreTools.Data.Models.PKZIP /// Data /// /// Variable byte length based on field code - public byte[]? Data { get; set; } + public byte[] Data { get; set; } } } diff --git a/SabreTools.Serialization/Models/PKZIP/ZipItMacintoshExtraField.cs b/SabreTools.Serialization/Models/PKZIP/ZipItMacintoshExtraField.cs index 5572bfd4..dbcc0a5c 100644 --- a/SabreTools.Serialization/Models/PKZIP/ZipItMacintoshExtraField.cs +++ b/SabreTools.Serialization/Models/PKZIP/ZipItMacintoshExtraField.cs @@ -8,7 +8,7 @@ namespace SabreTools.Data.Models.PKZIP /// is not stored MacBinary-encoded. /// /// Header ID = 0x2605 - /// + /// public class ZipItMacintoshExtraField : ExtensibleDataField { /// @@ -30,12 +30,12 @@ namespace SabreTools.Data.Models.PKZIP /// Four-byte Mac file type string /// /// 4 bytes - public byte[]? FileType { get; set; } + public byte[] FileType { get; set; } = new byte[4]; /// /// Four-byte Mac creator string /// /// 4 bytes - public byte[]? Creator { get; set; } + public byte[] Creator { get; set; } = new byte[4]; } } diff --git a/SabreTools.Serialization/Models/PKZIP/ZipItMacintoshShortFileExtraField.cs b/SabreTools.Serialization/Models/PKZIP/ZipItMacintoshShortFileExtraField.cs index 808a2cca..0a692a98 100644 --- a/SabreTools.Serialization/Models/PKZIP/ZipItMacintoshShortFileExtraField.cs +++ b/SabreTools.Serialization/Models/PKZIP/ZipItMacintoshShortFileExtraField.cs @@ -8,7 +8,7 @@ namespace SabreTools.Data.Models.PKZIP /// file. The local-header and central-header versions are identical. /// /// Header ID = 0x2705 - /// + /// public class ZipItMacintoshShortFileExtraField : ExtensibleDataField { /// @@ -20,13 +20,13 @@ namespace SabreTools.Data.Models.PKZIP /// Four-byte Mac file type string /// /// 4 bytes - public byte[]? FileType { get; set; } + public byte[] FileType { get; set; } = new byte[4]; /// /// Four-byte Mac creator string /// /// 4 bytes - public byte[]? Creator { get; set; } + public byte[] Creator { get; set; } = new byte[4]; /// /// Attributes from FInfo.frFlags, MAY be omitted diff --git a/SabreTools.Serialization/Models/PlayJ/DataFile.cs b/SabreTools.Serialization/Models/PlayJ/DataFile.cs index ba9e0d49..e30dfef5 100644 --- a/SabreTools.Serialization/Models/PlayJ/DataFile.cs +++ b/SabreTools.Serialization/Models/PlayJ/DataFile.cs @@ -23,7 +23,7 @@ namespace SabreTools.Data.Models.PlayJ /// /// Data /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } // Notes about Data: // - Each data block in the samples contains a GIF header @@ -32,4 +32,4 @@ namespace SabreTools.Data.Models.PlayJ // - Remaining data seems to be padded as 0x00 (typically 8 bytes) // - GIF data is fully formed and may be copied to a standalone file } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/PlayJ/PlaylistHeader.cs b/SabreTools.Serialization/Models/PlayJ/PlaylistHeader.cs index af05d0c9..9213d806 100644 --- a/SabreTools.Serialization/Models/PlayJ/PlaylistHeader.cs +++ b/SabreTools.Serialization/Models/PlayJ/PlaylistHeader.cs @@ -13,6 +13,6 @@ namespace SabreTools.Data.Models.PlayJ /// /// 52 bytes of unknown data /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } = new byte[52]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/PlayJ/UnknownBlock1.cs b/SabreTools.Serialization/Models/PlayJ/UnknownBlock1.cs index b897e738..79398a98 100644 --- a/SabreTools.Serialization/Models/PlayJ/UnknownBlock1.cs +++ b/SabreTools.Serialization/Models/PlayJ/UnknownBlock1.cs @@ -13,7 +13,7 @@ namespace SabreTools.Data.Models.PlayJ /// /// Unknown data /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } // Notes about Data: // - Might be UInt16 offset and UInt16 length pairs @@ -21,4 +21,4 @@ namespace SabreTools.Data.Models.PlayJ // - Might be relevant to encryption // - Highly repeating patterns in the values with only a few differences } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/PlayJ/UnknownBlock3.cs b/SabreTools.Serialization/Models/PlayJ/UnknownBlock3.cs index 82d0dfd3..375e03f3 100644 --- a/SabreTools.Serialization/Models/PlayJ/UnknownBlock3.cs +++ b/SabreTools.Serialization/Models/PlayJ/UnknownBlock3.cs @@ -8,11 +8,11 @@ namespace SabreTools.Data.Models.PlayJ /// /// Unknown data /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } // Notes about Data: // - This may be where the encrypted audio samples live // - It is also possible that it's where the ad data lives and samples follow // + See V2 for example of why this would be the case } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/PlayStation3/SFB.cs b/SabreTools.Serialization/Models/PlayStation3/SFB.cs index f2168346..9b628766 100644 --- a/SabreTools.Serialization/Models/PlayStation3/SFB.cs +++ b/SabreTools.Serialization/Models/PlayStation3/SFB.cs @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; namespace SabreTools.Data.Models.PlayStation3 { - /// + /// [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] public class SFB { @@ -21,7 +21,7 @@ namespace SabreTools.Data.Models.PlayStation3 /// /// 0x18 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x18)] - public byte[]? Reserved1; + public byte[] Reserved1 = new byte[0x18]; /// /// "HYBRID_FLAG" (Flags type) @@ -45,7 +45,7 @@ namespace SabreTools.Data.Models.PlayStation3 /// /// 0x08 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x08)] - public byte[]? Reserved2; + public byte[] Reserved2 = new byte[0x08]; /// /// "TITLE_ID" (Disc Title Name) @@ -59,7 +59,7 @@ namespace SabreTools.Data.Models.PlayStation3 /// /// 0x08 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x08)] - public byte[]? Reserved3; + public byte[] Reserved3 = new byte[0x08]; /// /// Disc Version Data Offset @@ -76,7 +76,7 @@ namespace SabreTools.Data.Models.PlayStation3 /// /// 0x188 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x188)] - public byte[]? Reserved4; + public byte[] Reserved4 = new byte[0x188]; /// /// Disc Content (Hybrid Flags) @@ -104,6 +104,6 @@ namespace SabreTools.Data.Models.PlayStation3 /// /// 0x3C0 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x3C0)] - public byte[]? Reserved5; + public byte[] Reserved5 = new byte[0x3C0]; } } diff --git a/SabreTools.Serialization/Models/PlayStation3/SFO.cs b/SabreTools.Serialization/Models/PlayStation3/SFO.cs index b31e0f54..73a1a262 100644 --- a/SabreTools.Serialization/Models/PlayStation3/SFO.cs +++ b/SabreTools.Serialization/Models/PlayStation3/SFO.cs @@ -1,6 +1,6 @@ namespace SabreTools.Data.Models.PlayStation3 { - /// + /// public class SFO { /// @@ -22,12 +22,12 @@ namespace SabreTools.Data.Models.PlayStation3 /// (0x00), and ordered alphabetically (from A to Z). This alphabetically /// order defines the order of the associated entries in the other /// two tables (index_table, and data_table) - /// + /// /// The end offset of this table needs to be aligned to a multiply of /// 32bits (4 bytes), this is made with a padding at the end of key_table /// when needed (in a few SFO's the table is aligned naturally as a /// coincidence caused by the length of the key names used, when this - /// happens there is no padding needed) + /// happens there is no padding needed) /// public string[]? KeyTable { get; set; } @@ -35,7 +35,7 @@ namespace SabreTools.Data.Models.PlayStation3 /// Padding /// /// Enough bytes to align to 4 bytes - public byte[]? Padding { get; set; } + public byte[] Padding { get; set; } /// /// Data table @@ -45,7 +45,7 @@ namespace SabreTools.Data.Models.PlayStation3 /// the header, every entry in this table is defined by the associated entry /// in the index_table by using: fmt, len, max_len, and offset. There is /// no padding between entries neither at the end of this table - /// + /// /// Some data entries can be filled with zeroes (not used, but availables for /// being used). This entries can be considered reserved, and are marked with /// a len = 0 in the associated entry in the index_table diff --git a/SabreTools.Serialization/Models/PlayStation4/AppPkgHeader.cs b/SabreTools.Serialization/Models/PlayStation4/AppPkgHeader.cs index 07d18b35..a93c2244 100644 --- a/SabreTools.Serialization/Models/PlayStation4/AppPkgHeader.cs +++ b/SabreTools.Serialization/Models/PlayStation4/AppPkgHeader.cs @@ -77,12 +77,12 @@ namespace SabreTools.Data.Models.PlayStation4 /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x24)] public string? ContentID; - + /// /// PKG Content Padding (Zeroes) /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xC)] - public byte[]? ContentZeroes; + public byte[] ContentZeroes = new byte[0xC]; /// /// PKG DRM Type @@ -113,42 +113,42 @@ namespace SabreTools.Data.Models.PlayStation4 /// PKG Content Flags /// public uint VersionHash; - + /// /// PKG Padding Section 1 /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x78)] - public byte[]? Zeroes1; - + public byte[] Zeroes1 = new byte[0x78]; + /// /// PKG SHA256 for Main Entry 1 /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? MainEntry1SHA256; - + public byte[] MainEntry1SHA256 = new byte[0x20]; + /// /// PKG SHA256 for Main Entry 2 /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? MainEntry2SHA256; - + public byte[] MainEntry2SHA256 = new byte[0x20]; + /// /// PKG SHA256 for Digest Table /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? DigestTableSHA256; - + public byte[] DigestTableSHA256 = new byte[0x20]; + /// /// PKG SHA256 for Main Table /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? MainTableSHA256; - + public byte[] MainTableSHA256 = new byte[0x20]; + /// /// PKG Padding Section 2 /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x280)] - public byte[]? Zeroes2; + public byte[] Zeroes2 = new byte[0x280]; /// /// PFS Unknown Field @@ -199,18 +199,18 @@ namespace SabreTools.Data.Models.PlayStation4 /// PKG Signed Size /// public uint PKGCacheSize; - + /// /// SHA256 for PFS Image /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? PFSImageSHA256; - + public byte[] PFSImageSHA256 = new byte[0x20]; + /// /// SHA256 for PFS Signed /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? PFSSignedSHA256; + public byte[] PFSSignedSHA256 = new byte[0x20]; /// /// PFS Split Size nth 0 @@ -221,17 +221,17 @@ namespace SabreTools.Data.Models.PlayStation4 /// PFS Split Size nth 1 /// public ulong PFSSplitSize1; - + /// /// PKG Padding Section 3 /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xB50)] - public byte[]? Zeroes3; - + public byte[] Zeroes3 = new byte[0xB50]; + /// /// SHA256 for PKG /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] - public byte[]? PKGSHA256; + public byte[] PKGSHA256 = new byte[0x20]; } } diff --git a/SabreTools.Serialization/Models/PortableExecutable/AttributeCertificate/Entry.cs b/SabreTools.Serialization/Models/PortableExecutable/AttributeCertificate/Entry.cs index 22f9fe48..4582f3c4 100644 --- a/SabreTools.Serialization/Models/PortableExecutable/AttributeCertificate/Entry.cs +++ b/SabreTools.Serialization/Models/PortableExecutable/AttributeCertificate/Entry.cs @@ -6,7 +6,7 @@ /// contiguous, quadword-aligned attribute certificate entries. Zero padding is /// inserted between the original end of the file and the beginning of the attribute /// certificate table to achieve this alignment. - /// + /// /// The virtual address value from the Certificate Table entry in the Optional /// Header Data Directory is a file offset to the first attribute certificate /// entry. Subsequent entries are accessed by advancing that entry's dwLength @@ -16,10 +16,10 @@ /// Header Data Directory. If the sum of the rounded dwLength values does not equal /// the Size value, then either the attribute certificate table or the Size field /// is corrupted. - /// + /// /// The first certificate starts at offset 0x5000 from the start of the file on disk. /// To advance through all the attribute certificate entries: - /// + /// /// 1. Add the first attribute certificate's dwLength value to the starting offset. /// 2. Round the value from step 1 up to the nearest 8-byte multiple to find the offset /// of the second attribute certificate entry. @@ -29,7 +29,7 @@ /// 4. Repeat step 3 for each successive certificate until the calculated offset equals /// 0x6000 (0x5000 start + 0x1000 total size), which indicates that you've walked /// the entire table. - /// + /// /// Attribute certificate table entries can contain any certificate type, as long as /// the entry has the correct dwLength value, a unique wRevision value, and a unique /// wCertificateType value. The most common type of certificate table entry is a @@ -58,6 +58,6 @@ /// Contains a certificate, such as an Authenticode signature. /// /// - public byte[]? Certificate { get; set; } + public byte[] Certificate { get; set; } } } diff --git a/SabreTools.Serialization/Models/PortableExecutable/LoadConfiguration/Directory.cs b/SabreTools.Serialization/Models/PortableExecutable/LoadConfiguration/Directory.cs index 070b22af..a1a3574c 100644 --- a/SabreTools.Serialization/Models/PortableExecutable/LoadConfiguration/Directory.cs +++ b/SabreTools.Serialization/Models/PortableExecutable/LoadConfiguration/Directory.cs @@ -36,7 +36,7 @@ /// /// The global loader flags to clear for this process as the loader starts - /// the process. + /// the process. /// public uint GlobalFlagsClear { get; set; } @@ -160,7 +160,7 @@ /// Code integrity information. /// /// 12 bytes - public byte[]? CodeIntegrity { get; set; } + public byte[] CodeIntegrity { get; set; } = new byte[12]; /// /// The VA where Control Flow Guard address taken IAT table is stored. diff --git a/SabreTools.Serialization/Models/PortableExecutable/Resource/DataEntry.cs b/SabreTools.Serialization/Models/PortableExecutable/Resource/DataEntry.cs index 88b9a37a..6caae450 100644 --- a/SabreTools.Serialization/Models/PortableExecutable/Resource/DataEntry.cs +++ b/SabreTools.Serialization/Models/PortableExecutable/Resource/DataEntry.cs @@ -24,7 +24,7 @@ /// /// The resource data that is pointed to by the Data RVA field. /// - public byte[]? Data { get; set; } + public byte[] Data { get; set; } /// /// The code page that is used to decode code point values within the diff --git a/SabreTools.Serialization/Models/PortableExecutable/Resource/DirectoryString.cs b/SabreTools.Serialization/Models/PortableExecutable/Resource/DirectoryString.cs index 3fdc4921..d1fec47a 100644 --- a/SabreTools.Serialization/Models/PortableExecutable/Resource/DirectoryString.cs +++ b/SabreTools.Serialization/Models/PortableExecutable/Resource/DirectoryString.cs @@ -18,6 +18,6 @@ /// /// The variable-length Unicode string data, word-aligned. /// - public byte[]? UnicodeString { get; set; } + public byte[] UnicodeString { get; set; } } } diff --git a/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/DialogItemTemplate.cs b/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/DialogItemTemplate.cs index 351f1e4b..22fe74f9 100644 --- a/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/DialogItemTemplate.cs +++ b/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/DialogItemTemplate.cs @@ -125,6 +125,6 @@ /// When the system creates the control, it passes a pointer to this data in the lParam parameter of the /// WM_CREATE message that it sends to the control. /// - public byte[]? CreationData { get; set; } + public byte[] CreationData { get; set; } } } diff --git a/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/DialogItemTemplateExtended.cs b/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/DialogItemTemplateExtended.cs index cd7a7310..b47f7c4d 100644 --- a/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/DialogItemTemplateExtended.cs +++ b/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/DialogItemTemplateExtended.cs @@ -76,7 +76,7 @@ /// A variable-length array of 16-bit elements that specifies the window class of the control. If /// the first element of this array is any value other than 0xFFFF, the system treats the array as /// a null-terminated Unicode string that specifies the name of a registered window class. - /// + /// /// If the first element is 0xFFFF, the array has one additional element that specifies the ordinal /// value of a predefined system class. /// @@ -123,6 +123,6 @@ /// When the system creates the control, it passes a pointer to this data in the lParam parameter of the /// WM_CREATE message that it sends to the control. /// - public byte[]? CreationData { get; set; } + public byte[] CreationData { get; set; } } } diff --git a/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/FontDirEntry.cs b/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/FontDirEntry.cs index 83d71f03..2d6d2e45 100644 --- a/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/FontDirEntry.cs +++ b/SabreTools.Serialization/Models/PortableExecutable/Resource/Entries/FontDirEntry.cs @@ -22,7 +22,7 @@ /// The font supplier's copyright information. /// /// 60 characters - public byte[]? Copyright { get; set; } + public byte[] Copyright { get; set; } = new byte[60]; /// /// The type of font file. diff --git a/SabreTools.Serialization/Models/SGA/Header4.cs b/SabreTools.Serialization/Models/SGA/Header4.cs index 59063225..71c79d19 100644 --- a/SabreTools.Serialization/Models/SGA/Header4.cs +++ b/SabreTools.Serialization/Models/SGA/Header4.cs @@ -3,11 +3,11 @@ namespace SabreTools.Data.Models.SGA /// public sealed class Header4 : Header { - public byte[]? FileMD5 { get; set; } + public byte[] FileMD5 { get; set; } = new byte[0x10]; public string? Name { get; set; } - public byte[]? HeaderMD5 { get; set; } + public byte[] HeaderMD5 { get; set; } = new byte[0x10]; public uint HeaderLength { get; set; } diff --git a/SabreTools.Serialization/Models/SafeDisc/EncryptedFileEntry.cs b/SabreTools.Serialization/Models/SafeDisc/EncryptedFileEntry.cs index 1b3d55a1..b20e2723 100644 --- a/SabreTools.Serialization/Models/SafeDisc/EncryptedFileEntry.cs +++ b/SabreTools.Serialization/Models/SafeDisc/EncryptedFileEntry.cs @@ -28,6 +28,6 @@ namespace SabreTools.Data.Models.SafeDisc /// 0x0D bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x0D)] - public byte[]? Name; + public byte[] Name = new byte[0x0D]; } } diff --git a/SabreTools.Serialization/Models/SecuROM/AddD.cs b/SabreTools.Serialization/Models/SecuROM/AddD.cs index bfbeaa4a..d9b64d62 100644 --- a/SabreTools.Serialization/Models/SecuROM/AddD.cs +++ b/SabreTools.Serialization/Models/SecuROM/AddD.cs @@ -36,7 +36,7 @@ /// Unknown /// /// 44 bytes - public byte[]? Unknown1 { get; set; } + public byte[] Unknown1 { get; set; } = new byte[44]; /// /// Product ID? @@ -52,7 +52,7 @@ /// /// 58 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 byte[]? Unknown2 { get; set; } + public byte[] Unknown2 { get; set; } = new byte[58]; /// /// Entry table diff --git a/SabreTools.Serialization/Models/SecuROM/DFAEntry.cs b/SabreTools.Serialization/Models/SecuROM/DFAEntry.cs index b4edb398..00dd2c14 100644 --- a/SabreTools.Serialization/Models/SecuROM/DFAEntry.cs +++ b/SabreTools.Serialization/Models/SecuROM/DFAEntry.cs @@ -17,8 +17,8 @@ namespace SabreTools.Data.Models.SecuROM public uint Length { get; set; } /// - /// Value of the entry whose length is given by + /// Value of the entry whose length is given by /// - public byte[]? Value { get; set; } + public byte[] Value { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/SecuROM/DFAFile.cs b/SabreTools.Serialization/Models/SecuROM/DFAFile.cs index f7ff9dd4..e4222881 100644 --- a/SabreTools.Serialization/Models/SecuROM/DFAFile.cs +++ b/SabreTools.Serialization/Models/SecuROM/DFAFile.cs @@ -11,7 +11,7 @@ namespace SabreTools.Data.Models.SecuROM /// "SDFA" 0x04 0x00 0x00 0x00 /// /// 8 bytes - public byte[]? Signature { get; set; } + public byte[] Signature { get; set; } = new byte[8]; /// /// Unknown value, possibly a block or header size @@ -24,4 +24,4 @@ namespace SabreTools.Data.Models.SecuROM /// public DFAEntry[]? Entries { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/SecuROM/MatroshkaEntry.cs b/SabreTools.Serialization/Models/SecuROM/MatroshkaEntry.cs index 7d64aace..3ee4c7f4 100644 --- a/SabreTools.Serialization/Models/SecuROM/MatroshkaEntry.cs +++ b/SabreTools.Serialization/Models/SecuROM/MatroshkaEntry.cs @@ -36,30 +36,30 @@ namespace SabreTools.Data.Models.SecuROM /// /// File modification time, stored in NTFS filetime. /// - /// + /// public ulong ModifiedTime { get; set; } /// /// File creation time, stored in NTFS filetime. /// - /// + /// public ulong CreatedTime { get; set; } /// /// File access time, stored in NTFS filetime. /// - /// + /// public ulong AccessedTime { get; set; } /// /// MD5 hash of the data /// /// 16 bytes - public byte[]? MD5 { get; set; } - + public byte[] MD5 { get; set; } = new byte[16]; + /// /// The file data, stored as a byte array /// - public byte[]? FileData { get; set; } + public byte[] FileData { get; set; } } } diff --git a/SabreTools.Serialization/Models/StarForce/FileEntry.cs b/SabreTools.Serialization/Models/StarForce/FileEntry.cs index 2bb0c466..93fa7e24 100644 --- a/SabreTools.Serialization/Models/StarForce/FileEntry.cs +++ b/SabreTools.Serialization/Models/StarForce/FileEntry.cs @@ -11,7 +11,7 @@ namespace SabreTools.Data.Models.StarForce /// /// 0x10 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)] - public byte[]? FilenameMD5Hash; + public byte[] FilenameMD5Hash = new byte[0x10]; /// /// Index of fileheader (encrypted with filename) diff --git a/SabreTools.Serialization/Models/StarForce/FileHeader.cs b/SabreTools.Serialization/Models/StarForce/FileHeader.cs index 4e92b2f1..4b74da05 100644 --- a/SabreTools.Serialization/Models/StarForce/FileHeader.cs +++ b/SabreTools.Serialization/Models/StarForce/FileHeader.cs @@ -12,6 +12,6 @@ /// File info (timestamps, size, data position, encrypted) /// /// Unknown format - public byte[]? FileInfo { get; set; } + public byte[]FileInfo { get; set; } } } diff --git a/SabreTools.Serialization/Models/TAR/Block.cs b/SabreTools.Serialization/Models/TAR/Block.cs index abe664af..a363bf17 100644 --- a/SabreTools.Serialization/Models/TAR/Block.cs +++ b/SabreTools.Serialization/Models/TAR/Block.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.TAR /// Data /// /// 512 bytes - public byte[]? Data { get; set; } + public byte[] Data { get; set; } = new byte[512]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/VPK/ArchiveHash.cs b/SabreTools.Serialization/Models/VPK/ArchiveHash.cs index 9737f4b0..d16442f5 100644 --- a/SabreTools.Serialization/Models/VPK/ArchiveHash.cs +++ b/SabreTools.Serialization/Models/VPK/ArchiveHash.cs @@ -16,6 +16,6 @@ namespace SabreTools.Data.Models.VPK /// MD5 /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x10)] - public byte[]? Hash; + public byte[] Hash = new byte[0x10]; } } diff --git a/SabreTools.Serialization/Models/VPK/ArchiveMD5SectionEntry.cs b/SabreTools.Serialization/Models/VPK/ArchiveMD5SectionEntry.cs index 43525244..2357b055 100644 --- a/SabreTools.Serialization/Models/VPK/ArchiveMD5SectionEntry.cs +++ b/SabreTools.Serialization/Models/VPK/ArchiveMD5SectionEntry.cs @@ -22,6 +22,6 @@ namespace SabreTools.Data.Models.VPK /// Expected checksum /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[]? MD5Checksum = new byte[16]; + public byte[]MD5Checksum = new byte[16]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/VPK/DirectoryItem.cs b/SabreTools.Serialization/Models/VPK/DirectoryItem.cs index c0a1a80a..3e416401 100644 --- a/SabreTools.Serialization/Models/VPK/DirectoryItem.cs +++ b/SabreTools.Serialization/Models/VPK/DirectoryItem.cs @@ -12,6 +12,6 @@ namespace SabreTools.Data.Models.VPK public DirectoryEntry? DirectoryEntry { get; set; } - public byte[]? PreloadData { get; set; } + public byte[] PreloadData { get; set; } } } diff --git a/SabreTools.Serialization/Models/VPK/OtherMD5Section.cs b/SabreTools.Serialization/Models/VPK/OtherMD5Section.cs index 9906e987..b267e41d 100644 --- a/SabreTools.Serialization/Models/VPK/OtherMD5Section.cs +++ b/SabreTools.Serialization/Models/VPK/OtherMD5Section.cs @@ -7,12 +7,12 @@ namespace SabreTools.Data.Models.VPK public sealed class OtherMD5Section { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[]? TreeChecksum = new byte[16]; + public byte[] TreeChecksum = new byte[16]; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[]? ArchiveMD5SectionChecksum = new byte[16]; + public byte[] ArchiveMD5SectionChecksum = new byte[16]; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - public byte[]? WholeFileChecksum = new byte[16]; + public byte[] WholeFileChecksum = new byte[16]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/VPK/SignatureSection.cs b/SabreTools.Serialization/Models/VPK/SignatureSection.cs index 18300542..412ecc1d 100644 --- a/SabreTools.Serialization/Models/VPK/SignatureSection.cs +++ b/SabreTools.Serialization/Models/VPK/SignatureSection.cs @@ -12,9 +12,9 @@ namespace SabreTools.Data.Models.VPK public uint PublicKeySize; /// - /// + /// /// - public byte[]? PublicKey; + public byte[] PublicKey; /// /// Always seen as 128 (0x80) bytes @@ -22,8 +22,8 @@ namespace SabreTools.Data.Models.VPK public uint SignatureSize; /// - /// + /// /// - public byte[]? Signature; + public byte[] Signature; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/WiseInstaller/Actions/CopyLocalFile.cs b/SabreTools.Serialization/Models/WiseInstaller/Actions/CopyLocalFile.cs index fda180e8..81757325 100644 --- a/SabreTools.Serialization/Models/WiseInstaller/Actions/CopyLocalFile.cs +++ b/SabreTools.Serialization/Models/WiseInstaller/Actions/CopyLocalFile.cs @@ -2,12 +2,12 @@ namespace SabreTools.Data.Models.WiseInstaller.Actions { /// /// Copy Local File - /// + /// /// This action copies uncompressed files from a floppy disk, CD, the destination computer, /// or a network drive. /// - /// - /// + /// + /// public class CopyLocalFile : MachineStateData { /// @@ -20,9 +20,9 @@ namespace SabreTools.Data.Models.WiseInstaller.Actions /// /// /// 40 bytes, padding because structure is internally - /// shared with + /// shared with /// - public byte[]? Padding { get; set; } // 0x02 - 0x2A + public byte[] Padding { get; set; } = new byte[40]; // 0x02 - 0x2A /// /// Destination path diff --git a/SabreTools.Serialization/Models/WiseInstaller/Actions/InstallFile.cs b/SabreTools.Serialization/Models/WiseInstaller/Actions/InstallFile.cs index 07bfd8fd..76f62ffb 100644 --- a/SabreTools.Serialization/Models/WiseInstaller/Actions/InstallFile.cs +++ b/SabreTools.Serialization/Models/WiseInstaller/Actions/InstallFile.cs @@ -2,7 +2,7 @@ namespace SabreTools.Data.Models.WiseInstaller.Actions { /// /// Install File - /// + /// /// This action installs files on the destination computer. Each file or directory to be installed /// must have a separate Install File(s) action. /// @@ -12,7 +12,7 @@ namespace SabreTools.Data.Models.WiseInstaller.Actions /// Wildcards have been observed in a few examples to denote /// entire directories or subdirectories being copied. /// - /// + /// public class InstallFile : MachineStateData { /// @@ -26,9 +26,9 @@ namespace SabreTools.Data.Models.WiseInstaller.Actions /// - Self-Register OCX/DLL/EXE/TLB (unknown) /// - Replace Existing File [Always, Never, Check File [Doesn't Matter, Same or Older, Older]] (unknown) /// - Retain Duplicates in Path (unknown) - /// + /// /// This is two separate fields in WISE0001.DLL (bVar1 and bVar2) - /// + /// /// if (bVar2 & 0x48) == 0 && (bVar1 & 0x40) == 0 /// Checksum set? Verify the file if possible /// if (bVar1 & 1) != 0 && action[0x13] != 0 @@ -73,7 +73,7 @@ namespace SabreTools.Data.Models.WiseInstaller.Actions /// 0x1F (4 bytes) - local_68.Control /// 0x23 (4 bytes) - local_68.Privilege[0].Luid.LowPart /// - public byte[]? Operand_7 { get; set; } // 0x13 - 0x26 + public byte[] Operand_7 { get; set; } = new byte[20]; // 0x13 - 0x26 /// /// CRC-32 checksum of the data @@ -95,7 +95,7 @@ namespace SabreTools.Data.Models.WiseInstaller.Actions /// Source file /// /// - /// Unused because structure is internally shared with + /// Unused because structure is internally shared with /// public string? Source { get; set; } } diff --git a/SabreTools.Serialization/Models/WiseInstaller/Actions/NewEvent.cs b/SabreTools.Serialization/Models/WiseInstaller/Actions/NewEvent.cs index 630786f4..9545aa4c 100644 --- a/SabreTools.Serialization/Models/WiseInstaller/Actions/NewEvent.cs +++ b/SabreTools.Serialization/Models/WiseInstaller/Actions/NewEvent.cs @@ -2,37 +2,37 @@ namespace SabreTools.Data.Models.WiseInstaller.Actions { /// /// New Event - /// + /// /// Event scripts handle events. (Example: The end user cancels the installation.) - /// + /// /// Mainline - /// + /// /// The primary script that’s executed during the normal installation process. It /// contains placeholders for Cancel and Exit scripts. When you open a script, that script /// is considered the “main installation script,” and is on the first tab below the /// installation script. - /// + /// /// Exit - /// + /// /// The script that’s executed when the installation is complete, or when an Exit /// Installation script command is executed. If you create a user-defined action, you /// store its custom dialog box here. - /// + /// /// Cancel - /// + /// /// The script that’s executed when the end user cancels the installation. Because some /// files might already be installed when the end user cancels, the Cancel script /// contains the include script, rollback.wse, which returns the destination computer to /// its pre-installation state. /// - /// - /// + /// + /// public class NewEvent : MachineStateData { /// /// Padding bytes /// /// Either 0 or 6 bytes from samples - public byte[]? Padding { get; set; } + public byte[] Padding { get; set; } } } diff --git a/SabreTools.Serialization/Models/WiseInstaller/OverlayHeader.cs b/SabreTools.Serialization/Models/WiseInstaller/OverlayHeader.cs index d7fd9685..38420522 100644 --- a/SabreTools.Serialization/Models/WiseInstaller/OverlayHeader.cs +++ b/SabreTools.Serialization/Models/WiseInstaller/OverlayHeader.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.WiseInstaller /// /// Wise installer overlay data header /// - /// + /// public class OverlayHeader { /// @@ -12,12 +12,12 @@ namespace SabreTools.Data.Models.WiseInstaller public byte DllNameLen { get; set; } // 0x00 /// - /// DLL name, missing if is 0 + /// DLL name, missing if is 0 /// - public string? DllName { get; set; } // + public string? DllName { get; set; } // /// - /// DLL size, missing if is 0 + /// DLL size, missing if is 0 /// public uint? DllSize { get; set; } // @@ -31,12 +31,12 @@ namespace SabreTools.Data.Models.WiseInstaller /// /// /// 12 bytes - /// + /// /// When the data is processed, it does the following: - /// + /// /// ushort[] colors = new ushort[3]; /// int colorsPtr = 0; - /// + /// /// for (int i = 0; i < 3; i++) /// { /// uint color = (GraphicsData[i + 3] * ) / 0x5F + GraphicsData[i]; @@ -45,11 +45,11 @@ namespace SabreTools.Data.Models.WiseInstaller /// colors[colorsPtr] = 0; /// if (colors[colorsPtr] > 0xFF) /// colors[colorsPtr] = 0xFF - /// + /// /// colorsPtr++; /// } /// - public byte[]? GraphicsData { get; set; } // 0x05 - 0x10 + public byte[] GraphicsData { get; set; } = new byte[12]; // 0x05 - 0x10 /// /// Points to the Exit event in the script, if it exists @@ -175,8 +175,8 @@ namespace SabreTools.Data.Models.WiseInstaller public byte InitTextLen { get; set; } // 0x63 /// - /// Init text whose length is given by + /// Init text whose length is given by /// - public string? InitText { get; set; } // 0x64 - + public string? InitText { get; set; } // 0x64 - } } diff --git a/SabreTools.Serialization/Models/WiseInstaller/ScriptHeader.cs b/SabreTools.Serialization/Models/WiseInstaller/ScriptHeader.cs index 232fbe32..65b0dc3f 100644 --- a/SabreTools.Serialization/Models/WiseInstaller/ScriptHeader.cs +++ b/SabreTools.Serialization/Models/WiseInstaller/ScriptHeader.cs @@ -3,7 +3,7 @@ namespace SabreTools.Data.Models.WiseInstaller /// /// Header for the Wise script /// - /// + /// public class ScriptHeader { /// @@ -21,7 +21,7 @@ namespace SabreTools.Data.Models.WiseInstaller /// /// Read in a loop with , possibly /// an offset? It's read into an array. - /// + /// /// Both values are then used to build variable names if they're /// non-zero. The variable names use "SYS" as the template. /// The values are then seemingly read over? @@ -34,7 +34,7 @@ namespace SabreTools.Data.Models.WiseInstaller /// /// Read in a loop with , possibly /// an offset? It's read into an array. - /// + /// /// Both values are then used to build variable names if they're /// non-zero. The variable names use "SYS" as the template. /// The values are then seemingly read over? @@ -48,7 +48,7 @@ namespace SabreTools.Data.Models.WiseInstaller /// This seems to match the offset we can do filesize - SomeOffset1 /// to get to the script file deflate offset, but not on all /// installers.. - /// + /// /// Values from WISE0001.DLL /// - < 0 - Display abort installation message and return 1? /// - 0x400 - Breaks a loop? @@ -69,13 +69,13 @@ namespace SabreTools.Data.Models.WiseInstaller /// /// /// 4 bytes - /// + /// /// In WISE0001.DLL, the first byte of this array is checked /// to be 0x00. If it's not 0x00, then it skips a string, ending /// at the next null terminator. The string at that offset is /// then comapred to ... /// - public byte[]? UnknownBytes_2 { get; set; } + public byte[] UnknownBytes_2 { get; set; } = new byte[4]; /// /// Creation of this WiseScript.bin since UNIX epoch @@ -94,7 +94,7 @@ namespace SabreTools.Data.Models.WiseInstaller /// - 22 - Normal header data, all fields present /// - 31 - Long header data, all fields present /// - public byte[]? VariableLengthData { get; set; } + public byte[] VariableLengthData { get; set; } /// /// FTP URL for online downloading @@ -120,7 +120,7 @@ namespace SabreTools.Data.Models.WiseInstaller /// Unknown /// /// 2 bytes - public byte[]? Unknown_2 { get; set; } + public byte[] Unknown_2 { get; set; } = new byte[2]; /// /// if languageCount > 1: the total string count is larger, there @@ -165,7 +165,7 @@ namespace SabreTools.Data.Models.WiseInstaller /// /// All strings in the aheader /// - /// See the remarks in + /// See the remarks in public string[]? HeaderStrings { get; set; } } } diff --git a/SabreTools.Serialization/Models/WiseInstaller/SectionHeader.cs b/SabreTools.Serialization/Models/WiseInstaller/SectionHeader.cs index 6e59a325..17277137 100644 --- a/SabreTools.Serialization/Models/WiseInstaller/SectionHeader.cs +++ b/SabreTools.Serialization/Models/WiseInstaller/SectionHeader.cs @@ -4,18 +4,18 @@ namespace SabreTools.Data.Models.WiseInstaller /// .WISE sections seem to be present in what virustotal calls "Self Extracting Wise Installer"s. These sections /// contain a header with anywhere from seven to nineteen 4-byte little-endian values, followed by what's possibly /// a version number, then string data, and then the file entries. - /// + /// /// At some point in the header, there will be the characters "WIS" prepended by what seems to be a version number. /// This possible version number will be referred to from here on as just "version number", as it would be overly /// verbose to continue using "what is possibly a version number". - /// + /// /// The WIS characters do not always align with a specific offset if the header is broken up by 4-byte blocks, and /// the version number seems to maintain this offset. It is currently unknown if the version number is 4 bytes long /// or five bytes long, it seems to vary. - /// + /// /// Offsets of the "W" in the "WIS" string currently observed are 32, 33, 41, 77, 78, and 82. This seems to point to /// 4-6 known header lengths, depending on the deal with the version number/WIS offset. - /// + /// /// Before the version number, there are anywhere from seven to nineteen 4-byte little-endian values depending on /// the length of the pre-string part of the header. These values will be described indexed from zero (0-18). The /// only one of these values that's ever guaranteed not to be all 0x00 is value 6. This is the size of the "main" @@ -25,7 +25,7 @@ namespace SabreTools.Data.Models.WiseInstaller /// followed by .msi, with some examples including 2fbcb.msi and ddec.msi, serve as the filename. Name is random /// even when re-running the same installer) thus far. In many installers, all other pre-version values are 0x00, /// so this is the only guaranteed value. - /// + /// /// All values not explicitly mentioned to never have been observed have been observed in at least one installer /// thus far. /// @@ -136,18 +136,18 @@ namespace SabreTools.Data.Models.WiseInstaller /// /// Byte array representing version. Byte array used due to unknown size and type for version. /// - public byte[]? Version { get; set; } - + public byte[] Version { get; set; } + /// /// String representing the WIS[etc].TMP string /// public string? TmpString { get; set; } - + /// /// String representing the GUID string. /// public string? GuidString { get; set; } - + /// /// String representing a version number. This isn't the version of the .WISE installer itself, as it is /// entirely inconsistent even within the same week. Likely refers to a version for what's being installed @@ -159,18 +159,18 @@ namespace SabreTools.Data.Models.WiseInstaller /// Unknown. May also refer to a non-value for pre-78-offset executables and only a value for 78-offset-onwards /// ones. /// - public byte[]? PreFontValue {get; set;} - + public byte[] PreFontValue {get; set;} + /// /// Font size /// public int FontSize { get; set; } - + /// /// Byte array representing string lengths and info. Individual strings not predefined since number of strings /// will likely vary between many installers. /// - public byte[]? PreStringValues { get; set; } + public byte[] PreStringValues { get; set; } /// /// Strings for the section. Size and any breakup of strings currently unknown. diff --git a/SabreTools.Serialization/Models/XZ/Block.cs b/SabreTools.Serialization/Models/XZ/Block.cs index 904637a2..0647d091 100644 --- a/SabreTools.Serialization/Models/XZ/Block.cs +++ b/SabreTools.Serialization/Models/XZ/Block.cs @@ -21,14 +21,14 @@ namespace SabreTools.Data.Models.XZ /// /// Size of the compressed data - /// Present if is set. + /// Present if is set. /// /// Stored as a variable-length integer public ulong CompressedSize { get; set; } /// /// Size of the block after decompression - /// Present if is set. + /// Present if is set. /// /// Stored as a variable-length integer public ulong UncompressedSize { get; set; } @@ -38,7 +38,7 @@ namespace SabreTools.Data.Models.XZ /// /// /// The number of filter flags is given by the first two - /// bits of + /// bits of /// public FilterFlag[]? FilterFlags { get; set; } @@ -46,12 +46,12 @@ namespace SabreTools.Data.Models.XZ /// This field contains as many null byte as it is needed to make /// the Block Header have the size specified in Block Header Size. /// - public byte[]? HeaderPadding { get; set; } + public byte[] HeaderPadding { get; set; } /// /// The CRC32 is calculated over everything in the Block Header /// field except the CRC32 field itself. It is stored as an - /// unsigned 32-bit little endian integer. + /// unsigned 32-bit little endian integer. /// public uint Crc32 { get; set; } @@ -59,22 +59,22 @@ namespace SabreTools.Data.Models.XZ /// The format of Compressed Data depends on Block Flags and List /// of Filter Flags /// - public byte[]? CompressedData { get; set; } + public byte[] CompressedData { get; set; } /// /// Block Padding MUST contain 0-3 null bytes to make the size of /// the Block a multiple of four bytes. This can be needed when /// the size of Compressed Data is not a multiple of four. /// - public byte[]? BlockPadding { get; set; } + public byte[] BlockPadding { get; set; } /// /// The type and size of the Check field depends on which bits /// are set in the Stream Flags field. - /// + /// /// The Check, when used, is calculated from the original /// uncompressed data. /// - public byte[]? Check { get; set; } + public byte[] Check { get; set; } } } diff --git a/SabreTools.Serialization/Models/XZ/FilterFlags.cs b/SabreTools.Serialization/Models/XZ/FilterFlags.cs index 170437b6..a9622acc 100644 --- a/SabreTools.Serialization/Models/XZ/FilterFlags.cs +++ b/SabreTools.Serialization/Models/XZ/FilterFlags.cs @@ -16,8 +16,8 @@ namespace SabreTools.Data.Models.XZ /// /// Properties of the filter whose length is given by - /// + /// /// - public byte[]? Properties { get; set; } + public byte[] Properties { get; set; } } } diff --git a/SabreTools.Serialization/Models/XZ/Footer.cs b/SabreTools.Serialization/Models/XZ/Footer.cs index 0ef86d18..64ed09cb 100644 --- a/SabreTools.Serialization/Models/XZ/Footer.cs +++ b/SabreTools.Serialization/Models/XZ/Footer.cs @@ -34,6 +34,6 @@ namespace SabreTools.Data.Models.XZ /// Header magic number ("YZ") /// /// 2 bytes - public byte[]? Signature { get; set; } + public byte[] Signature { get; set; } = new byte[2]; } } diff --git a/SabreTools.Serialization/Models/XZ/Header.cs b/SabreTools.Serialization/Models/XZ/Header.cs index 40eb935a..a7819110 100644 --- a/SabreTools.Serialization/Models/XZ/Header.cs +++ b/SabreTools.Serialization/Models/XZ/Header.cs @@ -9,7 +9,7 @@ namespace SabreTools.Data.Models.XZ /// Header magic number (0xFD, '7', 'z', 'X', 'Z', 0x00) /// /// 6 bytes - public byte[]? Signature { get; set; } + public byte[] Signature { get; set; } = new byte[6]; /// /// The first byte of Stream Flags is always a null byte. In the diff --git a/SabreTools.Serialization/Models/XZ/Index.cs b/SabreTools.Serialization/Models/XZ/Index.cs index 53bf1fae..d8ad153f 100644 --- a/SabreTools.Serialization/Models/XZ/Index.cs +++ b/SabreTools.Serialization/Models/XZ/Index.cs @@ -24,7 +24,7 @@ namespace SabreTools.Data.Models.XZ /// This field MUST contain 0-3 null bytes to pad the Index to /// a multiple of four bytes. /// - public byte[]? Padding { get; set; } + public byte[] Padding { get; set; } /// /// The CRC32 is calculated over everything in the Index field diff --git a/SabreTools.Serialization/Models/ZSTD/Header.cs b/SabreTools.Serialization/Models/ZSTD/Header.cs index ac45d0cc..96ebd2d6 100644 --- a/SabreTools.Serialization/Models/ZSTD/Header.cs +++ b/SabreTools.Serialization/Models/ZSTD/Header.cs @@ -17,6 +17,6 @@ namespace SabreTools.Data.Models.ZSTD /// /// "0x?? 0xB5 0x2F 0xFD" /// - public byte[]? Magic; + public byte[] Magic = new byte[3]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Readers/BaseBinaryDeserializer.cs b/SabreTools.Serialization/Readers/BaseBinaryDeserializer.cs index e36fa695..64560773 100644 --- a/SabreTools.Serialization/Readers/BaseBinaryDeserializer.cs +++ b/SabreTools.Serialization/Readers/BaseBinaryDeserializer.cs @@ -9,7 +9,7 @@ namespace SabreTools.Serialization.Readers /// Type of the model to deserialize /// /// This class allows all inheriting types to only implement - /// and still implicitly implement and + /// and still implicitly implement and /// public abstract class BaseBinaryReader : IByteReader, diff --git a/SabreTools.Serialization/Wrappers/ISO9660.cs b/SabreTools.Serialization/Wrappers/ISO9660.cs index 19e2c593..b2626ea9 100644 --- a/SabreTools.Serialization/Wrappers/ISO9660.cs +++ b/SabreTools.Serialization/Wrappers/ISO9660.cs @@ -16,16 +16,16 @@ namespace SabreTools.Serialization.Wrappers #region Extension Properties /// - public byte[] SystemArea => Model.SystemArea ?? []; + public byte[] SystemArea => Model.SystemArea; /// - public VolumeDescriptor[] VolumeDescriptorSet => Model.VolumeDescriptorSet ?? []; + public VolumeDescriptor[] VolumeDescriptorSet => Model.VolumeDescriptorSet; /// - public PathTableGroup[] PathTableGroups => Model.PathTableGroups ?? []; + public PathTableGroup[] PathTableGroups => Model.PathTableGroups; /// - public Dictionary DirectoryDescriptors => Model.DirectoryDescriptors ?? []; + public Dictionary DirectoryDescriptors => Model.DirectoryDescriptors; #endregion diff --git a/SabreTools.Serialization/Wrappers/InstallShieldCabinet.Extraction.cs b/SabreTools.Serialization/Wrappers/InstallShieldCabinet.Extraction.cs index af340be0..d7806875 100644 --- a/SabreTools.Serialization/Wrappers/InstallShieldCabinet.Extraction.cs +++ b/SabreTools.Serialization/Wrappers/InstallShieldCabinet.Extraction.cs @@ -389,7 +389,7 @@ namespace SabreTools.Serialization.Wrappers // Validate the data written, if required if (MajorVersion >= 6) { - string expectedMd5 = BitConverter.ToString(fileDescriptor.MD5!); + string expectedMd5 = BitConverter.ToString(fileDescriptor.MD5); expectedMd5 = expectedMd5.ToLowerInvariant().Replace("-", string.Empty); string? actualMd5 = md5.CurrentHashString; diff --git a/SabreTools.Serialization/Wrappers/Nitro.cs b/SabreTools.Serialization/Wrappers/Nitro.cs index 1cc1ff91..ca5bfed0 100644 --- a/SabreTools.Serialization/Wrappers/Nitro.cs +++ b/SabreTools.Serialization/Wrappers/Nitro.cs @@ -21,7 +21,7 @@ namespace SabreTools.Serialization.Wrappers public uint GameCode => Model.CommonHeader?.GameCode ?? 0; /// - public byte[]? SecureArea => Model.SecureArea; + public byte[] SecureArea => Model.SecureArea; #endregion diff --git a/SabreTools.Serialization/Wrappers/PortableExecutable.cs b/SabreTools.Serialization/Wrappers/PortableExecutable.cs index ee62c858..02c2fead 100644 --- a/SabreTools.Serialization/Wrappers/PortableExecutable.cs +++ b/SabreTools.Serialization/Wrappers/PortableExecutable.cs @@ -244,7 +244,7 @@ namespace SabreTools.Serialization.Wrappers SectionHeader? section = null; foreach (var searchedSection in SectionTable) { - string sectionName = Encoding.ASCII.GetString(searchedSection.Name ?? []).TrimEnd('\0'); + string sectionName = Encoding.ASCII.GetString(searchedSection.Name).TrimEnd('\0'); if (sectionName != "matrosch" && sectionName != "rcpacker") continue; @@ -521,12 +521,8 @@ namespace SabreTools.Serialization.Wrappers { // TODO: Handle long section names with leading `/` var section = SectionTable[i]; - byte[]? sectionNameBytes = section.Name; - if (sectionNameBytes != null) - { - string sectionNameString = Encoding.UTF8.GetString(sectionNameBytes).TrimEnd('\0'); - _sectionNames[i] = sectionNameString; - } + string sectionNameString = Encoding.UTF8.GetString(section.Name).TrimEnd('\0'); + _sectionNames[i] = sectionNameString; } return _sectionNames; @@ -667,7 +663,7 @@ namespace SabreTools.Serialization.Wrappers SectionHeader? wiseSection = null; foreach (var section in SectionTable) { - string sectionName = Encoding.ASCII.GetString(section.Name ?? []).TrimEnd('\0'); + string sectionName = Encoding.ASCII.GetString(section.Name).TrimEnd('\0'); if (sectionName != ".WISE") continue; @@ -1615,7 +1611,7 @@ namespace SabreTools.Serialization.Wrappers // Check section data foreach (var section in SectionTable ?? []) { - string sectionName = Encoding.ASCII.GetString(section.Name ?? []).TrimEnd('\0'); + string sectionName = Encoding.ASCII.GetString(section.Name).TrimEnd('\0'); long sectionOffset = section.VirtualAddress.ConvertVirtualAddress(SectionTable); _dataSource.SeekIfPossible(sectionOffset, SeekOrigin.Begin); diff --git a/SabreTools.Serialization/Wrappers/WiseSectionHeader.cs b/SabreTools.Serialization/Wrappers/WiseSectionHeader.cs index e227aa69..572e5d74 100644 --- a/SabreTools.Serialization/Wrappers/WiseSectionHeader.cs +++ b/SabreTools.Serialization/Wrappers/WiseSectionHeader.cs @@ -83,10 +83,10 @@ namespace SabreTools.Serialization.Wrappers public uint UnknownValue18 => Model.UnknownValue18; /// - public byte[]? Version => Model.Version; + public byte[] Version => Model.Version; /// - public byte[]? PreStringValues => Model.PreStringValues; + public byte[] PreStringValues => Model.PreStringValues; /// public byte[][]? Strings => Model.Strings; diff --git a/SabreTools.Serialization/Wrappers/ZSTD.cs b/SabreTools.Serialization/Wrappers/ZSTD.cs index 67a619fe..b39a6b3c 100644 --- a/SabreTools.Serialization/Wrappers/ZSTD.cs +++ b/SabreTools.Serialization/Wrappers/ZSTD.cs @@ -1,6 +1,5 @@ using System.IO; using SabreTools.Data.Models.ZSTD; -using SabreTools.IO.Extensions; namespace SabreTools.Serialization.Wrappers { @@ -12,14 +11,14 @@ namespace SabreTools.Serialization.Wrappers public override string DescriptionString => "ZSTD file"; #endregion - + #region Extension Properties /// public byte VersionByte => Model.VersionByte; - + /// - public byte[]? Magic => Model.Magic; + public byte[] Magic => Model.Magic; #endregion