From 0e23d131fef8aa254e9daa7bceff4cea20145c78 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 4 Sep 2023 21:14:41 -0400 Subject: [PATCH] Fix warnings from nullabilty --- AACS/CopyrightRecord.cs | 4 + AACS/DriveRevocationListEntry.cs | 4 + AACS/DriveRevocationListRecord.cs | 4 + AACS/DriveRevocationSignatureBlock.cs | 4 + AACS/EndOfMediaKeyBlockRecord.cs | 4 + AACS/ExplicitSubsetDifferenceRecord.cs | 4 + AACS/HostRevocationListEntry.cs | 4 + AACS/HostRevocationListRecord.cs | 4 + AACS/HostRevocationSignatureBlock.cs | 4 + AACS/MediaKeyBlock.cs | 4 + AACS/MediaKeyDataRecord.cs | 4 + AACS/SubsetDifferenceIndexRecord.cs | 4 + AACS/VerifyMediaKeyRecord.cs | 4 + BDPlus/SVM.cs | 16 + BFPK/Archive.cs | 8 + BFPK/FileEntry.cs | 4 + BFPK/Header.cs | 4 + BSP/File.cs | 16 + BSP/Texture.cs | 16 + BSP/TextureHeader.cs | 4 + CFB/Binary.cs | 20 ++ CFB/DirectoryEntry.cs | 4 + CFB/FileHeader.cs | 8 + CFB/SummaryInformation.cs | 12 + CFB/Variant.cs | 4 + Compression/LZ/FileHeader.cs | 4 + Compression/LZ/State.cs | 12 + Compression/LZX/AlignedOffsetBlock.cs | 32 ++ Compression/LZX/UncompressedBlock.cs | 8 + Compression/LZX/VerbatimBlock.cs | 28 ++ .../DynamicHuffmanCompressedBlockHeader.cs | 8 + .../FixedHuffmanCompressedBlockHeader.cs | 16 + Compression/Quantum/Model.cs | 8 + DVD/AudioSubPictureAttributesTable.cs | 12 + DVD/AudioSubPictureAttributesTableEntry.cs | 4 + DVD/CellAddressTable.cs | 8 + DVD/LanguageUnitTable.cs | 12 + DVD/ParentalManagementMasksTable.cs | 8 + DVD/ParentalManagementMasksTableEntry.cs | 4 + DVD/ProgramChainTable.cs | 8 + DVD/TitlesTable.cs | 8 + DVD/VOBUAddressMap.cs | 4 + DVD/VideoManagerIFO.cs | 28 ++ DVD/VideoTitleSetIFO.cs | 28 ++ GCF/DirectoryEntry.cs | 4 + GCF/File.cs | 84 +++++ InstallShieldCabinet/Cabinet.cs | 40 +++ InstallShieldCabinet/CommonHeader.cs | 4 + InstallShieldCabinet/Component.cs | 32 ++ InstallShieldCabinet/Descriptor.cs | 44 +++ InstallShieldCabinet/FileDescriptor.cs | 8 + InstallShieldCabinet/FileGroup.cs | 36 ++ InstallShieldCabinet/OffsetList.cs | 4 + LinearExecutable/DebugInformation.cs | 8 + LinearExecutable/EntryTableBundle.cs | 4 + LinearExecutable/Executable.cs | 64 ++++ LinearExecutable/FixupRecordTableEntry.cs | 4 + .../ImportModuleNameTableEntry.cs | 4 + .../ImportProcedureNameTableEntry.cs | 4 + LinearExecutable/InformationBlock.cs | 4 + .../NonResidentNamesTableEntry.cs | 4 + LinearExecutable/ResidentNamesTableEntry.cs | 4 + MSDOS/Executable.cs | 8 + MSDOS/ExecutableHeader.cs | 12 + MicrosoftCabinet/CFDATA.cs | 8 + MicrosoftCabinet/CFFILE.cs | 4 + MicrosoftCabinet/CFFOLDER.cs | 8 + MicrosoftCabinet/CFHEADER.cs | 24 ++ MicrosoftCabinet/Cabinet.cs | 12 + MoPaQ/Archive.cs | 28 ++ MoPaQ/ArchiveHeader.cs | 28 ++ MoPaQ/BetTable.cs | 8 + MoPaQ/HetTable.cs | 12 + MoPaQ/PatchHeader.cs | 12 + MoPaQ/PatchInfo.cs | 8 + MoPaQ/UserData.cs | 4 + N3DS/ARM11KernelCapabilities.cs | 8 + N3DS/ARM11LocalSystemCapabilities.cs | 20 ++ N3DS/ARM9AccessControl.cs | 4 + N3DS/AccessControlInfo.cs | 12 + N3DS/CIA.cs | 28 ++ N3DS/CIAHeader.cs | 4 + N3DS/CardInfoHeader.cs | 20 ++ N3DS/Cart.cs | 28 ++ N3DS/Certificate.cs | 32 ++ N3DS/ContentChunkRecord.cs | 4 + N3DS/ContentInfoRecord.cs | 4 + N3DS/DevelopmentCardInfoHeader.cs | 20 ++ N3DS/ExeFSFileHeader.cs | 8 + N3DS/ExeFSHeader.cs | 12 + N3DS/InitialData.cs | 24 ++ N3DS/MetaData.cs | 16 + N3DS/NCCHExtendedHeader.cs | 20 ++ N3DS/NCCHHeader.cs | 52 +++ N3DS/NCSDHeader.cs | 48 +++ N3DS/RomFSHeader.cs | 20 ++ N3DS/StorageInfo.cs | 12 + N3DS/SystemControlInfo.cs | 32 ++ N3DS/SystemInfo.cs | 4 + N3DS/TestData.cs | 36 ++ N3DS/Ticket.cs | 48 +++ N3DS/TitleMetadata.cs | 40 +++ NCF/DirectoryEntry.cs | 4 + NCF/File.cs | 56 +++ NewExecutable/Executable.cs | 36 ++ NewExecutable/ExecutableHeader.cs | 4 + NewExecutable/ImportedNameTableEntry.cs | 4 + NewExecutable/NonResidentNameTableEntry.cs | 4 + NewExecutable/PerSegmentData.cs | 4 + NewExecutable/RelocationRecord.cs | 16 + NewExecutable/ResidentNameTableEntry.cs | 4 + NewExecutable/ResourceTable.cs | 8 + NewExecutable/ResourceTypeAndNameString.cs | 4 + NewExecutable/ResourceTypeInformationEntry.cs | 4 + Nitro/Cart.cs | 20 ++ Nitro/CommonHeader.cs | 28 ++ Nitro/ExtendedDSiHeader.cs | 72 ++++ Nitro/NameListEntry.cs | 4 + Nitro/NameTable.cs | 8 + PAK/DirectoryItem.cs | 4 + PAK/File.cs | 8 + PAK/Header.cs | 4 + PFF/Archive.cs | 12 + PFF/Footer.cs | 4 + PFF/Header.cs | 4 + PFF/Segment.cs | 4 + PlayJ/AudioFile.cs | 16 + PlayJ/AudioHeader.cs | 28 ++ PlayJ/DataFile.cs | 8 + PlayJ/Playlist.cs | 8 + PlayJ/PlaylistHeader.cs | 4 + PlayJ/UnknownBlock1.cs | 4 + PlayJ/UnknownBlock3.cs | 4 + PortableExecutable/AssemblyManifest.cs | 328 ++++++++++++++++++ .../AttributeCertificateTableEntry.cs | 4 + PortableExecutable/BaseRelocationBlock.cs | 4 + PortableExecutable/COFFStringTable.cs | 4 + PortableExecutable/COFFSymbolTableEntry.cs | 24 ++ PortableExecutable/CursorAndIconResource.cs | 4 + PortableExecutable/DebugTable.cs | 4 + PortableExecutable/DialogBoxResource.cs | 16 + PortableExecutable/DialogItemTemplate.cs | 12 + .../DialogItemTemplateExtended.cs | 12 + PortableExecutable/DialogTemplate.cs | 16 + PortableExecutable/DialogTemplateExtended.cs | 16 + PortableExecutable/DirEntry.cs | 4 + PortableExecutable/Executable.cs | 56 +++ PortableExecutable/ExportDirectoryTable.cs | 4 + PortableExecutable/ExportNamePointerTable.cs | 4 + PortableExecutable/ExportNameTable.cs | 4 + PortableExecutable/ExportOrdinalTable.cs | 4 + PortableExecutable/ExportTable.cs | 20 ++ PortableExecutable/FontDirEntry.cs | 12 + PortableExecutable/FontGroupHeader.cs | 4 + PortableExecutable/HintNameTableEntry.cs | 4 + .../ImportDirectoryTableEntry.cs | 4 + PortableExecutable/ImportTable.cs | 16 + .../LoadConfigurationDirectory.cs | 4 + PortableExecutable/MenuItem.cs | 8 + PortableExecutable/MenuItemExtended.cs | 4 + PortableExecutable/MenuResource.cs | 16 + PortableExecutable/MessageResourceData.cs | 8 + PortableExecutable/MessageResourceEntry.cs | 4 + PortableExecutable/NB10ProgramDatabase.cs | 4 + PortableExecutable/OptionalHeader.cs | 56 +++ PortableExecutable/RSDSProgramDatabase.cs | 4 + PortableExecutable/ResourceDataEntry.cs | 4 + PortableExecutable/ResourceDirectoryEntry.cs | 12 + PortableExecutable/ResourceDirectoryString.cs | 4 + PortableExecutable/ResourceDirectoryTable.cs | 4 + PortableExecutable/SectionHeader.cs | 12 + PortableExecutable/SecuROMAddD.cs | 16 + PortableExecutable/SecuROMAddDEntry.cs | 4 + PortableExecutable/StringData.cs | 8 + PortableExecutable/StringFileInfo.cs | 8 + PortableExecutable/StringTable.cs | 8 + PortableExecutable/VarData.cs | 8 + PortableExecutable/VarFileInfo.cs | 8 + PortableExecutable/VersionInfo.cs | 16 + Quantum/Archive.cs | 8 + Quantum/FileDescriptor.cs | 8 + Quantum/Header.cs | 4 + README.MD | 3 +- SFFS/FileEntry.cs | 4 + SFFS/FileHeader.cs | 4 + SFFS/StarForceFileSystem.cs | 12 + SGA/DirectoryHeader.cs | 16 + SGA/File.cs | 8 + SGA/File4.cs | 4 + SGA/FileHeader.cs | 4 + SGA/Folder.cs | 20 ++ SGA/Header.cs | 4 + SGA/Header4.cs | 12 + SGA/Header6.cs | 4 + SGA/Section.cs | 28 ++ SGA/SpecializedDirectory.cs | 24 ++ TAR/Archive.cs | 4 + TAR/Header.cs | 36 ++ VBSP/File.cs | 4 + VBSP/Header.cs | 8 + VBSP/Lump.cs | 4 + VPK/ArchiveHash.cs | 4 + VPK/DirectoryItem.cs | 20 ++ VPK/File.cs | 16 + WAD/File.cs | 12 + WAD/Header.cs | 4 + WAD/Lump.cs | 4 + WAD/LumpInfo.cs | 12 + XZP/DirectoryItem.cs | 4 + XZP/File.cs | 24 ++ XZP/Footer.cs | 4 + XZP/Header.cs | 4 + 212 files changed, 3018 insertions(+), 1 deletion(-) diff --git a/AACS/CopyrightRecord.cs b/AACS/CopyrightRecord.cs index e069df5..357a6a2 100644 --- a/AACS/CopyrightRecord.cs +++ b/AACS/CopyrightRecord.cs @@ -8,6 +8,10 @@ namespace SabreTools.Models.AACS /// /// Null-terminated ASCII string representing the copyright /// +#if NET48 public string Copyright; +#else + public string? Copyright; +#endif } } \ No newline at end of file diff --git a/AACS/DriveRevocationListEntry.cs b/AACS/DriveRevocationListEntry.cs index 6bbcd92..8310af3 100644 --- a/AACS/DriveRevocationListEntry.cs +++ b/AACS/DriveRevocationListEntry.cs @@ -16,6 +16,10 @@ namespace SabreTools.Models.AACS /// (or the first in a range of Licensed Drives being revoked, in the /// case of a non-zero Range value). /// +#if NET48 public byte[] DriveID; +#else + public byte[]? DriveID; +#endif } } \ No newline at end of file diff --git a/AACS/DriveRevocationListRecord.cs b/AACS/DriveRevocationListRecord.cs index 532ab55..adee366 100644 --- a/AACS/DriveRevocationListRecord.cs +++ b/AACS/DriveRevocationListRecord.cs @@ -21,6 +21,10 @@ namespace SabreTools.Models.AACS /// /// Revocation list entries /// +#if NET48 public DriveRevocationSignatureBlock[] SignatureBlocks; +#else + public DriveRevocationSignatureBlock[]? SignatureBlocks; +#endif } } \ No newline at end of file diff --git a/AACS/DriveRevocationSignatureBlock.cs b/AACS/DriveRevocationSignatureBlock.cs index c86d3ce..46723ee 100644 --- a/AACS/DriveRevocationSignatureBlock.cs +++ b/AACS/DriveRevocationSignatureBlock.cs @@ -12,6 +12,10 @@ namespace SabreTools.Models.AACS /// A list of 8-byte Host Drive List Entry fields, the length of this /// list being equal to the number in the signature block. /// +#if NET48 public DriveRevocationListEntry[] EntryFields; +#else + public DriveRevocationListEntry[]? EntryFields; +#endif } } \ No newline at end of file diff --git a/AACS/EndOfMediaKeyBlockRecord.cs b/AACS/EndOfMediaKeyBlockRecord.cs index 3054bc2..e988036 100644 --- a/AACS/EndOfMediaKeyBlockRecord.cs +++ b/AACS/EndOfMediaKeyBlockRecord.cs @@ -18,6 +18,10 @@ namespace SabreTools.Models.AACS /// determines that the signature does not verify or is omitted, it /// must refuse to use the Media Key. /// +#if NET48 public byte[] SignatureData; +#else + public byte[]? SignatureData; +#endif } } \ No newline at end of file diff --git a/AACS/ExplicitSubsetDifferenceRecord.cs b/AACS/ExplicitSubsetDifferenceRecord.cs index 130c682..2795433 100644 --- a/AACS/ExplicitSubsetDifferenceRecord.cs +++ b/AACS/ExplicitSubsetDifferenceRecord.cs @@ -6,6 +6,10 @@ namespace SabreTools.Models.AACS /// /// In this record, each subset-difference is encoded with 5 bytes. /// +#if NET48 public SubsetDifference[] SubsetDifferences; +#else + public SubsetDifference[]? SubsetDifferences; +#endif } } \ No newline at end of file diff --git a/AACS/HostRevocationListEntry.cs b/AACS/HostRevocationListEntry.cs index 2a435b3..ba5566a 100644 --- a/AACS/HostRevocationListEntry.cs +++ b/AACS/HostRevocationListEntry.cs @@ -16,6 +16,10 @@ namespace SabreTools.Models.AACS /// first in a range of hosts being revoked, in the case of a non-zero /// Range value). /// +#if NET48 public byte[] HostID; +#else + public byte[]? HostID; +#endif } } \ No newline at end of file diff --git a/AACS/HostRevocationListRecord.cs b/AACS/HostRevocationListRecord.cs index 48cfd13..ba26374 100644 --- a/AACS/HostRevocationListRecord.cs +++ b/AACS/HostRevocationListRecord.cs @@ -24,6 +24,10 @@ namespace SabreTools.Models.AACS /// /// Revocation list entries /// +#if NET48 public HostRevocationSignatureBlock[] SignatureBlocks; +#else + public HostRevocationSignatureBlock[]? SignatureBlocks; +#endif } } \ No newline at end of file diff --git a/AACS/HostRevocationSignatureBlock.cs b/AACS/HostRevocationSignatureBlock.cs index 1cea27b..584ec6f 100644 --- a/AACS/HostRevocationSignatureBlock.cs +++ b/AACS/HostRevocationSignatureBlock.cs @@ -12,6 +12,10 @@ namespace SabreTools.Models.AACS /// A list of 8-byte Host Revocation List Entry fields, the length of this /// list being equal to the number in the signature block. /// +#if NET48 public HostRevocationListEntry[] EntryFields; +#else + public HostRevocationListEntry[]? EntryFields; +#endif } } \ No newline at end of file diff --git a/AACS/MediaKeyBlock.cs b/AACS/MediaKeyBlock.cs index 12ef461..a68fba1 100644 --- a/AACS/MediaKeyBlock.cs +++ b/AACS/MediaKeyBlock.cs @@ -9,6 +9,10 @@ namespace SabreTools.Models.AACS /// /// Records /// +#if NET48 public Record[] Records { get; set; } +#else + public Record[]? Records { get; set; } +#endif } } \ No newline at end of file diff --git a/AACS/MediaKeyDataRecord.cs b/AACS/MediaKeyDataRecord.cs index 9561a91..dc98a8a 100644 --- a/AACS/MediaKeyDataRecord.cs +++ b/AACS/MediaKeyDataRecord.cs @@ -13,6 +13,10 @@ namespace SabreTools.Models.AACS /// record. This 16 bytes is the ciphertext value C in the media /// key calculation. /// +#if NET48 public byte[][] MediaKeyData; +#else + public byte[][]? MediaKeyData; +#endif } } \ No newline at end of file diff --git a/AACS/SubsetDifferenceIndexRecord.cs b/AACS/SubsetDifferenceIndexRecord.cs index 031e88d..2f16de8 100644 --- a/AACS/SubsetDifferenceIndexRecord.cs +++ b/AACS/SubsetDifferenceIndexRecord.cs @@ -21,6 +21,10 @@ namespace SabreTools.Models.AACS /// Subset-Difference record, with 0 being the start of the record. /// // UInt24 not UInt32 +#if NET48 public uint[] Offsets; +#else + public uint[]? Offsets; +#endif } } \ No newline at end of file diff --git a/AACS/VerifyMediaKeyRecord.cs b/AACS/VerifyMediaKeyRecord.cs index 008713d..e5acbb9 100644 --- a/AACS/VerifyMediaKeyRecord.cs +++ b/AACS/VerifyMediaKeyRecord.cs @@ -19,6 +19,10 @@ namespace SabreTools.Models.AACS /// where 0xXXXXXXXXXXXXXXXX is an arbitrary 8-byte value, and Km is /// the correct final Media Key value. /// +#if NET48 public byte[] CiphertextValue; +#else + public byte[]? CiphertextValue; +#endif } } \ No newline at end of file diff --git a/BDPlus/SVM.cs b/BDPlus/SVM.cs index 3882333..05e133a 100644 --- a/BDPlus/SVM.cs +++ b/BDPlus/SVM.cs @@ -6,12 +6,20 @@ namespace SabreTools.Models.BDPlus /// /// "BDSVM_CC" /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// 5 bytes of unknown data /// +#if NET48 public byte[] Unknown1; +#else + public byte[]? Unknown1; +#endif /// /// Version year @@ -31,7 +39,11 @@ namespace SabreTools.Models.BDPlus /// /// 4 bytes of unknown data /// +#if NET48 public byte[] Unknown2; +#else + public byte[]? Unknown2; +#endif /// /// Length @@ -41,6 +53,10 @@ namespace SabreTools.Models.BDPlus /// /// Length bytes of data /// +#if NET48 public byte[] Data; +#else + public byte[]? Data; +#endif } } \ No newline at end of file diff --git a/BFPK/Archive.cs b/BFPK/Archive.cs index 2a10e8f..c0e9b27 100644 --- a/BFPK/Archive.cs +++ b/BFPK/Archive.cs @@ -9,11 +9,19 @@ /// /// Header /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// Files /// +#if NET48 public FileEntry[] Files { get; set; } +#else + public FileEntry[]? Files { get; set; } +#endif } } diff --git a/BFPK/FileEntry.cs b/BFPK/FileEntry.cs index 8dcde74..8b2cebe 100644 --- a/BFPK/FileEntry.cs +++ b/BFPK/FileEntry.cs @@ -14,7 +14,11 @@ /// /// Name /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// Uncompressed size diff --git a/BFPK/Header.cs b/BFPK/Header.cs index 2508cfc..0f6c27b 100644 --- a/BFPK/Header.cs +++ b/BFPK/Header.cs @@ -12,7 +12,11 @@ namespace SabreTools.Models.BFPK /// /// "BFPK" /// +#if NET48 public string Magic; +#else + public string? Magic; +#endif /// /// Version diff --git a/BSP/File.cs b/BSP/File.cs index 7491592..3170263 100644 --- a/BSP/File.cs +++ b/BSP/File.cs @@ -9,21 +9,37 @@ namespace SabreTools.Models.BSP /// /// Header data /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// Lumps /// +#if NET48 public Lump[] Lumps { get; set; } +#else + public Lump[]? Lumps { get; set; } +#endif /// /// Texture header data /// +#if NET48 public TextureHeader TextureHeader { get; set; } +#else + public TextureHeader? TextureHeader { get; set; } +#endif /// /// Textures /// +#if NET48 public Texture[] Textures { get; set; } +#else + public Texture[]? Textures { get; set; } +#endif } } \ No newline at end of file diff --git a/BSP/Texture.cs b/BSP/Texture.cs index 32bfacd..0c44350 100644 --- a/BSP/Texture.cs +++ b/BSP/Texture.cs @@ -6,7 +6,11 @@ namespace SabreTools.Models.BSP /// /// Name /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// Width @@ -21,12 +25,20 @@ namespace SabreTools.Models.BSP /// /// Offsets /// +#if NET48 public uint[] Offsets; +#else + public uint[]? Offsets; +#endif /// /// Texture data /// +#if NET48 public byte[] TextureData; +#else + public byte[]? TextureData; +#endif /// /// Palette size @@ -36,6 +48,10 @@ namespace SabreTools.Models.BSP /// /// Palette data /// +#if NET48 public byte[] PaletteData; +#else + public byte[]? PaletteData; +#endif } } \ No newline at end of file diff --git a/BSP/TextureHeader.cs b/BSP/TextureHeader.cs index a60c2a7..85a69e9 100644 --- a/BSP/TextureHeader.cs +++ b/BSP/TextureHeader.cs @@ -11,6 +11,10 @@ namespace SabreTools.Models.BSP /// /// Offsets /// +#if NET48 public uint[] Offsets; +#else + public uint[]? Offsets; +#endif } } \ No newline at end of file diff --git a/CFB/Binary.cs b/CFB/Binary.cs index 4b1ab2e..955f93e 100644 --- a/CFB/Binary.cs +++ b/CFB/Binary.cs @@ -12,7 +12,11 @@ namespace SabreTools.Models.CFB /// /// Compound file header /// +#if NET48 public FileHeader Header { get; set; } +#else + public FileHeader? Header { get; set; } +#endif /// /// The FAT is the main allocator for space within a compound file. @@ -25,7 +29,11 @@ namespace SabreTools.Models.CFB /// /// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector /// +#if NET48 public SectorNumber[] FATSectorNumbers { get; set; } +#else + public SectorNumber[]? FATSectorNumbers { get; set; } +#endif /// /// The mini FAT is used to allocate space in the mini stream. @@ -38,7 +46,11 @@ namespace SabreTools.Models.CFB /// /// If Header Major Version is 4, there MUST be 1,024 fields specified to fill a 4,096-byte sector /// +#if NET48 public SectorNumber[] MiniFATSectorNumbers { get; set; } +#else + public SectorNumber[]? MiniFATSectorNumbers { get; set; } +#endif /// /// The DIFAT array is used to represent storage of the FAT sectors. @@ -55,7 +67,11 @@ namespace SabreTools.Models.CFB /// If Header Major Version is 4, there MUST be 1,023 fields specified /// to fill a 4,096-byte sector minus the "Next DIFAT Sector Location" field. /// +#if NET48 public SectorNumber[] DIFATSectorNumbers { get; set; } +#else + public SectorNumber[]? DIFATSectorNumbers { get; set; } +#endif /// /// The directory entry array is an array of directory entries that @@ -87,6 +103,10 @@ namespace SabreTools.Models.CFB /// all zeroes. The Modified Time field in the root storage directory /// entry MAY be all zeroes. /// +#if NET48 public DirectoryEntry[] DirectoryEntries { get; set; } +#else + public DirectoryEntry[]? DirectoryEntries { get; set; } +#endif } } \ No newline at end of file diff --git a/CFB/DirectoryEntry.cs b/CFB/DirectoryEntry.cs index 05c01ce..7797bea 100644 --- a/CFB/DirectoryEntry.cs +++ b/CFB/DirectoryEntry.cs @@ -16,7 +16,11 @@ namespace SabreTools.Models.CFB /// The following characters are illegal and MUST NOT be part of the /// name: '/', '\', ':', '!'. /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// This field MUST be 0x00, 0x01, 0x02, or 0x05, depending on the diff --git a/CFB/FileHeader.cs b/CFB/FileHeader.cs index 8586a95..75b575d 100644 --- a/CFB/FileHeader.cs +++ b/CFB/FileHeader.cs @@ -57,7 +57,11 @@ namespace SabreTools.Models.CFB /// /// This field MUST be set to all zeroes. /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif /// /// This integer field contains the count of the number of directory sectors @@ -122,6 +126,10 @@ namespace SabreTools.Models.CFB /// This array of 32-bit integer fields contains the first 109 FAT sector /// locations of the compound file /// +#if NET48 public SectorNumber[] DIFAT; +#else + public SectorNumber[]? DIFAT; +#endif } } \ No newline at end of file diff --git a/CFB/SummaryInformation.cs b/CFB/SummaryInformation.cs index 3d932e4..ae90110 100644 --- a/CFB/SummaryInformation.cs +++ b/CFB/SummaryInformation.cs @@ -36,7 +36,11 @@ namespace SabreTools.Models.CFB /// /// 4 bytes of reserved data /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif #endregion @@ -50,7 +54,11 @@ namespace SabreTools.Models.CFB /// /// 16 bytes of unknown data /// +#if NET48 public byte[] Unknown; +#else + public byte[]? Unknown; +#endif #endregion @@ -75,7 +83,11 @@ namespace SabreTools.Models.CFB /// Properties /// /// Each Variant might be followed by an index and offset value +#if NET48 public Variant[] Properties; +#else + public Variant[]? Properties; +#endif #endregion } diff --git a/CFB/Variant.cs b/CFB/Variant.cs index 3863538..43ee448 100644 --- a/CFB/Variant.cs +++ b/CFB/Variant.cs @@ -40,6 +40,10 @@ namespace SabreTools.Models.CFB /// MUST contain an instance of the type, according to the value /// in the field. /// +#if NET48 public object Union; +#else + public object? Union; +#endif } } \ No newline at end of file diff --git a/Compression/LZ/FileHeader.cs b/Compression/LZ/FileHeader.cs index 2a9ff96..a499bfd 100644 --- a/Compression/LZ/FileHeader.cs +++ b/Compression/LZ/FileHeader.cs @@ -6,7 +6,11 @@ namespace SabreTools.Models.Compression.LZ /// public sealed class FileHeaader { +#if NET48 public string Magic; +#else + public string? Magic; +#endif public byte CompressionType; diff --git a/Compression/LZ/State.cs b/Compression/LZ/State.cs index e6d4ade..e2ce599 100644 --- a/Compression/LZ/State.cs +++ b/Compression/LZ/State.cs @@ -7,7 +7,11 @@ namespace SabreTools.Models.Compression.LZ /// /// Internal backing stream /// +#if NET48 public Stream Source { get; set; } +#else + public Stream? Source { get; set; } +#endif /// /// The last char of the filename for replacement @@ -32,7 +36,11 @@ namespace SabreTools.Models.Compression.LZ /// /// The rotating LZ table /// +#if NET48 public byte[] Table { get; set; } +#else + public byte[]? Table { get; set; } +#endif /// /// CURrent TABle ENTry @@ -57,7 +65,11 @@ namespace SabreTools.Models.Compression.LZ /// /// GETLEN bytes /// +#if NET48 public byte[] Window { get; set; } +#else + public byte[]? Window { get; set; } +#endif /// /// Current read diff --git a/Compression/LZX/AlignedOffsetBlock.cs b/Compression/LZX/AlignedOffsetBlock.cs index 57882fd..f7c6ce4 100644 --- a/Compression/LZX/AlignedOffsetBlock.cs +++ b/Compression/LZX/AlignedOffsetBlock.cs @@ -10,49 +10,81 @@ namespace SabreTools.Models.Compression.LZX /// /// Generic block header /// +#if NET48 public BlockHeader Header; +#else + public BlockHeader? Header; +#endif /// /// Aligned offset tree /// /// 8 elements, 3 bits each +#if NET48 public byte[] AlignedOffsetTree; +#else + public byte[]? AlignedOffsetTree; +#endif /// /// Pretree for first 256 elements of main tree /// /// 20 elements, 4 bits each +#if NET48 public byte[] PretreeFirst256; +#else + public byte[]? PretreeFirst256; +#endif /// /// Path lengths of first 256 elements of main tree /// /// Encoded using pretree +#if NET48 public int[] PathLengthsFirst256; +#else + public int[]? PathLengthsFirst256; +#endif /// /// Pretree for remainder of main tree /// /// 20 elements, 4 bits each +#if NET48 public byte[] PretreeRemainder; +#else + public byte[]? PretreeRemainder; +#endif /// /// Path lengths of remaining elements of main tree /// /// Encoded using pretree +#if NET48 public int[] PathLengthsRemainder; +#else + public int[]? PathLengthsRemainder; +#endif /// /// Pretree for length tree /// /// 20 elements, 4 bits each +#if NET48 public byte[] PretreeLengthTree; +#else + public byte[]? PretreeLengthTree; +#endif /// /// Path lengths of elements in length tree /// /// Encoded using pretree +#if NET48 public int[] PathLengthsLengthTree; +#else + public int[]? PathLengthsLengthTree; +#endif // Entry Comments Size // --------------------------------------------------------------------------------------- diff --git a/Compression/LZX/UncompressedBlock.cs b/Compression/LZX/UncompressedBlock.cs index 479603d..422b2bb 100644 --- a/Compression/LZX/UncompressedBlock.cs +++ b/Compression/LZX/UncompressedBlock.cs @@ -19,7 +19,11 @@ namespace SabreTools.Models.Compression.LZX /// /// Generic block header /// +#if NET48 public BlockHeader Header; +#else + public BlockHeader? Header; +#endif /// /// Padding to align following field on 16-bit boundary @@ -49,7 +53,11 @@ namespace SabreTools.Models.Compression.LZX /// Can use the direct memcpy function, as specified in [IEEE1003.1] /// /// Encoded directly in the byte stream, not in the bitstream of byte-swapped 16-bit words +#if NET48 public byte[] RawDataBytes; +#else + public byte[]? RawDataBytes; +#endif /// /// Only if uncompressed size is odd diff --git a/Compression/LZX/VerbatimBlock.cs b/Compression/LZX/VerbatimBlock.cs index 7c124a0..7444338 100644 --- a/Compression/LZX/VerbatimBlock.cs +++ b/Compression/LZX/VerbatimBlock.cs @@ -9,43 +9,71 @@ namespace SabreTools.Models.Compression.LZX /// /// Generic block header /// +#if NET48 public BlockHeader Header; +#else + public BlockHeader? Header; +#endif /// /// Pretree for first 256 elements of main tree /// /// 20 elements, 4 bits each +#if NET48 public byte[] PretreeFirst256; +#else + public byte[]? PretreeFirst256; +#endif /// /// Path lengths of first 256 elements of main tree /// /// Encoded using pretree +#if NET48 public int[] PathLengthsFirst256; +#else + public int[]? PathLengthsFirst256; +#endif /// /// Pretree for remainder of main tree /// /// 20 elements, 4 bits each +#if NET48 public byte[] PretreeRemainder; +#else + public byte[]? PretreeRemainder; +#endif /// /// Path lengths of remaining elements of main tree /// /// Encoded using pretree +#if NET48 public int[] PathLengthsRemainder; +#else + public int[]? PathLengthsRemainder; +#endif /// /// Pretree for length tree /// /// 20 elements, 4 bits each +#if NET48 public byte[] PretreeLengthTree; +#else + public byte[]? PretreeLengthTree; +#endif /// /// Path lengths of elements in length tree /// /// Encoded using pretree +#if NET48 public int[] PathLengthsLengthTree; +#else + public int[]? PathLengthsLengthTree; +#endif // Entry Comments Size // --------------------------------------------------------------------------------------- diff --git a/Compression/MSZIP/DynamicHuffmanCompressedBlockHeader.cs b/Compression/MSZIP/DynamicHuffmanCompressedBlockHeader.cs index cfb8cf9..a51c4b3 100644 --- a/Compression/MSZIP/DynamicHuffmanCompressedBlockHeader.cs +++ b/Compression/MSZIP/DynamicHuffmanCompressedBlockHeader.cs @@ -9,11 +9,19 @@ namespace SabreTools.Models.Compression.MSZIP /// /// Huffman code lengths for the literal / length alphabet /// +#if NET48 public int[] LiteralLengths; +#else + public int[]? LiteralLengths; +#endif /// /// Huffman distance codes for the literal / length alphabet /// +#if NET48 public int[] DistanceCodes; +#else + public int[]? DistanceCodes; +#endif } } \ No newline at end of file diff --git a/Compression/MSZIP/FixedHuffmanCompressedBlockHeader.cs b/Compression/MSZIP/FixedHuffmanCompressedBlockHeader.cs index 083db2e..27b7dc4 100644 --- a/Compression/MSZIP/FixedHuffmanCompressedBlockHeader.cs +++ b/Compression/MSZIP/FixedHuffmanCompressedBlockHeader.cs @@ -14,7 +14,11 @@ namespace SabreTools.Models.Compression.MSZIP /// /// Huffman code lengths for the literal / length alphabet /// +#if NET48 public uint[] LiteralLengths +#else + public uint[]? LiteralLengths +#endif { get { @@ -52,7 +56,11 @@ namespace SabreTools.Models.Compression.MSZIP /// /// Huffman distance codes for the literal / length alphabet /// +#if NET48 public uint[] DistanceCodes +#else + public uint[]? DistanceCodes +#endif { get { @@ -82,12 +90,20 @@ namespace SabreTools.Models.Compression.MSZIP /// /// Huffman code lengths for the literal / length alphabet /// +#if NET48 private uint[] _literalLengths = null; +#else + private uint[]? _literalLengths = null; +#endif /// /// Huffman distance codes for the literal / length alphabet /// +#if NET48 private uint[] _distanceCodes = null; +#else + private uint[]? _distanceCodes = null; +#endif #endregion } diff --git a/Compression/Quantum/Model.cs b/Compression/Quantum/Model.cs index e5fd2c1..b14d3b8 100644 --- a/Compression/Quantum/Model.cs +++ b/Compression/Quantum/Model.cs @@ -8,8 +8,16 @@ namespace SabreTools.Models.Compression.Quantum public int Entries; +#if NET48 public ModelSymbol[] Symbols; +#else + public ModelSymbol[]? Symbols; +#endif +#if NET48 public ushort[] LookupTable = new ushort[256]; +#else + public ushort[]? LookupTable = new ushort[256]; +#endif } } \ No newline at end of file diff --git a/DVD/AudioSubPictureAttributesTable.cs b/DVD/AudioSubPictureAttributesTable.cs index 1c3762c..3938d42 100644 --- a/DVD/AudioSubPictureAttributesTable.cs +++ b/DVD/AudioSubPictureAttributesTable.cs @@ -11,7 +11,11 @@ namespace SabreTools.Models.DVD /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif /// /// End address (last byte of last VTS_ATRT) @@ -21,11 +25,19 @@ namespace SabreTools.Models.DVD /// /// Offset to VTS_ATRT n /// +#if NET48 public uint[] Offsets; +#else + public uint[]? Offsets; +#endif /// /// Entries /// +#if NET48 public AudioSubPictureAttributesTableEntry[] Entries; +#else + public AudioSubPictureAttributesTableEntry[]? Entries; +#endif } } \ No newline at end of file diff --git a/DVD/AudioSubPictureAttributesTableEntry.cs b/DVD/AudioSubPictureAttributesTableEntry.cs index ebf7ac6..98b2f41 100644 --- a/DVD/AudioSubPictureAttributesTableEntry.cs +++ b/DVD/AudioSubPictureAttributesTableEntry.cs @@ -18,6 +18,10 @@ namespace SabreTools.Models.DVD /// Copy of VTS attributes (offset 100 and on from the VTS IFO /// file, usually 0x300 bytes long) /// +#if NET48 public byte[] AttributesCopy; +#else + public byte[]? AttributesCopy; +#endif } } \ No newline at end of file diff --git a/DVD/CellAddressTable.cs b/DVD/CellAddressTable.cs index b34d9ef..fba4651 100644 --- a/DVD/CellAddressTable.cs +++ b/DVD/CellAddressTable.cs @@ -11,7 +11,11 @@ namespace SabreTools.Models.DVD /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif /// /// End address (last byte of last entry) @@ -21,6 +25,10 @@ namespace SabreTools.Models.DVD /// /// 12-byte entries /// +#if NET48 public CellAddressTableEntry[] Entries; +#else + public CellAddressTableEntry[]? Entries; +#endif } } \ No newline at end of file diff --git a/DVD/LanguageUnitTable.cs b/DVD/LanguageUnitTable.cs index bfc8bbe..da769b8 100644 --- a/DVD/LanguageUnitTable.cs +++ b/DVD/LanguageUnitTable.cs @@ -11,7 +11,11 @@ namespace SabreTools.Models.DVD /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif /// /// End address (last byte of last PGC in last LU) @@ -22,11 +26,19 @@ namespace SabreTools.Models.DVD /// /// Language Units /// +#if NET48 public LanguageUnitTableEntry[] Entries; +#else + public LanguageUnitTableEntry[]? Entries; +#endif /// /// Program Chains /// +#if NET48 public ProgramChainTable[] ProgramChains; +#else + public ProgramChainTable[]? ProgramChains; +#endif } } \ No newline at end of file diff --git a/DVD/ParentalManagementMasksTable.cs b/DVD/ParentalManagementMasksTable.cs index 42d2056..8a568e4 100644 --- a/DVD/ParentalManagementMasksTable.cs +++ b/DVD/ParentalManagementMasksTable.cs @@ -25,13 +25,21 @@ namespace SabreTools.Models.DVD /// /// Entries /// +#if NET48 public ParentalManagementMasksTableEntry[] Entries; +#else + public ParentalManagementMasksTableEntry[]? Entries; +#endif /// /// The PTL_MAIT contains the 16-bit masks for the VMG and /// all title sets for parental management level 8 followed /// by the masks for level 7, and so on to level 1. /// +#if NET48 public byte[][] BitMasks; +#else + public byte[][]? BitMasks; +#endif } } \ No newline at end of file diff --git a/DVD/ParentalManagementMasksTableEntry.cs b/DVD/ParentalManagementMasksTableEntry.cs index ce353b5..cc4715b 100644 --- a/DVD/ParentalManagementMasksTableEntry.cs +++ b/DVD/ParentalManagementMasksTableEntry.cs @@ -11,7 +11,11 @@ namespace SabreTools.Models.DVD /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif /// /// Offset to PTL_MAIT diff --git a/DVD/ProgramChainTable.cs b/DVD/ProgramChainTable.cs index c5f3ef5..a8806c0 100644 --- a/DVD/ProgramChainTable.cs +++ b/DVD/ProgramChainTable.cs @@ -11,7 +11,11 @@ namespace SabreTools.Models.DVD /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif /// /// End address (last byte of last PGC in this LU) @@ -22,6 +26,10 @@ namespace SabreTools.Models.DVD /// /// Program Chains /// +#if NET48 public ProgramChainTableEntry[] Entries; +#else + public ProgramChainTableEntry[]? Entries; +#endif } } \ No newline at end of file diff --git a/DVD/TitlesTable.cs b/DVD/TitlesTable.cs index 1beb3bb..518c791 100644 --- a/DVD/TitlesTable.cs +++ b/DVD/TitlesTable.cs @@ -11,7 +11,11 @@ namespace SabreTools.Models.DVD /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif /// /// End address (last byte of last entry) @@ -21,6 +25,10 @@ namespace SabreTools.Models.DVD /// /// 12-byte entries /// +#if NET48 public TitlesTableEntry[] Entries; +#else + public TitlesTableEntry[]? Entries; +#endif } } \ No newline at end of file diff --git a/DVD/VOBUAddressMap.cs b/DVD/VOBUAddressMap.cs index 5c88df8..de29e2b 100644 --- a/DVD/VOBUAddressMap.cs +++ b/DVD/VOBUAddressMap.cs @@ -11,6 +11,10 @@ namespace SabreTools.Models.DVD /// /// Starting sector within VOB of nth VOBU /// +#if NET48 public uint[] StartingSectors; +#else + public uint[]? StartingSectors; +#endif } } \ No newline at end of file diff --git a/DVD/VideoManagerIFO.cs b/DVD/VideoManagerIFO.cs index 7f8072e..8a319ed 100644 --- a/DVD/VideoManagerIFO.cs +++ b/DVD/VideoManagerIFO.cs @@ -6,7 +6,11 @@ namespace SabreTools.Models.DVD /// /// "DVDVIDEO-VMG" /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Last sector of VMG set (last sector of BUP) @@ -55,7 +59,11 @@ namespace SabreTools.Models.DVD /// /// Provider ID /// +#if NET48 public byte[] ProviderID; +#else + public byte[]? ProviderID; +#endif /// /// VMG POS @@ -115,7 +123,11 @@ namespace SabreTools.Models.DVD /// /// Video attributes of VMGM_VOBS /// +#if NET48 public byte[] VideoAttributes; +#else + public byte[]? VideoAttributes; +#endif /// /// Number of audio streams in VMGM_VOBS @@ -125,12 +137,20 @@ namespace SabreTools.Models.DVD /// /// Audio attributes of VMGM_VOBS /// +#if NET48 public byte[][] AudioAttributes; +#else + public byte[][]? AudioAttributes; +#endif /// /// Unknown /// +#if NET48 public byte[] Unknown; +#else + public byte[]? Unknown; +#endif /// /// Number of subpicture streams in VMGM_VOBS (0 or 1) @@ -140,11 +160,19 @@ namespace SabreTools.Models.DVD /// /// Subpicture attributes of VMGM_VOBS /// +#if NET48 public byte[] SubpictureAttributes; +#else + public byte[]? SubpictureAttributes; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif } } \ No newline at end of file diff --git a/DVD/VideoTitleSetIFO.cs b/DVD/VideoTitleSetIFO.cs index 311f848..72a7de6 100644 --- a/DVD/VideoTitleSetIFO.cs +++ b/DVD/VideoTitleSetIFO.cs @@ -6,7 +6,11 @@ namespace SabreTools.Models.DVD /// /// "DVDVIDEO-VTS" /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Last sector of title set (last sector of BUP) @@ -55,7 +59,11 @@ namespace SabreTools.Models.DVD /// /// Provider ID /// +#if NET48 public byte[] ProviderID; +#else + public byte[]? ProviderID; +#endif /// /// VMG POS @@ -125,7 +133,11 @@ namespace SabreTools.Models.DVD /// /// Video attributes of VTSM_VOBS /// +#if NET48 public byte[] VideoAttributes; +#else + public byte[]? VideoAttributes; +#endif /// /// Number of audio streams in VTSM_VOBS @@ -135,12 +147,20 @@ namespace SabreTools.Models.DVD /// /// Audio attributes of VTSM_VOBS /// +#if NET48 public byte[][] AudioAttributes; +#else + public byte[][]? AudioAttributes; +#endif /// /// Unknown /// +#if NET48 public byte[] Unknown; +#else + public byte[]? Unknown; +#endif /// /// Number of subpicture streams in VTSM_VOBS (0 or 1) @@ -150,11 +170,19 @@ namespace SabreTools.Models.DVD /// /// Subpicture attributes of VTSM_VOBS /// +#if NET48 public byte[] SubpictureAttributes; +#else + public byte[]? SubpictureAttributes; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif } } \ No newline at end of file diff --git a/GCF/DirectoryEntry.cs b/GCF/DirectoryEntry.cs index bcc0632..1ab2298 100644 --- a/GCF/DirectoryEntry.cs +++ b/GCF/DirectoryEntry.cs @@ -11,7 +11,11 @@ namespace SabreTools.Models.GCF /// /// Directory item name from the end of the directory items. /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// Size of the item. (If file, file size. If folder, num items.) diff --git a/GCF/File.cs b/GCF/File.cs index 29d3dd7..d905161 100644 --- a/GCF/File.cs +++ b/GCF/File.cs @@ -11,108 +11,192 @@ namespace SabreTools.Models.GCF /// /// Header data /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// Block entry header data /// +#if NET48 public BlockEntryHeader BlockEntryHeader { get; set; } +#else + public BlockEntryHeader? BlockEntryHeader { get; set; } +#endif /// /// Block entries data /// +#if NET48 public BlockEntry[] BlockEntries { get; set; } +#else + public BlockEntry[]? BlockEntries { get; set; } +#endif /// /// Fragmentation map header data /// +#if NET48 public FragmentationMapHeader FragmentationMapHeader { get; set; } +#else + public FragmentationMapHeader? FragmentationMapHeader { get; set; } +#endif /// /// Fragmentation map data /// +#if NET48 public FragmentationMap[] FragmentationMaps { get; set; } +#else + public FragmentationMap[]? FragmentationMaps { get; set; } +#endif /// /// Block entry map header data /// /// Part of version 5 but not version 6. +#if NET48 public BlockEntryMapHeader BlockEntryMapHeader { get; set; } +#else + public BlockEntryMapHeader? BlockEntryMapHeader { get; set; } +#endif /// /// Block entry map data /// /// Part of version 5 but not version 6. +#if NET48 public BlockEntryMap[] BlockEntryMaps { get; set; } +#else + public BlockEntryMap[]? BlockEntryMaps { get; set; } +#endif /// /// Directory header data /// +#if NET48 public DirectoryHeader DirectoryHeader { get; set; } +#else + public DirectoryHeader? DirectoryHeader { get; set; } +#endif /// /// Directory entries data /// +#if NET48 public DirectoryEntry[] DirectoryEntries { get; set; } +#else + public DirectoryEntry[]? DirectoryEntries { get; set; } +#endif /// /// Directory names data /// +#if NET48 public Dictionary DirectoryNames { get; set; } +#else + public Dictionary? DirectoryNames { get; set; } +#endif /// /// Directory info 1 entries data /// +#if NET48 public DirectoryInfo1Entry[] DirectoryInfo1Entries { get; set; } +#else + public DirectoryInfo1Entry[]? DirectoryInfo1Entries { get; set; } +#endif /// /// Directory info 2 entries data /// +#if NET48 public DirectoryInfo2Entry[] DirectoryInfo2Entries { get; set; } +#else + public DirectoryInfo2Entry[]? DirectoryInfo2Entries { get; set; } +#endif /// /// Directory copy entries data /// +#if NET48 public DirectoryCopyEntry[] DirectoryCopyEntries { get; set; } +#else + public DirectoryCopyEntry[]? DirectoryCopyEntries { get; set; } +#endif /// /// Directory local entries data /// +#if NET48 public DirectoryLocalEntry[] DirectoryLocalEntries { get; set; } +#else + public DirectoryLocalEntry[]? DirectoryLocalEntries { get; set; } +#endif /// /// Directory map header data /// +#if NET48 public DirectoryMapHeader DirectoryMapHeader { get; set; } +#else + public DirectoryMapHeader? DirectoryMapHeader { get; set; } +#endif /// /// Directory map entries data /// +#if NET48 public DirectoryMapEntry[] DirectoryMapEntries { get; set; } +#else + public DirectoryMapEntry[]? DirectoryMapEntries { get; set; } +#endif /// /// Checksum header data /// +#if NET48 public ChecksumHeader ChecksumHeader { get; set; } +#else + public ChecksumHeader? ChecksumHeader { get; set; } +#endif /// /// Checksum map header data /// +#if NET48 public ChecksumMapHeader ChecksumMapHeader { get; set; } +#else + public ChecksumMapHeader? ChecksumMapHeader { get; set; } +#endif /// /// Checksum map entries data /// +#if NET48 public ChecksumMapEntry[] ChecksumMapEntries { get; set; } +#else + public ChecksumMapEntry[]? ChecksumMapEntries { get; set; } +#endif /// /// Checksum entries data /// +#if NET48 public ChecksumEntry[] ChecksumEntries { get; set; } +#else + public ChecksumEntry[]? ChecksumEntries { get; set; } +#endif /// /// Data block header data /// +#if NET48 public DataBlockHeader DataBlockHeader { get; set; } +#else + public DataBlockHeader? DataBlockHeader { get; set; } +#endif } } \ No newline at end of file diff --git a/InstallShieldCabinet/Cabinet.cs b/InstallShieldCabinet/Cabinet.cs index 6ac3c5a..e7c9c47 100644 --- a/InstallShieldCabinet/Cabinet.cs +++ b/InstallShieldCabinet/Cabinet.cs @@ -11,17 +11,29 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Common header /// +#if NET48 public CommonHeader CommonHeader { get; set; } +#else + public CommonHeader? CommonHeader { get; set; } +#endif /// /// Volume header /// +#if NET48 public VolumeHeader VolumeHeader { get; set; } +#else + public VolumeHeader? VolumeHeader { get; set; } +#endif /// /// Descriptor /// +#if NET48 public Descriptor Descriptor { get; set; } +#else + public Descriptor? Descriptor { get; set; } +#endif #endregion @@ -30,17 +42,29 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Offsets to all file descriptors /// +#if NET48 public uint[] FileDescriptorOffsets { get; set; } +#else + public uint[]? FileDescriptorOffsets { get; set; } +#endif /// /// Directory names /// +#if NET48 public string[] DirectoryNames { get; set; } +#else + public string[]? DirectoryNames { get; set; } +#endif /// /// Standard file descriptors /// +#if NET48 public FileDescriptor[] FileDescriptors { get; set; } +#else + public FileDescriptor[]? FileDescriptors { get; set; } +#endif #endregion @@ -49,12 +73,20 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// File group offset to offset list mapping /// +#if NET48 public Dictionary FileGroupOffsets { get; set; } +#else + public Dictionary? FileGroupOffsets { get; set; } +#endif /// /// File groups /// +#if NET48 public FileGroup[] FileGroups { get; set; } +#else + public FileGroup[]? FileGroups { get; set; } +#endif #endregion @@ -63,12 +95,20 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Component offset to offset list mapping /// +#if NET48 public Dictionary ComponentOffsets { get; set; } +#else + public Dictionary? ComponentOffsets { get; set; } +#endif /// /// Components /// +#if NET48 public Component[] Components { get; set; } +#else + public Component[]? Components { get; set; } +#endif #endregion } diff --git a/InstallShieldCabinet/CommonHeader.cs b/InstallShieldCabinet/CommonHeader.cs index 737eef2..a7cd375 100644 --- a/InstallShieldCabinet/CommonHeader.cs +++ b/InstallShieldCabinet/CommonHeader.cs @@ -6,7 +6,11 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// "ISc(" /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Encoded version diff --git a/InstallShieldCabinet/Component.cs b/InstallShieldCabinet/Component.cs index 7ac5120..4b83540 100644 --- a/InstallShieldCabinet/Component.cs +++ b/InstallShieldCabinet/Component.cs @@ -13,7 +13,11 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Component identifier /// +#if NET48 public string Identifier; +#else + public string? Identifier; +#endif /// /// Offset to the component descriptor @@ -28,12 +32,20 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Display name /// +#if NET48 public string DisplayName; +#else + public string? DisplayName; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved0; +#else + public byte[]? Reserved0; +#endif /// /// Reserved offset @@ -58,7 +70,11 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Component name /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// Reserved offset @@ -78,7 +94,11 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Reserved /// +#if NET48 public byte[] Reserved1; +#else + public byte[]? Reserved1; +#endif /// /// Offset to the component CLSID @@ -93,12 +113,20 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Reserved /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved3; +#else + public byte[]? Reserved3; +#endif /// /// Number of depends(?) @@ -123,7 +151,11 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// File group names /// +#if NET48 public string[] FileGroupNames; +#else + public string[]? FileGroupNames; +#endif /// /// Number of X3(?) diff --git a/InstallShieldCabinet/Descriptor.cs b/InstallShieldCabinet/Descriptor.cs index 3bed3ae..a5db3bf 100644 --- a/InstallShieldCabinet/Descriptor.cs +++ b/InstallShieldCabinet/Descriptor.cs @@ -11,7 +11,11 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Reserved /// +#if NET48 public byte[] Reserved0; +#else + public byte[]? Reserved0; +#endif /// /// Offset to the component list @@ -26,7 +30,11 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Reserved /// +#if NET48 public byte[] Reserved1; +#else + public byte[]? Reserved1; +#endif /// /// Size of the file table @@ -46,17 +54,29 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Reserved /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved3; +#else + public byte[]? Reserved3; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved4; +#else + public byte[]? Reserved4; +#endif /// /// Number of files @@ -81,22 +101,38 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Reserved /// +#if NET48 public byte[] Reserved5; +#else + public byte[]? Reserved5; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved6; +#else + public byte[]? Reserved6; +#endif /// /// Offsets to the file groups /// +#if NET48 public uint[] FileGroupOffsets; +#else + public uint[]? FileGroupOffsets; +#endif /// /// Offsets to the components /// +#if NET48 public uint[] ComponentOffsets; +#else + public uint[]? ComponentOffsets; +#endif /// /// Offset to the setup types @@ -111,11 +147,19 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Reserved /// +#if NET48 public byte[] Reserved7; +#else + public byte[]? Reserved7; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved8; +#else + public byte[]? Reserved8; +#endif } } \ No newline at end of file diff --git a/InstallShieldCabinet/FileDescriptor.cs b/InstallShieldCabinet/FileDescriptor.cs index 4d093e6..fdcd3f4 100644 --- a/InstallShieldCabinet/FileDescriptor.cs +++ b/InstallShieldCabinet/FileDescriptor.cs @@ -11,7 +11,11 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// File descriptor name /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// Directory index @@ -41,7 +45,11 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// MD5 of the entry data /// +#if NET48 public byte[] MD5; +#else + public byte[]? MD5; +#endif /// /// Volume number diff --git a/InstallShieldCabinet/FileGroup.cs b/InstallShieldCabinet/FileGroup.cs index e5c2c79..f93f1b7 100644 --- a/InstallShieldCabinet/FileGroup.cs +++ b/InstallShieldCabinet/FileGroup.cs @@ -11,7 +11,11 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// File group name /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// Size of the expanded data @@ -21,7 +25,11 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Reserved /// +#if NET48 public byte[] Reserved0; +#else + public byte[]? Reserved0; +#endif /// /// Size of the compressed data @@ -31,12 +39,20 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Reserved /// +#if NET48 public byte[] Reserved1; +#else + public byte[]? Reserved1; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// Attribute(?) @@ -101,26 +117,46 @@ namespace SabreTools.Models.InstallShieldCabinet /// /// Reserved /// +#if NET48 public byte[] Reserved3; +#else + public byte[]? Reserved3; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved4; +#else + public byte[]? Reserved4; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved5; +#else + public byte[]? Reserved5; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved6; +#else + public byte[]? Reserved6; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved7; +#else + public byte[]? Reserved7; +#endif } } \ No newline at end of file diff --git a/InstallShieldCabinet/OffsetList.cs b/InstallShieldCabinet/OffsetList.cs index 351a801..90dd8ab 100644 --- a/InstallShieldCabinet/OffsetList.cs +++ b/InstallShieldCabinet/OffsetList.cs @@ -5,7 +5,11 @@ namespace SabreTools.Models.InstallShieldCabinet { public uint NameOffset; +#if NET48 public string Name; +#else + public string? Name; +#endif public uint DescriptorOffset; diff --git a/LinearExecutable/DebugInformation.cs b/LinearExecutable/DebugInformation.cs index 9b8f1bd..9fd0a4d 100644 --- a/LinearExecutable/DebugInformation.cs +++ b/LinearExecutable/DebugInformation.cs @@ -19,7 +19,11 @@ namespace SabreTools.Models.LinearExecutable /// /// The signature consists of a string of three (3) ASCII characters: "NB0" /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// This defines the type of debugger data that exists in the remainder of the @@ -33,6 +37,10 @@ namespace SabreTools.Models.LinearExecutable /// the responsibility of the linker or debugging tools to follow the convention /// for the type field that is defined here. /// +#if NET48 public byte[] DebuggerData; +#else + public byte[]? DebuggerData; +#endif } } diff --git a/LinearExecutable/EntryTableBundle.cs b/LinearExecutable/EntryTableBundle.cs index d7c1b5f..edef68b 100644 --- a/LinearExecutable/EntryTableBundle.cs +++ b/LinearExecutable/EntryTableBundle.cs @@ -54,6 +54,10 @@ namespace SabreTools.Models.LinearExecutable /// /// Table entries in the bundle /// +#if NET48 public EntryTableEntry[] TableEntries; +#else + public EntryTableEntry[]? TableEntries; +#endif } } diff --git a/LinearExecutable/Executable.cs b/LinearExecutable/Executable.cs index 078ef86..3d24545 100644 --- a/LinearExecutable/Executable.cs +++ b/LinearExecutable/Executable.cs @@ -13,85 +13,149 @@ namespace SabreTools.Models.LinearExecutable /// /// MS-DOS executable stub /// +#if NET48 public MSDOS.Executable Stub { get; set; } +#else + public MSDOS.Executable? Stub { get; set; } +#endif /// /// Information block /// +#if NET48 public InformationBlock InformationBlock { get; set; } +#else + public InformationBlock? InformationBlock { get; set; } +#endif /// /// Object table /// +#if NET48 public ObjectTableEntry[] ObjectTable { get; set; } +#else + public ObjectTableEntry[]? ObjectTable { get; set; } +#endif /// /// Object page map /// +#if NET48 public ObjectPageMapEntry[] ObjectPageMap { get; set; } +#else + public ObjectPageMapEntry[]? ObjectPageMap { get; set; } +#endif // TODO: Object iterate data map table (Undefined) /// /// Resource table /// +#if NET48 public ResourceTableEntry[] ResourceTable { get; set; } +#else + public ResourceTableEntry[]? ResourceTable { get; set; } +#endif /// /// Resident Name table /// +#if NET48 public ResidentNamesTableEntry[] ResidentNamesTable { get; set; } +#else + public ResidentNamesTableEntry[]? ResidentNamesTable { get; set; } +#endif /// /// Entry table /// +#if NET48 public EntryTableBundle[] EntryTable { get; set; } +#else + public EntryTableBundle[]? EntryTable { get; set; } +#endif /// /// Module format directives table (optional) /// +#if NET48 public ModuleFormatDirectivesTableEntry[] ModuleFormatDirectivesTable { get; set; } +#else + public ModuleFormatDirectivesTableEntry[]? ModuleFormatDirectivesTable { get; set; } +#endif /// /// Verify record directive table (optional) /// +#if NET48 public VerifyRecordDirectiveTableEntry[] VerifyRecordDirectiveTable { get; set; } +#else + public VerifyRecordDirectiveTableEntry[]? VerifyRecordDirectiveTable { get; set; } +#endif /// /// Fix-up page table /// +#if NET48 public FixupPageTableEntry[] FixupPageTable { get; set; } +#else + public FixupPageTableEntry[]? FixupPageTable { get; set; } +#endif /// /// Fix-up record table /// +#if NET48 public FixupRecordTableEntry[] FixupRecordTable { get; set; } +#else + public FixupRecordTableEntry[]? FixupRecordTable { get; set; } +#endif /// /// Import module name table /// +#if NET48 public ImportModuleNameTableEntry[] ImportModuleNameTable { get; set; } +#else + public ImportModuleNameTableEntry[]? ImportModuleNameTable { get; set; } +#endif /// /// Import procedure name table /// +#if NET48 public ImportModuleProcedureNameTableEntry[] ImportModuleProcedureNameTable { get; set; } +#else + public ImportModuleProcedureNameTableEntry[]? ImportModuleProcedureNameTable { get; set; } +#endif /// /// Per-Page checksum table /// +#if NET48 public PerPageChecksumTableEntry[] PerPageChecksumTable { get; set; } +#else + public PerPageChecksumTableEntry[]? PerPageChecksumTable { get; set; } +#endif /// /// Non-Resident Name table /// +#if NET48 public NonResidentNamesTableEntry[] NonResidentNamesTable { get; set; } +#else + public NonResidentNamesTableEntry[]? NonResidentNamesTable { get; set; } +#endif // TODO: Non-resident directives data (Undefined) /// /// Debug information /// +#if NET48 public DebugInformation DebugInformation { get; set; } +#else + public DebugInformation? DebugInformation { get; set; } +#endif } } diff --git a/LinearExecutable/FixupRecordTableEntry.cs b/LinearExecutable/FixupRecordTableEntry.cs index ad52c03..eccbc1d 100644 --- a/LinearExecutable/FixupRecordTableEntry.cs +++ b/LinearExecutable/FixupRecordTableEntry.cs @@ -356,7 +356,11 @@ /// field. The source offsets are relative to the beginning of the page where the /// fixups are to be made. /// +#if NET48 public ushort[] SourceOffsetList; +#else + public ushort[]? SourceOffsetList; +#endif #endregion } diff --git a/LinearExecutable/ImportModuleNameTableEntry.cs b/LinearExecutable/ImportModuleNameTableEntry.cs index 04e9f88..8f80e32 100644 --- a/LinearExecutable/ImportModuleNameTableEntry.cs +++ b/LinearExecutable/ImportModuleNameTableEntry.cs @@ -36,6 +36,10 @@ namespace SabreTools.Models.LinearExecutable /// This is a variable length string with it's length defined in bytes by /// the LEN field. The string is case sensitive and is not null terminated. /// +#if NET48 public string Name; +#else + public string? Name; +#endif } } diff --git a/LinearExecutable/ImportProcedureNameTableEntry.cs b/LinearExecutable/ImportProcedureNameTableEntry.cs index e4de03d..4744893 100644 --- a/LinearExecutable/ImportProcedureNameTableEntry.cs +++ b/LinearExecutable/ImportProcedureNameTableEntry.cs @@ -44,6 +44,10 @@ namespace SabreTools.Models.LinearExecutable /// This is a variable length string with it's length defined in bytes by /// the LEN field. The string is case sensitive and is not null terminated. /// +#if NET48 public string Name; +#else + public string? Name; +#endif } } diff --git a/LinearExecutable/InformationBlock.cs b/LinearExecutable/InformationBlock.cs index ab74da3..17fe5f3 100644 --- a/LinearExecutable/InformationBlock.cs +++ b/LinearExecutable/InformationBlock.cs @@ -24,7 +24,11 @@ namespace SabreTools.Models.LinearExecutable /// The signature word is used by the loader to identify the EXE /// file as a valid 32-bit Linear Executable Module Format. /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Byte Ordering. diff --git a/LinearExecutable/NonResidentNamesTableEntry.cs b/LinearExecutable/NonResidentNamesTableEntry.cs index 1f729e7..eef1bc4 100644 --- a/LinearExecutable/NonResidentNamesTableEntry.cs +++ b/LinearExecutable/NonResidentNamesTableEntry.cs @@ -51,7 +51,11 @@ namespace SabreTools.Models.LinearExecutable /// This is a variable length string with it's length defined in bytes by the LEN field. /// The string is case case sensitive and is not null terminated. /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// Ordinal number. diff --git a/LinearExecutable/ResidentNamesTableEntry.cs b/LinearExecutable/ResidentNamesTableEntry.cs index 8743f3a..63520e9 100644 --- a/LinearExecutable/ResidentNamesTableEntry.cs +++ b/LinearExecutable/ResidentNamesTableEntry.cs @@ -51,7 +51,11 @@ namespace SabreTools.Models.LinearExecutable /// This is a variable length string with it's length defined in bytes by the LEN field. /// The string is case case sensitive and is not null terminated. /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// Ordinal number. diff --git a/MSDOS/Executable.cs b/MSDOS/Executable.cs index 233d316..cabefe7 100644 --- a/MSDOS/Executable.cs +++ b/MSDOS/Executable.cs @@ -14,7 +14,11 @@ namespace SabreTools.Models.MSDOS /// /// MS-DOS executable header /// +#if NET48 public ExecutableHeader Header { get; set; } +#else + public ExecutableHeader? Header { get; set; } +#endif /// /// After loading the executable into memory, the program loader goes through @@ -24,6 +28,10 @@ namespace SabreTools.Models.MSDOS /// make the loader add start segment address to the value at offset /// 1*0x10+0x1A=0x2A within the program data. /// +#if NET48 public RelocationEntry[] RelocationTable { get; set; } +#else + public RelocationEntry[]? RelocationTable { get; set; } +#endif } } diff --git a/MSDOS/ExecutableHeader.cs b/MSDOS/ExecutableHeader.cs index d181315..dfbdc58 100644 --- a/MSDOS/ExecutableHeader.cs +++ b/MSDOS/ExecutableHeader.cs @@ -17,7 +17,11 @@ namespace SabreTools.Models.MSDOS /// 0x5A4D (ASCII for 'M' and 'Z') /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] +#if NET48 public string Magic; +#else + public string? Magic; +#endif /// /// Number of bytes in the last page. @@ -102,7 +106,11 @@ namespace SabreTools.Models.MSDOS /// Reserved words /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] +#if NET48 public ushort[] Reserved1; +#else + public ushort[]? Reserved1; +#endif /// /// Defined by name but no other information is given; typically zeroes @@ -118,7 +126,11 @@ namespace SabreTools.Models.MSDOS /// Reserved words /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] +#if NET48 public ushort[] Reserved2; +#else + public ushort[]? Reserved2; +#endif /// /// Starting address of the PE header diff --git a/MicrosoftCabinet/CFDATA.cs b/MicrosoftCabinet/CFDATA.cs index b973f1e..fc29762 100644 --- a/MicrosoftCabinet/CFDATA.cs +++ b/MicrosoftCabinet/CFDATA.cs @@ -37,7 +37,11 @@ namespace SabreTools.Models.MicrosoftCabinet /// 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. /// +#if NET48 public byte[] ReservedData; +#else + public byte[]? ReservedData; +#endif /// /// The compressed data bytes, compressed by using the @@ -47,6 +51,10 @@ namespace SabreTools.Models.MicrosoftCabinet /// uncompressed data bytes. In this case, the and field values will be equal unless /// this CFDATA structure entry crosses a cabinet file boundary. /// +#if NET48 public byte[] CompressedData; +#else + public byte[]? CompressedData; +#endif } } diff --git a/MicrosoftCabinet/CFFILE.cs b/MicrosoftCabinet/CFFILE.cs index b8bf56f..32c131f 100644 --- a/MicrosoftCabinet/CFFILE.cs +++ b/MicrosoftCabinet/CFFILE.cs @@ -63,6 +63,10 @@ namespace SabreTools.Models.MicrosoftCabinet /// CFFILE.szName field, but the _A_NAME_IS_UTF attribute is not set, the characters SHOULD be /// interpreted according to the current location. /// +#if NET48 public string Name; +#else + public string? Name; +#endif } } diff --git a/MicrosoftCabinet/CFFOLDER.cs b/MicrosoftCabinet/CFFOLDER.cs index a8d298d..c24091f 100644 --- a/MicrosoftCabinet/CFFOLDER.cs +++ b/MicrosoftCabinet/CFFOLDER.cs @@ -50,11 +50,19 @@ namespace SabreTools.Models.MicrosoftCabinet /// 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. /// +#if NET48 public byte[] ReservedData; +#else + public byte[]? ReservedData; +#endif /// /// Data blocks associated with this folder /// +#if NET48 public CFDATA[] DataBlocks; +#else + public CFDATA[]? DataBlocks; +#endif } } diff --git a/MicrosoftCabinet/CFHEADER.cs b/MicrosoftCabinet/CFHEADER.cs index 5054b33..379ada3 100644 --- a/MicrosoftCabinet/CFHEADER.cs +++ b/MicrosoftCabinet/CFHEADER.cs @@ -14,7 +14,11 @@ namespace SabreTools.Models.MicrosoftCabinet /// Contains the characters "M", "S", "C", and "F" (bytes 0x4D, 0x53, 0x43, /// 0x46). This field is used to ensure that the file is a cabinet (.cab) file. /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Reserved field; MUST be set to 0 (zero). @@ -110,7 +114,11 @@ namespace SabreTools.Models.MicrosoftCabinet /// 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. /// +#if NET48 public byte[] ReservedData; +#else + public byte[]? ReservedData; +#endif /// /// If the flags.cfhdrPREV_CABINET field is not set, this @@ -122,7 +130,11 @@ namespace SabreTools.Models.MicrosoftCabinet /// reported to begin in the "previous cabinet," the szCabinetPrev field would indicate the name of the /// cabinet to examine. /// +#if NET48 public string CabinetPrev; +#else + public string? CabinetPrev; +#endif /// /// If the flags.cfhdrPREV_CABINET field is not set, then this @@ -131,7 +143,11 @@ namespace SabreTools.Models.MicrosoftCabinet /// This string can be used when prompting the user to insert a disk. The string can contain up to 255 /// bytes, plus the null byte. /// +#if NET48 public string DiskPrev; +#else + public string? DiskPrev; +#endif /// /// If the flags.cfhdrNEXT_CABINET field is not set, this @@ -139,7 +155,11 @@ namespace SabreTools.Models.MicrosoftCabinet /// cabinet file in a set. The string can contain up to 255 bytes, plus the null byte. Files that extend /// beyond the end of the current cabinet file are continued in the named cabinet file. /// +#if NET48 public string CabinetNext; +#else + public string? CabinetNext; +#endif /// /// If the flags.cfhdrNEXT_CABINET field is not set, this field is @@ -148,6 +168,10 @@ namespace SabreTools.Models.MicrosoftCabinet /// string can contain up to 255 bytes, plus the null byte. This string can be used when prompting the /// user to insert a disk. /// +#if NET48 public string DiskNext; +#else + public string? DiskNext; +#endif } } diff --git a/MicrosoftCabinet/Cabinet.cs b/MicrosoftCabinet/Cabinet.cs index 14e6a82..9759877 100644 --- a/MicrosoftCabinet/Cabinet.cs +++ b/MicrosoftCabinet/Cabinet.cs @@ -12,16 +12,28 @@ /// /// Cabinet header /// +#if NET48 public CFHEADER Header { get; set; } +#else + public CFHEADER? Header { get; set; } +#endif /// /// One or more CFFOLDER entries /// +#if NET48 public CFFOLDER[] Folders { get; set; } +#else + public CFFOLDER[]? Folders { get; set; } +#endif /// /// A series of one or more cabinet file (CFFILE) entries /// +#if NET48 public CFFILE[] Files { get; set; } +#else + public CFFILE[]? Files { get; set; } +#endif } } diff --git a/MoPaQ/Archive.cs b/MoPaQ/Archive.cs index a211e77..6143254 100644 --- a/MoPaQ/Archive.cs +++ b/MoPaQ/Archive.cs @@ -14,12 +14,20 @@ /// /// MPQ User Data (optional) /// +#if NET48 public UserData UserData { get; set; } +#else + public UserData? UserData { get; set; } +#endif /// /// MPQ Header (required) /// +#if NET48 public ArchiveHeader ArchiveHeader { get; set; } +#else + public ArchiveHeader? ArchiveHeader { get; set; } +#endif // TODO: Files (optional) // TODO: Special files (optional) @@ -27,22 +35,38 @@ /// /// HET Table (optional) /// +#if NET48 public HetTable HetTable { get; set; } +#else + public HetTable? HetTable { get; set; } +#endif /// /// BET Table (optional) /// +#if NET48 public BetTable BetTable { get; set; } +#else + public BetTable? BetTable { get; set; } +#endif /// /// Hash Table (optional) /// +#if NET48 public HashEntry[] HashTable { get; set; } +#else + public HashEntry[]? HashTable { get; set; } +#endif /// /// Block Table (optional) /// +#if NET48 public BlockEntry[] BlockTable { get; set; } +#else + public BlockEntry[]? BlockTable { get; set; } +#endif /// /// Hi-Block Table (optional) @@ -54,7 +78,11 @@ /// Hi-block table is plain array of 16-bit values. This table is /// not encrypted. /// +#if NET48 public short[] HiBlockTable { get; set; } +#else + public short[]? HiBlockTable { get; set; } +#endif // TODO: Strong digital signature } diff --git a/MoPaQ/ArchiveHeader.cs b/MoPaQ/ArchiveHeader.cs index 9639892..9cdd360 100644 --- a/MoPaQ/ArchiveHeader.cs +++ b/MoPaQ/ArchiveHeader.cs @@ -14,7 +14,11 @@ namespace SabreTools.Models.MoPaQ /// /// The MPQ archive signature /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Size of the archive header @@ -143,37 +147,61 @@ namespace SabreTools.Models.MoPaQ /// MD5 of the block table before decryption /// /// 0x10 bytes +#if NET48 public byte[] BlockTableMD5; +#else + public byte[]? BlockTableMD5; +#endif /// /// MD5 of the hash table before decryption /// /// 0x10 bytes +#if NET48 public byte[] HashTableMD5; +#else + public byte[]? HashTableMD5; +#endif /// /// MD5 of the hi-block table /// /// 0x10 bytes +#if NET48 public byte[] HiBlockTableMD5; +#else + public byte[]? HiBlockTableMD5; +#endif /// /// MD5 of the BET table before decryption /// /// 0x10 bytes +#if NET48 public byte[] BetTableMD5; +#else + public byte[]? BetTableMD5; +#endif /// /// MD5 of the HET table before decryption /// /// 0x10 bytes +#if NET48 public byte[] HetTableMD5; +#else + public byte[]? HetTableMD5; +#endif /// /// MD5 of the MPQ header from signature to (including) HetTableMD5 /// /// 0x10 bytes +#if NET48 public byte[] MpqHeaderMD5; +#else + public byte[]? MpqHeaderMD5; +#endif #endregion } diff --git a/MoPaQ/BetTable.cs b/MoPaQ/BetTable.cs index 7924c58..9bf1449 100644 --- a/MoPaQ/BetTable.cs +++ b/MoPaQ/BetTable.cs @@ -17,7 +17,11 @@ namespace SabreTools.Models.MoPaQ /// /// 'BET\x1A' /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Version. Seems to be always 1 @@ -130,7 +134,11 @@ namespace SabreTools.Models.MoPaQ /// Followed by array of file flags. Each entry is 32-bit size and its meaning is the same like /// /// Size from +#if NET48 public uint[] FlagsArray; +#else + public uint[]? FlagsArray; +#endif // File table. Size of each entry is taken from dwTableEntrySize. // Size of the table is (dwTableEntrySize * dwMaxFileCount), round up to 8. diff --git a/MoPaQ/HetTable.cs b/MoPaQ/HetTable.cs index 1162270..39fe234 100644 --- a/MoPaQ/HetTable.cs +++ b/MoPaQ/HetTable.cs @@ -18,7 +18,11 @@ namespace SabreTools.Models.MoPaQ /// /// 'HET\x1A' /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Version. Seems to be always 1 @@ -76,12 +80,20 @@ namespace SabreTools.Models.MoPaQ /// HET hash table. Each entry is 8 bits. /// /// Size is derived from HashTableSize +#if NET48 public byte[] HashTable; +#else + public byte[]? HashTable; +#endif /// /// Array of file indexes. Bit size of each entry is taken from dwTotalIndexSize. /// Table size is taken from dwHashTableSize. /// +#if NET48 public byte[][] FileIndexes; +#else + public byte[][]? FileIndexes; +#endif } } diff --git a/MoPaQ/PatchHeader.cs b/MoPaQ/PatchHeader.cs index c98f38b..3b47be2 100644 --- a/MoPaQ/PatchHeader.cs +++ b/MoPaQ/PatchHeader.cs @@ -49,12 +49,20 @@ namespace SabreTools.Models.MoPaQ /// /// MD5 of the original (unpached) file /// +#if NET48 public byte[] Md5BeforePatch { get; private set; } = new byte[0x10]; +#else + public byte[]? Md5BeforePatch { get; private set; } = new byte[0x10]; +#endif /// /// MD5 of the patched file /// +#if NET48 public byte[] Md5AfterPatch { get; private set; } = new byte[0x10]; +#else + public byte[]? Md5AfterPatch { get; private set; } = new byte[0x10]; +#endif #endregion @@ -111,7 +119,11 @@ namespace SabreTools.Models.MoPaQ /// /// File data are simply replaced by the data in the patch. /// +#if NET48 public byte[] PatchDataCopy { get; private set; } +#else + public byte[]? PatchDataCopy { get; private set; } +#endif #endregion } diff --git a/MoPaQ/PatchInfo.cs b/MoPaQ/PatchInfo.cs index 125f1a4..63b6b5c 100644 --- a/MoPaQ/PatchInfo.cs +++ b/MoPaQ/PatchInfo.cs @@ -28,11 +28,19 @@ namespace SabreTools.Models.MoPaQ /// MD5 of the entire patch file after decompression /// /// 0x10 bytes +#if NET48 public byte[] MD5; +#else + public byte[]? MD5; +#endif /// /// The sector offset table (variable length) /// +#if NET48 public uint[] SectorOffsetTable; +#else + public uint[]? SectorOffsetTable; +#endif } } diff --git a/MoPaQ/UserData.cs b/MoPaQ/UserData.cs index ccc4a61..ad3ee70 100644 --- a/MoPaQ/UserData.cs +++ b/MoPaQ/UserData.cs @@ -15,7 +15,11 @@ namespace SabreTools.Models.MoPaQ /// The user data signature /// /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Maximum size of the user data diff --git a/N3DS/ARM11KernelCapabilities.cs b/N3DS/ARM11KernelCapabilities.cs index 48ed34c..5d2f912 100644 --- a/N3DS/ARM11KernelCapabilities.cs +++ b/N3DS/ARM11KernelCapabilities.cs @@ -34,11 +34,19 @@ /// 13 Process has access to CPU core 2 (New3DS only) /// /// TODO: Make enum for flag values +#if NET48 public uint[] Descriptors; +#else + public uint[]? Descriptors; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif } } diff --git a/N3DS/ARM11LocalSystemCapabilities.cs b/N3DS/ARM11LocalSystemCapabilities.cs index 2ac29b3..7f44a17 100644 --- a/N3DS/ARM11LocalSystemCapabilities.cs +++ b/N3DS/ARM11LocalSystemCapabilities.cs @@ -36,27 +36,47 @@ /// /// Resource limit descriptors. The first byte here controls the maximum allowed CpuTime. /// +#if NET48 public ushort[] ResourceLimitDescriptors; +#else + public ushort[]? ResourceLimitDescriptors; +#endif /// /// Storage info /// +#if NET48 public StorageInfo StorageInfo; +#else + public StorageInfo? StorageInfo; +#endif /// /// Service access control /// +#if NET48 public ulong[] ServiceAccessControl; +#else + public ulong[]? ServiceAccessControl; +#endif /// /// Extended service access control, support for this was implemented with 9.3.0-X. /// +#if NET48 public ulong[] ExtendedServiceAccessControl; +#else + public ulong[]? ExtendedServiceAccessControl; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif /// /// Resource limit category. (0 = APPLICATION, 1 = SYS_APPLET, 2 = LIB_APPLET, 3 = OTHER (sysmodules running under the BASE memregion)) diff --git a/N3DS/ARM9AccessControl.cs b/N3DS/ARM9AccessControl.cs index baf6b5e..37215ae 100644 --- a/N3DS/ARM9AccessControl.cs +++ b/N3DS/ARM9AccessControl.cs @@ -6,7 +6,11 @@ /// /// Descriptors /// +#if NET48 public byte[] Descriptors; +#else + public byte[]? Descriptors; +#endif /// /// ARM9 Descriptor Version. Originally this value had to be ≥ 2. diff --git a/N3DS/AccessControlInfo.cs b/N3DS/AccessControlInfo.cs index 88f5db0..acfd052 100644 --- a/N3DS/AccessControlInfo.cs +++ b/N3DS/AccessControlInfo.cs @@ -6,16 +6,28 @@ /// /// ARM11 local system capabilities /// +#if NET48 public ARM11LocalSystemCapabilities ARM11LocalSystemCapabilities; +#else + public ARM11LocalSystemCapabilities? ARM11LocalSystemCapabilities; +#endif /// /// ARM11 kernel capabilities /// +#if NET48 public ARM11KernelCapabilities ARM11KernelCapabilities; +#else + public ARM11KernelCapabilities? ARM11KernelCapabilities; +#endif /// /// ARM9 access control /// +#if NET48 public ARM9AccessControl ARM9AccessControl; +#else + public ARM9AccessControl? ARM9AccessControl; +#endif } } diff --git a/N3DS/CIA.cs b/N3DS/CIA.cs index e28cdf2..81ae4c9 100644 --- a/N3DS/CIA.cs +++ b/N3DS/CIA.cs @@ -17,7 +17,11 @@ namespace SabreTools.Models.N3DS /// /// CIA header /// +#if NET48 public CIAHeader Header { get; set; } +#else + public CIAHeader? Header { get; set; } +#endif /// /// Certificate chain @@ -25,32 +29,56 @@ namespace SabreTools.Models.N3DS /// /// https://www.3dbrew.org/wiki/CIA#Certificate_Chain /// +#if NET48 public Certificate[] CertificateChain { get; set; } +#else + public Certificate[]? CertificateChain { get; set; } +#endif /// /// Ticket /// +#if NET48 public Ticket Ticket { get; set; } +#else + public Ticket? Ticket { get; set; } +#endif /// /// TMD file data /// +#if NET48 public TitleMetadata TMDFileData { get; set; } +#else + public TitleMetadata? TMDFileData { get; set; } +#endif /// /// Content file data /// +#if NET48 public NCCHHeader[] Partitions { get; set; } +#else + public NCCHHeader[]? Partitions { get; set; } +#endif /// /// Content file data /// /// TODO: Parse the content file data +#if NET48 public byte[] ContentFileData { get; set; } +#else + public byte[]? ContentFileData { get; set; } +#endif /// /// Meta file data (Not a necessary component) /// +#if NET48 public MetaData MetaData { get; set; } +#else + public MetaData? MetaData { get; set; } +#endif } } \ No newline at end of file diff --git a/N3DS/CIAHeader.cs b/N3DS/CIAHeader.cs index f14fce6..4de5972 100644 --- a/N3DS/CIAHeader.cs +++ b/N3DS/CIAHeader.cs @@ -46,6 +46,10 @@ namespace SabreTools.Models.N3DS /// /// Content Index /// +#if NET48 public byte[] ContentIndex; +#else + public byte[]? ContentIndex; +#endif } } \ No newline at end of file diff --git a/N3DS/CardInfoHeader.cs b/N3DS/CardInfoHeader.cs index 15f7f06..640f079 100644 --- a/N3DS/CardInfoHeader.cs +++ b/N3DS/CardInfoHeader.cs @@ -16,7 +16,11 @@ namespace SabreTools.Models.N3DS /// /// Reserved /// +#if NET48 public byte[] Reserved1; +#else + public byte[]? Reserved1; +#endif /// /// Filled size of cartridge @@ -26,7 +30,11 @@ namespace SabreTools.Models.N3DS /// /// Reserved /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// Title version @@ -41,12 +49,20 @@ namespace SabreTools.Models.N3DS /// /// Reserved /// +#if NET48 public byte[] Reserved3; +#else + public byte[]? Reserved3; +#endif /// /// Title ID of CVer in included update partition /// +#if NET48 public byte[] CVerTitleID; +#else + public byte[]? CVerTitleID; +#endif /// /// Version number of CVer in included update partition @@ -56,6 +72,10 @@ namespace SabreTools.Models.N3DS /// /// Reserved /// +#if NET48 public byte[] Reserved4; +#else + public byte[]? Reserved4; +#endif } } diff --git a/N3DS/Cart.cs b/N3DS/Cart.cs index 69205ef..498a943 100644 --- a/N3DS/Cart.cs +++ b/N3DS/Cart.cs @@ -8,36 +8,64 @@ namespace SabreTools.Models.N3DS /// /// 3DS cart header /// +#if NET48 public NCSDHeader Header { get; set; } +#else + public NCSDHeader? Header { get; set; } +#endif /// /// 3DS card info header /// +#if NET48 public CardInfoHeader CardInfoHeader { get; set; } +#else + public CardInfoHeader? CardInfoHeader { get; set; } +#endif /// /// 3DS development card info header /// +#if NET48 public DevelopmentCardInfoHeader DevelopmentCardInfoHeader { get; set; } +#else + public DevelopmentCardInfoHeader? DevelopmentCardInfoHeader { get; set; } +#endif /// /// NCCH partitions /// +#if NET48 public NCCHHeader[] Partitions { get; set; } +#else + public NCCHHeader[]? Partitions { get; set; } +#endif /// /// NCCH extended headers /// +#if NET48 public NCCHExtendedHeader[] ExtendedHeaders { get; set; } +#else + public NCCHExtendedHeader[]? ExtendedHeaders { get; set; } +#endif /// /// ExeFS headers associated with each partition /// +#if NET48 public ExeFSHeader[] ExeFSHeaders { get; set; } +#else + public ExeFSHeader[]? ExeFSHeaders { get; set; } +#endif /// /// RomFS headers associated with each partition /// +#if NET48 public RomFSHeader[] RomFSHeaders { get; set; } +#else + public RomFSHeader[]? RomFSHeaders { get; set; } +#endif } } \ No newline at end of file diff --git a/N3DS/Certificate.cs b/N3DS/Certificate.cs index 0f24749..d72d9d5 100644 --- a/N3DS/Certificate.cs +++ b/N3DS/Certificate.cs @@ -27,17 +27,29 @@ namespace SabreTools.Models.N3DS /// /// Signature /// +#if NET48 public byte[] Signature; +#else + public byte[]? Signature; +#endif /// /// Padding to align next data to 0x40 bytes /// +#if NET48 public byte[] Padding; +#else + public byte[]? Padding; +#endif /// /// Issuer /// +#if NET48 public string Issuer; +#else + public string? Issuer; +#endif /// /// Key Type @@ -47,7 +59,11 @@ namespace SabreTools.Models.N3DS /// /// Name /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// Expiration time as UNIX Timestamp, used at least for CTCert @@ -60,7 +76,11 @@ namespace SabreTools.Models.N3DS /// /// Modulus /// +#if NET48 public byte[] RSAModulus; +#else + public byte[]? RSAModulus; +#endif /// /// Public Exponent @@ -70,7 +90,11 @@ namespace SabreTools.Models.N3DS /// /// Padding /// +#if NET48 public byte[] RSAPadding; +#else + public byte[]? RSAPadding; +#endif #endregion @@ -80,12 +104,20 @@ namespace SabreTools.Models.N3DS /// /// Public Key /// +#if NET48 public byte[] ECCPublicKey; +#else + public byte[]? ECCPublicKey; +#endif /// /// Padding /// +#if NET48 public byte[] ECCPadding; +#else + public byte[]? ECCPadding; +#endif #endregion } diff --git a/N3DS/ContentChunkRecord.cs b/N3DS/ContentChunkRecord.cs index 4ed0024..e22412e 100644 --- a/N3DS/ContentChunkRecord.cs +++ b/N3DS/ContentChunkRecord.cs @@ -33,6 +33,10 @@ namespace SabreTools.Models.N3DS /// /// SHA-256 hash /// +#if NET48 public byte[] SHA256Hash; +#else + public byte[]? SHA256Hash; +#endif } } \ No newline at end of file diff --git a/N3DS/ContentInfoRecord.cs b/N3DS/ContentInfoRecord.cs index c963799..6b93f1c 100644 --- a/N3DS/ContentInfoRecord.cs +++ b/N3DS/ContentInfoRecord.cs @@ -19,6 +19,10 @@ namespace SabreTools.Models.N3DS /// /// SHA-256 hash of the next k content records that have not been hashed yet /// +#if NET48 public byte[] UnhashedContentRecordsSHA256Hash; +#else + public byte[]? UnhashedContentRecordsSHA256Hash; +#endif } } \ No newline at end of file diff --git a/N3DS/DevelopmentCardInfoHeader.cs b/N3DS/DevelopmentCardInfoHeader.cs index f1af4c2..43e98ae 100644 --- a/N3DS/DevelopmentCardInfoHeader.cs +++ b/N3DS/DevelopmentCardInfoHeader.cs @@ -6,26 +6,46 @@ namespace SabreTools.Models.N3DS /// /// InitialData /// +#if NET48 public InitialData InitialData; +#else + public InitialData? InitialData; +#endif /// /// CardDeviceReserved1 /// +#if NET48 public byte[] CardDeviceReserved1; +#else + public byte[]? CardDeviceReserved1; +#endif /// /// TitleKey /// +#if NET48 public byte[] TitleKey; +#else + public byte[]? TitleKey; +#endif /// /// CardDeviceReserved2 /// +#if NET48 public byte[] CardDeviceReserved2; +#else + public byte[]? CardDeviceReserved2; +#endif /// /// TestData /// +#if NET48 public TestData TestData; +#else + public TestData? TestData; +#endif } } diff --git a/N3DS/ExeFSFileHeader.cs b/N3DS/ExeFSFileHeader.cs index 2a0eecb..1eb2b8c 100644 --- a/N3DS/ExeFSFileHeader.cs +++ b/N3DS/ExeFSFileHeader.cs @@ -13,7 +13,11 @@ /// /// File name /// +#if NET48 public string FileName; +#else + public string? FileName; +#endif /// /// File offset @@ -28,6 +32,10 @@ /// /// SHA256 hash calculated over the entire file contents /// +#if NET48 public byte[] FileHash; +#else + public byte[]? FileHash; +#endif } } diff --git a/N3DS/ExeFSHeader.cs b/N3DS/ExeFSHeader.cs index 7d9a229..8d5113a 100644 --- a/N3DS/ExeFSHeader.cs +++ b/N3DS/ExeFSHeader.cs @@ -16,17 +16,29 @@ /// /// File headers (10 headers maximum, 16 bytes each) /// +#if NET48 public ExeFSFileHeader[] FileHeaders; +#else + public ExeFSFileHeader[]? FileHeaders; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif /// /// File hashes (10 hashes maximum, 32 bytes each, one for each header) /// /// SHA-256 hashes +#if NET48 public byte[][] FileHashes; +#else + public byte[][]? FileHashes; +#endif } } diff --git a/N3DS/InitialData.cs b/N3DS/InitialData.cs index e476cfa..b4924cf 100644 --- a/N3DS/InitialData.cs +++ b/N3DS/InitialData.cs @@ -6,31 +6,55 @@ namespace SabreTools.Models.N3DS /// /// Card seed keyY (first u64 is Media ID (same as first NCCH partitionId)) /// +#if NET48 public byte[] CardSeedKeyY; +#else + public byte[]? CardSeedKeyY; +#endif /// /// Encrypted card seed (AES-CCM, keyslot 0x3B for retail cards, see CTRCARD_SECSEED) /// +#if NET48 public byte[] EncryptedCardSeed; +#else + public byte[]? EncryptedCardSeed; +#endif /// /// Card seed AES-MAC /// +#if NET48 public byte[] CardSeedAESMAC; +#else + public byte[]? CardSeedAESMAC; +#endif /// /// Card seed nonce /// +#if NET48 public byte[] CardSeedNonce; +#else + public byte[]? CardSeedNonce; +#endif /// /// Reserved3 /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif /// /// Copy of first NCCH header (excluding RSA signature) /// +#if NET48 public NCCHHeader BackupHeader; +#else + public NCCHHeader? BackupHeader; +#endif } } diff --git a/N3DS/MetaData.cs b/N3DS/MetaData.cs index 4361dff..9301a53 100644 --- a/N3DS/MetaData.cs +++ b/N3DS/MetaData.cs @@ -7,12 +7,20 @@ namespace SabreTools.Models.N3DS /// Title ID dependency list - Taken from the application's ExHeader /// /// TODO: Determine numeric format of each entry +#if NET48 public byte[] TitleIDDependencyList; +#else + public byte[]? TitleIDDependencyList; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved1; +#else + public byte[]? Reserved1; +#endif /// /// Core Version @@ -22,11 +30,19 @@ namespace SabreTools.Models.N3DS /// /// Reserved /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// Icon Data(.ICN) - Taken from the application's ExeFS /// +#if NET48 public byte[] IconData; +#else + public byte[]? IconData; +#endif } } \ No newline at end of file diff --git a/N3DS/NCCHExtendedHeader.cs b/N3DS/NCCHExtendedHeader.cs index 8a60350..7f3f79d 100644 --- a/N3DS/NCCHExtendedHeader.cs +++ b/N3DS/NCCHExtendedHeader.cs @@ -11,26 +11,46 @@ /// /// SCI /// +#if NET48 public SystemControlInfo SCI; +#else + public SystemControlInfo? SCI; +#endif /// /// ACI /// +#if NET48 public AccessControlInfo ACI; +#else + public AccessControlInfo? ACI; +#endif /// /// AccessDesc signature (RSA-2048-SHA256) /// +#if NET48 public byte[] AccessDescSignature; +#else + public byte[]? AccessDescSignature; +#endif /// /// NCCH HDR RSA-2048 public key /// +#if NET48 public byte[] NCCHHDRPublicKey; +#else + public byte[]? NCCHHDRPublicKey; +#endif /// /// ACI (for limitation of first ACI) /// +#if NET48 public AccessControlInfo ACIForLimitations; +#else + public AccessControlInfo? ACIForLimitations; +#endif } } diff --git a/N3DS/NCCHHeader.cs b/N3DS/NCCHHeader.cs index 3f916fa..52d6532 100644 --- a/N3DS/NCCHHeader.cs +++ b/N3DS/NCCHHeader.cs @@ -6,12 +6,20 @@ /// /// RSA-2048 signature of the NCCH header, using SHA-256. /// +#if NET48 public byte[] RSA2048Signature; +#else + public byte[]? RSA2048Signature; +#endif /// /// Magic ID, always 'NCCH' /// +#if NET48 public string MagicID; +#else + public string? MagicID; +#endif /// /// Content size, in media units (1 media unit = 0x200 bytes) @@ -44,27 +52,47 @@ /// /// Program ID /// +#if NET48 public byte[] ProgramId; +#else + public byte[]? ProgramId; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved1; +#else + public byte[]? Reserved1; +#endif /// /// Logo Region SHA-256 hash. (For applications built with SDK 5+) (Supported from firmware: 5.0.0-11) /// +#if NET48 public byte[] LogoRegionHash; +#else + public byte[]? LogoRegionHash; +#endif /// /// Product code /// +#if NET48 public string ProductCode; +#else + public string? ProductCode; +#endif /// /// Extended header SHA-256 hash (SHA256 of 2x Alignment Size, beginning at 0x0 of ExHeader) /// +#if NET48 public byte[] ExtendedHeaderHash; +#else + public byte[]? ExtendedHeaderHash; +#endif /// /// Extended header size, in bytes @@ -74,12 +102,20 @@ /// /// Reserved /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// Flags /// +#if NET48 public NCCHHeaderFlags Flags; +#else + public NCCHHeaderFlags? Flags; +#endif /// /// Plain region offset, in media units @@ -119,7 +155,11 @@ /// /// Reserved /// +#if NET48 public byte[] Reserved3; +#else + public byte[]? Reserved3; +#endif /// /// RomFS offset, in media units @@ -139,18 +179,30 @@ /// /// Reserved /// +#if NET48 public byte[] Reserved4; +#else + public byte[]? Reserved4; +#endif /// /// ExeFS superblock SHA-256 hash - (SHA-256 hash, starting at 0x0 of the ExeFS over the number of /// media units specified in the ExeFS hash region size) /// +#if NET48 public byte[] ExeFSSuperblockHash; +#else + public byte[]? ExeFSSuperblockHash; +#endif /// /// RomFS superblock SHA-256 hash - (SHA-256 hash, starting at 0x0 of the RomFS over the number /// of media units specified in the RomFS hash region size) /// +#if NET48 public byte[] RomFSSuperblockHash; +#else + public byte[]? RomFSSuperblockHash; +#endif } } diff --git a/N3DS/NCSDHeader.cs b/N3DS/NCSDHeader.cs index a27c43a..fe0ad68 100644 --- a/N3DS/NCSDHeader.cs +++ b/N3DS/NCSDHeader.cs @@ -16,12 +16,20 @@ /// /// RSA-2048 SHA-256 signature of the NCSD header /// +#if NET48 public byte[] RSA2048Signature; +#else + public byte[]? RSA2048Signature; +#endif /// /// Magic Number 'NCSD' /// +#if NET48 public string MagicNumber; +#else + public string? MagicNumber; +#endif /// /// Size of the NCSD image, in media units (1 media unit = 0x200 bytes) @@ -31,7 +39,11 @@ /// /// Media ID /// +#if NET48 public byte[] MediaId; +#else + public byte[]? MediaId; +#endif /// /// Partitions FS type (0=None, 1=Normal, 3=FIRM, 4=AGB_FIRM save) @@ -41,12 +53,20 @@ /// /// Partitions crypt type (each byte corresponds to a partition in the partition table) /// +#if NET48 public byte[] PartitionsCryptType; +#else + public byte[]? PartitionsCryptType; +#endif /// /// Offset & Length partition table, in media units /// +#if NET48 public PartitionTableEntry[] PartitionsTable; +#else + public PartitionTableEntry[]? PartitionsTable; +#endif #endregion @@ -55,7 +75,11 @@ /// /// Exheader SHA-256 hash /// +#if NET48 public byte[] ExheaderHash; +#else + public byte[]? ExheaderHash; +#endif /// /// Additional header size @@ -70,22 +94,38 @@ /// /// Partition Flags /// +#if NET48 public byte[] PartitionFlags; +#else + public byte[]? PartitionFlags; +#endif /// /// Partition ID table /// +#if NET48 public ulong[] PartitionIdTable; +#else + public ulong[]? PartitionIdTable; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved1; +#else + public byte[]? Reserved1; +#endif /// /// Reserved? /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// Support for this was implemented with 9.6.0-X FIRM. Bit0=1 enables using bits 1-2, it's unknown @@ -107,12 +147,20 @@ /// /// Unknown /// +#if NET48 public byte[] Unknown; +#else + public byte[]? Unknown; +#endif /// /// Encrypted MBR partition-table, for the TWL partitions(key-data used for this keyslot is console-unique). /// +#if NET48 public byte[] EncryptedMBR; +#else + public byte[]? EncryptedMBR; +#endif #endregion } diff --git a/N3DS/RomFSHeader.cs b/N3DS/RomFSHeader.cs index a05ac2d..9a35f8e 100644 --- a/N3DS/RomFSHeader.cs +++ b/N3DS/RomFSHeader.cs @@ -11,7 +11,11 @@ /// /// Magic "IVFC" /// +#if NET48 public string MagicString; +#else + public string? MagicString; +#endif /// /// Magic number 0x10000 @@ -41,7 +45,11 @@ /// /// Reserved /// +#if NET48 public byte[] Reserved1; +#else + public byte[]? Reserved1; +#endif /// /// Level 2 logical offset @@ -61,7 +69,11 @@ /// /// Reserved /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// Level 3 logical offset @@ -81,12 +93,20 @@ /// /// Reserved /// +#if NET48 public byte[] Reserved3; +#else + public byte[]? Reserved3; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved4; +#else + public byte[]? Reserved4; +#endif /// /// Optional info size. diff --git a/N3DS/StorageInfo.cs b/N3DS/StorageInfo.cs index 079a841..b3300b9 100644 --- a/N3DS/StorageInfo.cs +++ b/N3DS/StorageInfo.cs @@ -14,19 +14,31 @@ /// /// System savedata IDs /// +#if NET48 public byte[] SystemSavedataIDs; +#else + public byte[]? SystemSavedataIDs; +#endif /// /// Storage accessible unique IDs /// +#if NET48 public byte[] StorageAccessibleUniqueIDs; +#else + public byte[]? StorageAccessibleUniqueIDs; +#endif /// /// Filesystem access info /// /// TODO: Create enum for the flag values /// TODO: Combine with "other attributes" +#if NET48 public byte[] FileSystemAccessInfo; +#else + public byte[]? FileSystemAccessInfo; +#endif /// /// Other attributes diff --git a/N3DS/SystemControlInfo.cs b/N3DS/SystemControlInfo.cs index c3438bd..b15d3fa 100644 --- a/N3DS/SystemControlInfo.cs +++ b/N3DS/SystemControlInfo.cs @@ -6,12 +6,20 @@ /// /// Application title (default is "CtrApp") /// +#if NET48 public string ApplicationTitle; +#else + public string? ApplicationTitle; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved1; +#else + public byte[]? Reserved1; +#endif /// /// Flag (bit 0: CompressExefsCode, bit 1: SDApplication) @@ -26,7 +34,11 @@ /// /// Text code set info /// +#if NET48 public CodeSetInfo TextCodeSetInfo; +#else + public CodeSetInfo? TextCodeSetInfo; +#endif /// /// Stack size @@ -36,17 +48,29 @@ /// /// Read-only code set info /// +#if NET48 public CodeSetInfo ReadOnlyCodeSetInfo; +#else + public CodeSetInfo? ReadOnlyCodeSetInfo; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// Data code set info /// +#if NET48 public CodeSetInfo DataCodeSetInfo; +#else + public CodeSetInfo? DataCodeSetInfo; +#endif /// /// BSS size @@ -56,11 +80,19 @@ /// /// Dependency module (program ID) list /// +#if NET48 public ulong[] DependencyModuleList; +#else + public ulong[]? DependencyModuleList; +#endif /// /// SystemInfo /// +#if NET48 public SystemInfo SystemInfo; +#else + public SystemInfo? SystemInfo; +#endif } } diff --git a/N3DS/SystemInfo.cs b/N3DS/SystemInfo.cs index c68e432..19f898c 100644 --- a/N3DS/SystemInfo.cs +++ b/N3DS/SystemInfo.cs @@ -16,6 +16,10 @@ /// /// Reserved /// +#if NET48 public byte[] Reserved; +#else + public byte[]? Reserved; +#endif } } diff --git a/N3DS/TestData.cs b/N3DS/TestData.cs index 51cfc51..0335d04 100644 --- a/N3DS/TestData.cs +++ b/N3DS/TestData.cs @@ -9,47 +9,83 @@ namespace SabreTools.Models.N3DS /// /// The bytes FF 00 FF 00 AA 55 AA 55. /// +#if NET48 public byte[] Signature; +#else + public byte[]? Signature; +#endif /// /// An ascending byte sequence equal to the offset mod 256 (08 09 0A ... FE FF 00 01 ... FF). /// +#if NET48 public byte[] AscendingByteSequence; +#else + public byte[]? AscendingByteSequence; +#endif /// /// A descending byte sequence equal to 255 minus the offset mod 256 (FF FE FD ... 00 FF DE ... 00). /// +#if NET48 public byte[] DescendingByteSequence; +#else + public byte[]? DescendingByteSequence; +#endif /// /// Filled with 00 (0b00000000) bytes. /// +#if NET48 public byte[] Filled00; +#else + public byte[]? Filled00; +#endif /// /// Filled with FF (0b11111111) bytes. /// +#if NET48 public byte[] FilledFF; +#else + public byte[]? FilledFF; +#endif /// /// Filled with 0F (0b00001111) bytes. /// +#if NET48 public byte[] Filled0F; +#else + public byte[]? Filled0F; +#endif /// /// Filled with F0 (0b11110000) bytes. /// +#if NET48 public byte[] FilledF0; +#else + public byte[]? FilledF0; +#endif /// /// Filled with 55 (0b01010101) bytes. /// +#if NET48 public byte[] Filled55; +#else + public byte[]? Filled55; +#endif /// /// Filled with AA (0b10101010) bytes. /// +#if NET48 public byte[] FilledAA; +#else + public byte[]? FilledAA; +#endif /// /// The final byte is 00 (0b00000000). diff --git a/N3DS/Ticket.cs b/N3DS/Ticket.cs index 99cb224..d49f5cd 100644 --- a/N3DS/Ticket.cs +++ b/N3DS/Ticket.cs @@ -25,22 +25,38 @@ namespace SabreTools.Models.N3DS /// /// Signature /// +#if NET48 public byte[] Signature; +#else + public byte[]? Signature; +#endif /// /// Padding /// +#if NET48 public byte[] Padding; +#else + public byte[]? Padding; +#endif /// /// Issuer /// +#if NET48 public string Issuer; +#else + public string? Issuer; +#endif /// /// ECC PublicKey /// +#if NET48 public byte[] ECCPublicKey; +#else + public byte[]? ECCPublicKey; +#endif /// /// Version (For 3DS this is always 1) @@ -71,7 +87,11 @@ namespace SabreTools.Models.N3DS /// 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. /// +#if NET48 public byte[] TitleKey; +#else + public byte[]? TitleKey; +#endif /// /// Reserved @@ -96,7 +116,11 @@ namespace SabreTools.Models.N3DS /// /// Reserved /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// Ticket title version @@ -110,7 +134,11 @@ namespace SabreTools.Models.N3DS /// /// Reserved /// +#if NET48 public byte[] Reserved3; +#else + public byte[]? Reserved3; +#endif /// /// License Type @@ -125,7 +153,11 @@ namespace SabreTools.Models.N3DS /// /// Reserved /// +#if NET48 public byte[] Reserved4; +#else + public byte[]? Reserved4; +#endif /// /// eShop Account ID? @@ -145,7 +177,11 @@ namespace SabreTools.Models.N3DS /// /// Reserved /// +#if NET48 public byte[] Reserved6; +#else + public byte[]? Reserved6; +#endif /// /// Limits @@ -153,7 +189,11 @@ namespace SabreTools.Models.N3DS /// /// In demos, the first u32 in the "Limits" section is 0x4, then the second u32 is the max-playcount. /// +#if NET48 public uint[] Limits; +#else + public uint[]? Limits; +#endif /// /// The Content Index of a ticket has its own size defined within itself, @@ -165,7 +205,11 @@ namespace SabreTools.Models.N3DS /// /// Content Index /// +#if NET48 public byte[] ContentIndex; +#else + public byte[]? ContentIndex; +#endif /// /// Certificate chain @@ -173,6 +217,10 @@ namespace SabreTools.Models.N3DS /// /// https://www.3dbrew.org/wiki/Ticket#Certificate_Chain /// +#if NET48 public Certificate[] CertificateChain; +#else + public Certificate[]? CertificateChain; +#endif } } diff --git a/N3DS/TitleMetadata.cs b/N3DS/TitleMetadata.cs index 9348467..651b7ce 100644 --- a/N3DS/TitleMetadata.cs +++ b/N3DS/TitleMetadata.cs @@ -26,17 +26,29 @@ namespace SabreTools.Models.N3DS /// /// Signature /// +#if NET48 public byte[] Signature; +#else + public byte[]? Signature; +#endif /// /// Padding /// +#if NET48 public byte[] Padding1; +#else + public byte[]? Padding1; +#endif /// /// Signature Issuer /// +#if NET48 public string Issuer; +#else + public string? Issuer; +#endif /// /// Version @@ -91,7 +103,11 @@ namespace SabreTools.Models.N3DS /// /// Reserved /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// SRL Flag @@ -101,7 +117,11 @@ namespace SabreTools.Models.N3DS /// /// Reserved /// +#if NET48 public byte[] Reserved3; +#else + public byte[]? Reserved3; +#endif /// /// Access Rights @@ -126,23 +146,39 @@ namespace SabreTools.Models.N3DS /// /// Padding /// +#if NET48 public byte[] Padding2; +#else + public byte[]? Padding2; +#endif /// /// SHA-256 Hash of the Content Info Records /// +#if NET48 public byte[] SHA256HashContentInfoRecords; +#else + public byte[]? SHA256HashContentInfoRecords; +#endif /// /// There are 64 of these records, usually only the first is used. /// +#if NET48 public ContentInfoRecord[] ContentInfoRecords; +#else + public ContentInfoRecord[]? ContentInfoRecords; +#endif /// /// There is one of these for each content contained in this title. /// (Determined by "Content Count" in the TMD Header). /// +#if NET48 public ContentChunkRecord[] ContentChunkRecords; +#else + public ContentChunkRecord[]? ContentChunkRecords; +#endif /// /// Certificate chain @@ -150,6 +186,10 @@ namespace SabreTools.Models.N3DS /// /// https://www.3dbrew.org/wiki/Title_metadata#Certificate_Chain /// +#if NET48 public Certificate[] CertificateChain; +#else + public Certificate[]? CertificateChain; +#endif } } \ No newline at end of file diff --git a/NCF/DirectoryEntry.cs b/NCF/DirectoryEntry.cs index 05415b4..dcad712 100644 --- a/NCF/DirectoryEntry.cs +++ b/NCF/DirectoryEntry.cs @@ -11,7 +11,11 @@ namespace SabreTools.Models.NCF /// /// Directory item name from the end of the directory items. /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// Size of the item. (If file, file size. If folder, num items.) diff --git a/NCF/File.cs b/NCF/File.cs index 028e517..5373835 100644 --- a/NCF/File.cs +++ b/NCF/File.cs @@ -11,71 +11,127 @@ namespace SabreTools.Models.NCF /// /// Header data /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// Directory header data /// +#if NET48 public DirectoryHeader DirectoryHeader { get; set; } +#else + public DirectoryHeader? DirectoryHeader { get; set; } +#endif /// /// Directory entries data /// +#if NET48 public DirectoryEntry[] DirectoryEntries { get; set; } +#else + public DirectoryEntry[]? DirectoryEntries { get; set; } +#endif /// /// Directory names data /// +#if NET48 public Dictionary DirectoryNames { get; set; } +#else + public Dictionary? DirectoryNames { get; set; } +#endif /// /// Directory info 1 entries data /// +#if NET48 public DirectoryInfo1Entry[] DirectoryInfo1Entries { get; set; } +#else + public DirectoryInfo1Entry[]? DirectoryInfo1Entries { get; set; } +#endif /// /// Directory info 2 entries data /// +#if NET48 public DirectoryInfo2Entry[] DirectoryInfo2Entries { get; set; } +#else + public DirectoryInfo2Entry[]? DirectoryInfo2Entries { get; set; } +#endif /// /// Directory copy entries data /// +#if NET48 public DirectoryCopyEntry[] DirectoryCopyEntries { get; set; } +#else + public DirectoryCopyEntry[]? DirectoryCopyEntries { get; set; } +#endif /// /// Directory local entries data /// +#if NET48 public DirectoryLocalEntry[] DirectoryLocalEntries { get; set; } +#else + public DirectoryLocalEntry[]? DirectoryLocalEntries { get; set; } +#endif /// /// Unknown header data /// +#if NET48 public UnknownHeader UnknownHeader { get; set; } +#else + public UnknownHeader? UnknownHeader { get; set; } +#endif /// /// Unknown entries data /// +#if NET48 public UnknownEntry[] UnknownEntries { get; set; } +#else + public UnknownEntry[]? UnknownEntries { get; set; } +#endif /// /// Checksum header data /// +#if NET48 public ChecksumHeader ChecksumHeader { get; set; } +#else + public ChecksumHeader? ChecksumHeader { get; set; } +#endif /// /// Checksum map header data /// +#if NET48 public ChecksumMapHeader ChecksumMapHeader { get; set; } +#else + public ChecksumMapHeader? ChecksumMapHeader { get; set; } +#endif /// /// Checksum map entries data /// +#if NET48 public ChecksumMapEntry[] ChecksumMapEntries { get; set; } +#else + public ChecksumMapEntry[]? ChecksumMapEntries { get; set; } +#endif /// /// Checksum entries data /// +#if NET48 public ChecksumEntry[] ChecksumEntries { get; set; } +#else + public ChecksumEntry[]? ChecksumEntries { get; set; } +#endif } } diff --git a/NewExecutable/Executable.cs b/NewExecutable/Executable.cs index e2c3770..d7e7ea5 100644 --- a/NewExecutable/Executable.cs +++ b/NewExecutable/Executable.cs @@ -16,46 +16,82 @@ namespace SabreTools.Models.NewExecutable /// /// MS-DOS executable stub /// +#if NET48 public MSDOS.Executable Stub { get; set; } +#else + public MSDOS.Executable? Stub { get; set; } +#endif /// /// New Executable header /// +#if NET48 public ExecutableHeader Header { get; set; } +#else + public ExecutableHeader? Header { get; set; } +#endif /// /// Segment table /// +#if NET48 public SegmentTableEntry[] SegmentTable { get; set; } +#else + public SegmentTableEntry[]? SegmentTable { get; set; } +#endif /// /// Resource table /// +#if NET48 public ResourceTable ResourceTable { get; set; } +#else + public ResourceTable? ResourceTable { get; set; } +#endif /// /// Resident-Name table /// +#if NET48 public ResidentNameTableEntry[] ResidentNameTable { get; set; } +#else + public ResidentNameTableEntry[]? ResidentNameTable { get; set; } +#endif /// /// Module-Reference table /// +#if NET48 public ModuleReferenceTableEntry[] ModuleReferenceTable { get; set; } +#else + public ModuleReferenceTableEntry[]? ModuleReferenceTable { get; set; } +#endif /// /// Imported-Name table /// +#if NET48 public Dictionary ImportedNameTable { get; set; } +#else + public Dictionary? ImportedNameTable { get; set; } +#endif /// /// Entry table /// +#if NET48 public EntryTableBundle[] EntryTable { get; set; } +#else + public EntryTableBundle[]? EntryTable { get; set; } +#endif /// /// Nonresident-Name table /// +#if NET48 public NonResidentNameTableEntry[] NonResidentNameTable { get; set; } +#else + public NonResidentNameTableEntry[]? NonResidentNameTable { get; set; } +#endif } } diff --git a/NewExecutable/ExecutableHeader.cs b/NewExecutable/ExecutableHeader.cs index ae15a4f..69227ea 100644 --- a/NewExecutable/ExecutableHeader.cs +++ b/NewExecutable/ExecutableHeader.cs @@ -17,7 +17,11 @@ namespace SabreTools.Models.NewExecutable /// "E" is high-order byte. /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] +#if NET48 public string Magic; +#else + public string? Magic; +#endif /// /// Version number of the linker. diff --git a/NewExecutable/ImportedNameTableEntry.cs b/NewExecutable/ImportedNameTableEntry.cs index 20697c1..596a8af 100644 --- a/NewExecutable/ImportedNameTableEntry.cs +++ b/NewExecutable/ImportedNameTableEntry.cs @@ -23,6 +23,10 @@ namespace SabreTools.Models.NewExecutable /// /// ASCII text of the name string. /// +#if NET48 public byte[] NameString; +#else + public byte[]? NameString; +#endif } } diff --git a/NewExecutable/NonResidentNameTableEntry.cs b/NewExecutable/NonResidentNameTableEntry.cs index 55860dd..96b7535 100644 --- a/NewExecutable/NonResidentNameTableEntry.cs +++ b/NewExecutable/NonResidentNameTableEntry.cs @@ -23,7 +23,11 @@ namespace SabreTools.Models.NewExecutable /// /// ASCII text of the name string. /// +#if NET48 public byte[] NameString; +#else + public byte[]? NameString; +#endif /// /// Ordinal number (index into entry table). This value is ignored diff --git a/NewExecutable/PerSegmentData.cs b/NewExecutable/PerSegmentData.cs index 6ddb46b..4f34e81 100644 --- a/NewExecutable/PerSegmentData.cs +++ b/NewExecutable/PerSegmentData.cs @@ -18,6 +18,10 @@ /// /// A table of relocation records follows. /// +#if NET48 public RelocationRecord[] RelocationRecords; +#else + public RelocationRecord[]? RelocationRecords; +#endif } } diff --git a/NewExecutable/RelocationRecord.cs b/NewExecutable/RelocationRecord.cs index 4e10f02..6ab7894 100644 --- a/NewExecutable/RelocationRecord.cs +++ b/NewExecutable/RelocationRecord.cs @@ -37,24 +37,40 @@ namespace SabreTools.Models.NewExecutable /// INTERNALREF /// /// Must be NULL if is not set to +#if NET48 public InternalRefRelocationRecord InternalRefRelocationRecord; +#else + public InternalRefRelocationRecord? InternalRefRelocationRecord; +#endif /// /// IMPORTNAME /// /// Must be NULL if is not set to +#if NET48 public ImportNameRelocationRecord ImportNameRelocationRecord; +#else + public ImportNameRelocationRecord? ImportNameRelocationRecord; +#endif /// /// IMPORTORDINAL /// /// Must be NULL if is not set to +#if NET48 public ImportOrdinalRelocationRecord ImportOrdinalRelocationRecord; +#else + public ImportOrdinalRelocationRecord? ImportOrdinalRelocationRecord; +#endif /// /// IMPORTORDINAL /// /// Must be NULL if is not set to +#if NET48 public OSFixupRelocationRecord OSFixupRelocationRecord; +#else + public OSFixupRelocationRecord? OSFixupRelocationRecord; +#endif } } diff --git a/NewExecutable/ResidentNameTableEntry.cs b/NewExecutable/ResidentNameTableEntry.cs index e6e7560..44fef52 100644 --- a/NewExecutable/ResidentNameTableEntry.cs +++ b/NewExecutable/ResidentNameTableEntry.cs @@ -22,7 +22,11 @@ namespace SabreTools.Models.NewExecutable /// /// ASCII text of the name string. /// +#if NET48 public byte[] NameString; +#else + public byte[]? NameString; +#endif /// /// Ordinal number (index into entry table). This value is ignored diff --git a/NewExecutable/ResourceTable.cs b/NewExecutable/ResourceTable.cs index f3fb677..b6de3e9 100644 --- a/NewExecutable/ResourceTable.cs +++ b/NewExecutable/ResourceTable.cs @@ -25,12 +25,20 @@ namespace SabreTools.Models.NewExecutable /// /// A table of resource type information blocks follows. /// +#if NET48 public ResourceTypeInformationEntry[] ResourceTypes; +#else + public ResourceTypeInformationEntry[]? ResourceTypes; +#endif /// /// Resource type and name strings are stored at the end of the /// resource table. /// +#if NET48 public Dictionary TypeAndNameStrings; +#else + public Dictionary? TypeAndNameStrings; +#endif } } diff --git a/NewExecutable/ResourceTypeAndNameString.cs b/NewExecutable/ResourceTypeAndNameString.cs index a2405a2..0e1815f 100644 --- a/NewExecutable/ResourceTypeAndNameString.cs +++ b/NewExecutable/ResourceTypeAndNameString.cs @@ -21,6 +21,10 @@ namespace SabreTools.Models.NewExecutable /// /// ASCII text of the type or name string. /// +#if NET48 public byte[] Text; +#else + public byte[]? Text; +#endif } } diff --git a/NewExecutable/ResourceTypeInformationEntry.cs b/NewExecutable/ResourceTypeInformationEntry.cs index 2456164..5e3e16b 100644 --- a/NewExecutable/ResourceTypeInformationEntry.cs +++ b/NewExecutable/ResourceTypeInformationEntry.cs @@ -32,6 +32,10 @@ namespace SabreTools.Models.NewExecutable /// /// A table of resources for this type follows. /// +#if NET48 public ResourceTypeResourceEntry[] Resources; +#else + public ResourceTypeResourceEntry[]? Resources; +#endif } } diff --git a/Nitro/Cart.cs b/Nitro/Cart.cs index fe76f7e..89348ec 100644 --- a/Nitro/Cart.cs +++ b/Nitro/Cart.cs @@ -8,26 +8,46 @@ namespace SabreTools.Models.Nitro /// /// DS/DSi cart header /// +#if NET48 public CommonHeader CommonHeader { get; set; } +#else + public CommonHeader? CommonHeader { get; set; } +#endif /// /// DSi extended cart header /// +#if NET48 public ExtendedDSiHeader ExtendedDSiHeader { get; set; } +#else + public ExtendedDSiHeader? ExtendedDSiHeader { get; set; } +#endif /// /// Secure area, may be encrypted or decrypted /// +#if NET48 public byte[] SecureArea { get; set; } +#else + public byte[]? SecureArea { get; set; } +#endif /// /// Name table (folder allocation table, name list) /// +#if NET48 public NameTable NameTable { get; set; } +#else + public NameTable? NameTable { get; set; } +#endif /// /// File allocation table /// +#if NET48 public FileAllocationTableEntry[] FileAllocationTable { get; set; } +#else + public FileAllocationTableEntry[]? FileAllocationTable { get; set; } +#endif } } \ No newline at end of file diff --git a/Nitro/CommonHeader.cs b/Nitro/CommonHeader.cs index 32e39db..be2f399 100644 --- a/Nitro/CommonHeader.cs +++ b/Nitro/CommonHeader.cs @@ -9,7 +9,11 @@ namespace SabreTools.Models.Nitro /// /// Game Title /// +#if NET48 public string GameTitle; +#else + public string? GameTitle; +#endif /// /// Gamecode @@ -19,7 +23,11 @@ namespace SabreTools.Models.Nitro /// /// Makercode /// +#if NET48 public string MakerCode; +#else + public string? MakerCode; +#endif /// /// Unitcode @@ -39,7 +47,11 @@ namespace SabreTools.Models.Nitro /// /// Reserved /// +#if NET48 public byte[] Reserved1; +#else + public byte[]? Reserved1; +#endif /// /// Game Revision (used by DSi titles) @@ -174,7 +186,11 @@ namespace SabreTools.Models.Nitro /// /// Secure disable /// +#if NET48 public byte[] SecureDisable; +#else + public byte[]? SecureDisable; +#endif /// /// NTR region ROM size (excluding DSi area) @@ -189,12 +205,20 @@ namespace SabreTools.Models.Nitro /// ///Reserved (0x88, 0x8C, 0x90 = Unknown, used by DSi) /// +#if NET48 public byte[] Reserved2; +#else + public byte[]? Reserved2; +#endif /// /// Nintendo Logo /// +#if NET48 public byte[] NintendoLogo; +#else + public byte[]? NintendoLogo; +#endif /// /// Nintendo Logo CRC @@ -209,6 +233,10 @@ namespace SabreTools.Models.Nitro /// /// Debugger reserved /// +#if NET48 public byte[] DebuggerReserved; +#else + public byte[]? DebuggerReserved; +#endif } } \ No newline at end of file diff --git a/Nitro/ExtendedDSiHeader.cs b/Nitro/ExtendedDSiHeader.cs index 694b865..cb0edcf 100644 --- a/Nitro/ExtendedDSiHeader.cs +++ b/Nitro/ExtendedDSiHeader.cs @@ -9,17 +9,29 @@ namespace SabreTools.Models.Nitro /// /// Global MBK1..MBK5 Settings /// +#if NET48 public uint[] GlobalMBK15Settings; +#else + public uint[]? GlobalMBK15Settings; +#endif /// /// Local MBK6..MBK8 Settings for ARM9 /// +#if NET48 public uint[] LocalMBK68SettingsARM9; +#else + public uint[]? LocalMBK68SettingsARM9; +#endif /// /// Local MBK6..MBK8 Settings for ARM7 /// +#if NET48 public uint[] LocalMBK68SettingsARM7; +#else + public uint[]? LocalMBK68SettingsARM7; +#endif /// /// Global MBK9 Setting @@ -154,7 +166,11 @@ namespace SabreTools.Models.Nitro /// /// Unknown (used by DSi) /// +#if NET48 public byte[] Unknown2; +#else + public byte[]? Unknown2; +#endif /// /// Modcrypt area 1 offset @@ -179,7 +195,11 @@ namespace SabreTools.Models.Nitro /// /// Title ID /// +#if NET48 public byte[] TitleID; +#else + public byte[]? TitleID; +#endif /// /// DSiWare: "public.sav" size @@ -194,66 +214,118 @@ namespace SabreTools.Models.Nitro /// /// Reserved (zero) /// +#if NET48 public byte[] ReservedZero; +#else + public byte[]? ReservedZero; +#endif /// /// Unknown (used by DSi) /// +#if NET48 public byte[] Unknown3; +#else + public byte[]? Unknown3; +#endif /// /// ARM9 (with encrypted secure area) SHA1 HMAC hash /// +#if NET48 public byte[] ARM9WithSecureAreaSHA1HMACHash; +#else + public byte[]? ARM9WithSecureAreaSHA1HMACHash; +#endif /// /// ARM7 SHA1 HMAC hash /// +#if NET48 public byte[] ARM7SHA1HMACHash; +#else + public byte[]? ARM7SHA1HMACHash; +#endif /// /// Digest master SHA1 HMAC hash /// +#if NET48 public byte[] DigestMasterSHA1HMACHash; +#else + public byte[]? DigestMasterSHA1HMACHash; +#endif /// /// Banner SHA1 HMAC hash /// +#if NET48 public byte[] BannerSHA1HMACHash; +#else + public byte[]? BannerSHA1HMACHash; +#endif /// /// ARM9i (decrypted) SHA1 HMAC hash /// +#if NET48 public byte[] ARM9iDecryptedSHA1HMACHash; +#else + public byte[]? ARM9iDecryptedSHA1HMACHash; +#endif /// /// ARM7i (decrypted) SHA1 HMAC hash /// +#if NET48 public byte[] ARM7iDecryptedSHA1HMACHash; +#else + public byte[]? ARM7iDecryptedSHA1HMACHash; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved5; +#else + public byte[]? Reserved5; +#endif /// /// ARM9 (without secure area) SHA1 HMAC hash /// +#if NET48 public byte[] ARM9NoSecureAreaSHA1HMACHash; +#else + public byte[]? ARM9NoSecureAreaSHA1HMACHash; +#endif /// /// Reserved /// +#if NET48 public byte[] Reserved6; +#else + public byte[]? Reserved6; +#endif /// /// Reserved and unchecked region, always zero. Used for passing arguments in debug environment. /// +#if NET48 public byte[] ReservedAndUnchecked; +#else + public byte[]? ReservedAndUnchecked; +#endif /// /// RSA signature (the first 0xE00 bytes of the header are signed with an 1024-bit RSA signature). /// +#if NET48 public byte[] RSASignature; +#else + public byte[]? RSASignature; +#endif } } \ No newline at end of file diff --git a/Nitro/NameListEntry.cs b/Nitro/NameListEntry.cs index 846334f..414bc07 100644 --- a/Nitro/NameListEntry.cs +++ b/Nitro/NameListEntry.cs @@ -17,7 +17,11 @@ namespace SabreTools.Models.Nitro /// /// The variable length name (UTF-8) /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// Only there if it is a folder. Refers to the the index of it diff --git a/Nitro/NameTable.cs b/Nitro/NameTable.cs index 6def08c..c51f51a 100644 --- a/Nitro/NameTable.cs +++ b/Nitro/NameTable.cs @@ -15,11 +15,19 @@ namespace SabreTools.Models.Nitro /// /// Folder allocation table /// +#if NET48 public FolderAllocationTableEntry[] FolderAllocationTable; +#else + public FolderAllocationTableEntry[]? FolderAllocationTable; +#endif /// /// Name list /// +#if NET48 public NameListEntry[] NameList; +#else + public NameListEntry[]? NameList; +#endif } } \ No newline at end of file diff --git a/PAK/DirectoryItem.cs b/PAK/DirectoryItem.cs index 847b0c2..56e7c33 100644 --- a/PAK/DirectoryItem.cs +++ b/PAK/DirectoryItem.cs @@ -6,7 +6,11 @@ namespace SabreTools.Models.PAK /// /// Item Name /// +#if NET48 public string ItemName; +#else + public string? ItemName; +#endif /// /// Item Offset diff --git a/PAK/File.cs b/PAK/File.cs index ef2438e..6ca2fab 100644 --- a/PAK/File.cs +++ b/PAK/File.cs @@ -9,11 +9,19 @@ namespace SabreTools.Models.PAK /// /// Deserialized directory header data /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// Deserialized directory items data /// +#if NET48 public DirectoryItem[] DirectoryItems { get; set; } +#else + public DirectoryItem[]? DirectoryItems { get; set; } +#endif } } diff --git a/PAK/Header.cs b/PAK/Header.cs index c7ee858..fa764ec 100644 --- a/PAK/Header.cs +++ b/PAK/Header.cs @@ -6,7 +6,11 @@ namespace SabreTools.Models.PAK /// /// Signature /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Directory Offset diff --git a/PFF/Archive.cs b/PFF/Archive.cs index 29c8a77..5fc9bf5 100644 --- a/PFF/Archive.cs +++ b/PFF/Archive.cs @@ -9,16 +9,28 @@ namespace SabreTools.Models.PFF /// /// Archive header /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// Segments /// +#if NET48 public Segment[] Segments { get; set; } +#else + public Segment[]? Segments { get; set; } +#endif /// /// Footer /// +#if NET48 public Footer Footer { get; set; } +#else + public Footer? Footer { get; set; } +#endif } } \ No newline at end of file diff --git a/PFF/Footer.cs b/PFF/Footer.cs index 6239037..4eab7ad 100644 --- a/PFF/Footer.cs +++ b/PFF/Footer.cs @@ -19,6 +19,10 @@ namespace SabreTools.Models.PFF /// /// King tag /// +#if NET48 public string KingTag; +#else + public string? KingTag; +#endif } } \ No newline at end of file diff --git a/PFF/Header.cs b/PFF/Header.cs index 35fced4..674d029 100644 --- a/PFF/Header.cs +++ b/PFF/Header.cs @@ -16,7 +16,11 @@ namespace SabreTools.Models.PFF /// Signature /// /// Versions 2 and 3 share the same signature but different header sizes +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Number of files diff --git a/PFF/Segment.cs b/PFF/Segment.cs index 518242e..ad5c37f 100644 --- a/PFF/Segment.cs +++ b/PFF/Segment.cs @@ -29,7 +29,11 @@ namespace SabreTools.Models.PFF /// /// File name /// +#if NET48 public string FileName; +#else + public string? FileName; +#endif /// /// Modified date diff --git a/PlayJ/AudioFile.cs b/PlayJ/AudioFile.cs index 192e7d3..b25f217 100644 --- a/PlayJ/AudioFile.cs +++ b/PlayJ/AudioFile.cs @@ -8,12 +8,20 @@ namespace SabreTools.Models.PlayJ /// /// Header /// +#if NET48 public AudioHeader Header { get; set; } +#else + public AudioHeader? Header { get; set; } +#endif /// /// Unknown block 1 /// +#if NET48 public UnknownBlock1 UnknownBlock1 { get; set; } +#else + public UnknownBlock1? UnknownBlock1 { get; set; } +#endif #region V1 Only @@ -26,7 +34,11 @@ namespace SabreTools.Models.PlayJ /// /// Unknown block 3 (V1 only) /// +#if NET48 public UnknownBlock3 UnknownBlock3 { get; set; } +#else + public UnknownBlock3? UnknownBlock3 { get; set; } +#endif #endregion @@ -40,7 +52,11 @@ namespace SabreTools.Models.PlayJ /// /// Data files (V2 only) /// +#if NET48 public DataFile[] DataFiles { get; set; } +#else + public DataFile[]? DataFiles { get; set; } +#endif // After the data files is a block starting with 0x00000001 // This block then contains highly repeating data, possible audio samples? diff --git a/PlayJ/AudioHeader.cs b/PlayJ/AudioHeader.cs index 9d16157..1a1f6d3 100644 --- a/PlayJ/AudioHeader.cs +++ b/PlayJ/AudioHeader.cs @@ -26,7 +26,11 @@ namespace SabreTools.Models.PlayJ /// /// Track name (not null-terminated) /// +#if NET48 public string Track; +#else + public string? Track; +#endif /// /// Length of the artist name @@ -36,7 +40,11 @@ namespace SabreTools.Models.PlayJ /// /// Artist name (not null-terminated) /// +#if NET48 public string Artist; +#else + public string? Artist; +#endif /// /// Length of the album name @@ -46,7 +54,11 @@ namespace SabreTools.Models.PlayJ /// /// Album name (not null-terminated) /// +#if NET48 public string Album; +#else + public string? Album; +#endif /// /// Length of the writer name @@ -56,7 +68,11 @@ namespace SabreTools.Models.PlayJ /// /// Writer name (not null-terminated) /// +#if NET48 public string Writer; +#else + public string? Writer; +#endif /// /// Length of the publisher name @@ -66,7 +82,11 @@ namespace SabreTools.Models.PlayJ /// /// Publisher name (not null-terminated) /// +#if NET48 public string Publisher; +#else + public string? Publisher; +#endif /// /// Length of the label name @@ -76,7 +96,11 @@ namespace SabreTools.Models.PlayJ /// /// Label name (not null-terminated) /// +#if NET48 public string Label; +#else + public string? Label; +#endif /// /// Length of the comments @@ -88,6 +112,10 @@ namespace SabreTools.Models.PlayJ /// Comments (not null-terminated) /// /// Optional field only in some samples +#if NET48 public string Comments; +#else + public string? Comments; +#endif } } \ No newline at end of file diff --git a/PlayJ/DataFile.cs b/PlayJ/DataFile.cs index ff6987e..48a3312 100644 --- a/PlayJ/DataFile.cs +++ b/PlayJ/DataFile.cs @@ -13,7 +13,11 @@ namespace SabreTools.Models.PlayJ /// /// Data file name /// +#if NET48 public string FileName; +#else + public string? FileName; +#endif /// /// Length of the data @@ -23,7 +27,11 @@ namespace SabreTools.Models.PlayJ /// /// Data /// +#if NET48 public byte[] Data; +#else + public byte[]? Data; +#endif // Notes about Data: // - Each data block in the samples contains a GIF header diff --git a/PlayJ/Playlist.cs b/PlayJ/Playlist.cs index 3cfac8a..0000bdd 100644 --- a/PlayJ/Playlist.cs +++ b/PlayJ/Playlist.cs @@ -8,11 +8,19 @@ namespace SabreTools.Models.PlayJ /// /// Playlist header /// +#if NET48 public PlaylistHeader Header { get; set; } +#else + public PlaylistHeader? Header { get; set; } +#endif /// /// Embedded audio files / headers /// +#if NET48 public AudioFile[] AudioFiles { get; set; } +#else + public AudioFile[]? AudioFiles { get; set; } +#endif } } \ No newline at end of file diff --git a/PlayJ/PlaylistHeader.cs b/PlayJ/PlaylistHeader.cs index bb70805..8e0c512 100644 --- a/PlayJ/PlaylistHeader.cs +++ b/PlayJ/PlaylistHeader.cs @@ -13,6 +13,10 @@ namespace SabreTools.Models.PlayJ /// /// 52 bytes of unknown data /// +#if NET48 public byte[] Data; +#else + public byte[]? Data; +#endif } } \ No newline at end of file diff --git a/PlayJ/UnknownBlock1.cs b/PlayJ/UnknownBlock1.cs index 4e52d21..b8d8b90 100644 --- a/PlayJ/UnknownBlock1.cs +++ b/PlayJ/UnknownBlock1.cs @@ -13,7 +13,11 @@ namespace SabreTools.Models.PlayJ /// /// Unknown data /// +#if NET48 public byte[] Data; +#else + public byte[]? Data; +#endif // Notes about Data: // - Might be UInt16 offset and UInt16 length pairs diff --git a/PlayJ/UnknownBlock3.cs b/PlayJ/UnknownBlock3.cs index a57e4e3..0ad1840 100644 --- a/PlayJ/UnknownBlock3.cs +++ b/PlayJ/UnknownBlock3.cs @@ -8,7 +8,11 @@ namespace SabreTools.Models.PlayJ /// /// Unknown data /// +#if NET48 public byte[] Data; +#else + public byte[]? Data; +#endif // Notes about Data: // - This may be where the encrypted audio samples live diff --git a/PortableExecutable/AssemblyManifest.cs b/PortableExecutable/AssemblyManifest.cs index 95b8f1d..d99f6f7 100644 --- a/PortableExecutable/AssemblyManifest.cs +++ b/PortableExecutable/AssemblyManifest.cs @@ -7,264 +7,508 @@ namespace SabreTools.Models.PortableExecutable public sealed class AssemblyManifest { [XmlAttribute("manifestVersion")] +#if NET48 public string ManifestVersion; +#else + public string? ManifestVersion; +#endif #region Group [XmlElement("assemblyIdentity")] +#if NET48 public AssemblyIdentity[] AssemblyIdentities; +#else + public AssemblyIdentity[]? AssemblyIdentities; +#endif [XmlElement("noInheritable")] +#if NET48 public AssemblyNoInheritable[] NoInheritables; +#else + public AssemblyNoInheritable[]? NoInheritables; +#endif #endregion #region Group [XmlElement("description")] +#if NET48 public AssemblyDescription Description; +#else + public AssemblyDescription? Description; +#endif [XmlElement("noInherit")] +#if NET48 public AssemblyNoInherit NoInherit; +#else + public AssemblyNoInherit? NoInherit; +#endif //[XmlElement("noInheritable")] //public AssemblyNoInheritable NoInheritable; [XmlElement("comInterfaceExternalProxyStub")] +#if NET48 public AssemblyCOMInterfaceExternalProxyStub[] COMInterfaceExternalProxyStub; +#else + public AssemblyCOMInterfaceExternalProxyStub[]? COMInterfaceExternalProxyStub; +#endif [XmlElement("dependency")] +#if NET48 public AssemblyDependency[] Dependency; +#else + public AssemblyDependency[]? Dependency; +#endif [XmlElement("file")] +#if NET48 public AssemblyFile[] File; +#else + public AssemblyFile[]? File; +#endif [XmlElement("clrClass")] +#if NET48 public AssemblyCommonLanguageRuntimeClass[] CLRClass; +#else + public AssemblyCommonLanguageRuntimeClass[]? CLRClass; +#endif [XmlElement("clrSurrogate")] +#if NET48 public AssemblyCommonLanguageSurrogateClass[] CLRSurrogate; +#else + public AssemblyCommonLanguageSurrogateClass[]? CLRSurrogate; +#endif #endregion [XmlAnyElement] +#if NET48 public object[] EverythingElse; +#else + public object[]? EverythingElse; +#endif } /// public sealed class AssemblyActiveCodePage { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyAutoElevate { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyBindingRedirect { [XmlAttribute("oldVersion")] +#if NET48 public string OldVersion; +#else + public string? OldVersion; +#endif [XmlAttribute("newVersion")] +#if NET48 public string NewVersion; +#else + public string? NewVersion; +#endif } /// public sealed class AssemblyCOMClass { [XmlAttribute("clsid")] +#if NET48 public string CLSID; +#else + public string? CLSID; +#endif [XmlAttribute("threadingModel")] +#if NET48 public string ThreadingModel; +#else + public string? ThreadingModel; +#endif [XmlAttribute("progid")] +#if NET48 public string ProgID; +#else + public string? ProgID; +#endif [XmlAttribute("tlbid")] +#if NET48 public string TLBID; +#else + public string? TLBID; +#endif [XmlAttribute("description")] +#if NET48 public string Description; +#else + public string? Description; +#endif [XmlElement("progid")] +#if NET48 public AssemblyProgID[] ProgIDs; +#else + public AssemblyProgID[]? ProgIDs; +#endif } /// public sealed class AssemblyCOMInterfaceExternalProxyStub { [XmlAttribute("iid")] +#if NET48 public string IID; +#else + public string? IID; +#endif [XmlAttribute("name")] +#if NET48 public string Name; +#else + public string? Name; +#endif [XmlAttribute("tlbid")] +#if NET48 public string TLBID; +#else + public string? TLBID; +#endif [XmlAttribute("numMethods")] +#if NET48 public string NumMethods; +#else + public string? NumMethods; +#endif [XmlAttribute("proxyStubClsid32")] +#if NET48 public string ProxyStubClsid32; +#else + public string? ProxyStubClsid32; +#endif [XmlAttribute("baseInterface")] +#if NET48 public string BaseInterface; +#else + public string? BaseInterface; +#endif } /// public sealed class AssemblyCOMInterfaceProxyStub { [XmlAttribute("iid")] +#if NET48 public string IID; +#else + public string? IID; +#endif [XmlAttribute("name")] +#if NET48 public string Name; +#else + public string? Name; +#endif [XmlAttribute("tlbid")] +#if NET48 public string TLBID; +#else + public string? TLBID; +#endif [XmlAttribute("numMethods")] +#if NET48 public string NumMethods; +#else + public string? NumMethods; +#endif [XmlAttribute("proxyStubClsid32")] +#if NET48 public string ProxyStubClsid32; +#else + public string? ProxyStubClsid32; +#endif [XmlAttribute("baseInterface")] +#if NET48 public string BaseInterface; +#else + public string? BaseInterface; +#endif } /// public sealed class AssemblyCommonLanguageRuntimeClass { [XmlAttribute("name")] +#if NET48 public string Name; +#else + public string? Name; +#endif [XmlAttribute("clsid")] +#if NET48 public string CLSID; +#else + public string? CLSID; +#endif [XmlAttribute("progid")] +#if NET48 public string ProgID; +#else + public string? ProgID; +#endif [XmlAttribute("tlbid")] +#if NET48 public string TLBID; +#else + public string? TLBID; +#endif [XmlAttribute("description")] +#if NET48 public string Description; +#else + public string? Description; +#endif [XmlAttribute("runtimeVersion")] +#if NET48 public string RuntimeVersion; +#else + public string? RuntimeVersion; +#endif [XmlAttribute("threadingModel")] +#if NET48 public string ThreadingModel; +#else + public string? ThreadingModel; +#endif [XmlElement("progid")] +#if NET48 public AssemblyProgID[] ProgIDs; +#else + public AssemblyProgID[]? ProgIDs; +#endif } /// public sealed class AssemblyCommonLanguageSurrogateClass { [XmlAttribute("clsid")] +#if NET48 public string CLSID; +#else + public string? CLSID; +#endif [XmlAttribute("name")] +#if NET48 public string Name; +#else + public string? Name; +#endif [XmlAttribute("runtimeVersion")] +#if NET48 public string RuntimeVersion; +#else + public string? RuntimeVersion; +#endif } /// public sealed class AssemblyDependency { [XmlElement("dependentAssembly")] +#if NET48 public AssemblyDependentAssembly DependentAssembly; +#else + public AssemblyDependentAssembly? DependentAssembly; +#endif [XmlAttribute("optional")] +#if NET48 public string Optional; +#else + public string? Optional; +#endif } /// public sealed class AssemblyDependentAssembly { [XmlElement("assemblyIdentity")] +#if NET48 public AssemblyIdentity AssemblyIdentity; +#else + public AssemblyIdentity? AssemblyIdentity; +#endif [XmlElement("bindingRedirect")] +#if NET48 public AssemblyBindingRedirect[] BindingRedirect; +#else + public AssemblyBindingRedirect[]? BindingRedirect; +#endif } /// public sealed class AssemblyDescription { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyDisableTheming { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyDisableWindowFiltering { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyDPIAware { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyDPIAwareness { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyFile { [XmlAttribute("name")] +#if NET48 public string Name; +#else + public string? Name; +#endif [XmlAttribute("hash")] +#if NET48 public string Hash; +#else + public string? Hash; +#endif [XmlAttribute("hashalg")] +#if NET48 public string HashAlgorithm; +#else + public string? HashAlgorithm; +#endif [XmlAttribute("size")] +#if NET48 public string Size; +#else + public string? Size; +#endif #region Group [XmlElement("comClass")] +#if NET48 public AssemblyCOMClass[] COMClass; +#else + public AssemblyCOMClass[]? COMClass; +#endif [XmlElement("comInterfaceProxyStub")] +#if NET48 public AssemblyCOMInterfaceProxyStub[] COMInterfaceProxyStub; +#else + public AssemblyCOMInterfaceProxyStub[]? COMInterfaceProxyStub; +#endif [XmlElement("typelib")] +#if NET48 public AssemblyTypeLib[] Typelib; +#else + public AssemblyTypeLib[]? Typelib; +#endif [XmlElement("windowClass")] +#if NET48 public AssemblyWindowClass[] WindowClass; +#else + public AssemblyWindowClass[]? WindowClass; +#endif #endregion } @@ -273,50 +517,90 @@ namespace SabreTools.Models.PortableExecutable public sealed class AssemblyGDIScaling { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyHeapType { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyHighResolutionScrollingAware { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyIdentity { [XmlAttribute("name")] +#if NET48 public string Name; +#else + public string? Name; +#endif [XmlAttribute("version")] +#if NET48 public string Version; +#else + public string? Version; +#endif [XmlAttribute("type")] +#if NET48 public string Type; +#else + public string? Type; +#endif [XmlAttribute("processorArchitecture")] +#if NET48 public string ProcessorArchitecture; +#else + public string? ProcessorArchitecture; +#endif [XmlAttribute("publicKeyToken")] +#if NET48 public string PublicKeyToken; +#else + public string? PublicKeyToken; +#endif [XmlAttribute("language")] +#if NET48 public string Language; +#else + public string? Language; +#endif } /// public sealed class AssemblyLongPathAware { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// @@ -333,57 +617,101 @@ namespace SabreTools.Models.PortableExecutable public sealed class AssemblyPrinterDriverIsolation { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyProgID { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblySupportedOS { [XmlAttribute("Id")] +#if NET48 public string Id; +#else + public string? Id; +#endif } /// public sealed class AssemblyTypeLib { [XmlElement("tlbid")] +#if NET48 public string TLBID; +#else + public string? TLBID; +#endif [XmlElement("version")] +#if NET48 public string Version; +#else + public string? Version; +#endif [XmlElement("helpdir")] +#if NET48 public string HelpDir; +#else + public string? HelpDir; +#endif [XmlElement("resourceid")] +#if NET48 public string ResourceID; +#else + public string? ResourceID; +#endif [XmlElement("flags")] +#if NET48 public string Flags; +#else + public string? Flags; +#endif } /// public sealed class AssemblyUltraHighResolutionScrollingAware { [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } /// public sealed class AssemblyWindowClass { [XmlAttribute("versioned")] +#if NET48 public string Versioned; +#else + public string? Versioned; +#endif [XmlText] +#if NET48 public string Value; +#else + public string? Value; +#endif } // TODO: Left off at diff --git a/PortableExecutable/AttributeCertificateTableEntry.cs b/PortableExecutable/AttributeCertificateTableEntry.cs index 7263040..6c74efa 100644 --- a/PortableExecutable/AttributeCertificateTableEntry.cs +++ b/PortableExecutable/AttributeCertificateTableEntry.cs @@ -58,6 +58,10 @@ /// Contains a certificate, such as an Authenticode signature. /// /// +#if NET48 public byte[] Certificate; +#else + public byte[]? Certificate; +#endif } } diff --git a/PortableExecutable/BaseRelocationBlock.cs b/PortableExecutable/BaseRelocationBlock.cs index a22ff23..1289d92 100644 --- a/PortableExecutable/BaseRelocationBlock.cs +++ b/PortableExecutable/BaseRelocationBlock.cs @@ -46,6 +46,10 @@ /// in the Page RVA field for the block. This offset /// specifies where the base relocation is to be applied. /// +#if NET48 public BaseRelocationTypeOffsetFieldEntry[] TypeOffsetFieldEntries; +#else + public BaseRelocationTypeOffsetFieldEntry[]? TypeOffsetFieldEntries; +#endif } } diff --git a/PortableExecutable/COFFStringTable.cs b/PortableExecutable/COFFStringTable.cs index 4dc5dc2..94d8a12 100644 --- a/PortableExecutable/COFFStringTable.cs +++ b/PortableExecutable/COFFStringTable.cs @@ -20,6 +20,10 @@ /// Following the size are null-terminated strings that are pointed to by symbols /// in the COFF symbol table. /// +#if NET48 public string[] Strings; +#else + public string[]? Strings; +#endif } } diff --git a/PortableExecutable/COFFSymbolTableEntry.cs b/PortableExecutable/COFFSymbolTableEntry.cs index a5c8086..5e8aa9a 100644 --- a/PortableExecutable/COFFSymbolTableEntry.cs +++ b/PortableExecutable/COFFSymbolTableEntry.cs @@ -29,7 +29,11 @@ namespace SabreTools.Models.PortableExecutable /// the name is less than 8 bytes long. /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] +#if NET48 public byte[] ShortName; +#else + public byte[]? ShortName; +#endif /// /// A field that is set to all zeros if the name is longer than 8 bytes. @@ -162,7 +166,11 @@ namespace SabreTools.Models.PortableExecutable /// Unused /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] +#if NET48 public byte[] AuxFormat2Unused2; +#else + public byte[]? AuxFormat2Unused2; +#endif /// /// The symbol-table index of the next .bf symbol record. If the function is the @@ -214,7 +222,11 @@ namespace SabreTools.Models.PortableExecutable /// Unused /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] +#if NET48 public byte[] AuxFormat3Unused; +#else + public byte[]? AuxFormat3Unused; +#endif #endregion @@ -229,7 +241,11 @@ namespace SabreTools.Models.PortableExecutable /// with nulls if it is less than the maximum length. /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 18)] +#if NET48 public byte[] AuxFormat4FileName; +#else + public byte[]? AuxFormat4FileName; +#endif #endregion @@ -278,7 +294,11 @@ namespace SabreTools.Models.PortableExecutable /// Unused /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] +#if NET48 public byte[] AuxFormat5Unused; +#else + public byte[]? AuxFormat5Unused; +#endif #endregion @@ -306,7 +326,11 @@ namespace SabreTools.Models.PortableExecutable /// Reserved, must be zero. /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] +#if NET48 public byte[] AuxFormat6Reserved2; +#else + public byte[]? AuxFormat6Reserved2; +#endif #endregion diff --git a/PortableExecutable/CursorAndIconResource.cs b/PortableExecutable/CursorAndIconResource.cs index a7ee5c4..2777685 100644 --- a/PortableExecutable/CursorAndIconResource.cs +++ b/PortableExecutable/CursorAndIconResource.cs @@ -33,7 +33,11 @@ /// /// Describes keyboard accelerator characteristics. /// +#if NET48 public NewHeader NEWHEADER; +#else + public NewHeader? NEWHEADER; +#endif // TODO: Add array of entries in the resource } diff --git a/PortableExecutable/DebugTable.cs b/PortableExecutable/DebugTable.cs index d659790..d09b09b 100644 --- a/PortableExecutable/DebugTable.cs +++ b/PortableExecutable/DebugTable.cs @@ -33,6 +33,10 @@ /// file and is not mapped into the run-time address space). If it is mapped, /// the RVA is its address. /// +#if NET48 public DebugDirectoryEntry[] DebugDirectoryTable; +#else + public DebugDirectoryEntry[]? DebugDirectoryTable; +#endif } } diff --git a/PortableExecutable/DialogBoxResource.cs b/PortableExecutable/DialogBoxResource.cs index 7d88868..3f37c26 100644 --- a/PortableExecutable/DialogBoxResource.cs +++ b/PortableExecutable/DialogBoxResource.cs @@ -14,12 +14,20 @@ /// /// Dialog box header structure /// +#if NET48 public DialogTemplate DialogTemplate; +#else + public DialogTemplate? DialogTemplate; +#endif /// /// Dialog box extended header structure /// +#if NET48 public DialogTemplateExtended ExtendedDialogTemplate; +#else + public DialogTemplateExtended? ExtendedDialogTemplate; +#endif #endregion @@ -31,7 +39,11 @@ /// box. The cdit member specifies the number of DLGITEMTEMPLATE structures in the template. /// These DLGITEMTEMPLATE structures must be aligned on DWORD boundaries. /// +#if NET48 public DialogItemTemplate[] DialogItemTemplates; +#else + public DialogItemTemplate[]? DialogItemTemplates; +#endif /// /// Following the DLGTEMPLATEEX header in an extended dialog box template is one or more @@ -39,7 +51,11 @@ /// member of the DLGITEMTEMPLATEEX structure specifies the number of DLGITEMTEMPLATEEX /// structures that follow in the template. /// +#if NET48 public DialogItemTemplateExtended[] ExtendedDialogItemTemplates; +#else + public DialogItemTemplateExtended[]? ExtendedDialogItemTemplates; +#endif #endregion } diff --git a/PortableExecutable/DialogItemTemplate.cs b/PortableExecutable/DialogItemTemplate.cs index 6213ec2..26b4498 100644 --- a/PortableExecutable/DialogItemTemplate.cs +++ b/PortableExecutable/DialogItemTemplate.cs @@ -89,7 +89,11 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. /// +#if NET48 public string ClassResource; +#else + public string? ClassResource; +#endif /// /// The ordinal value of a predefined system class. @@ -108,7 +112,11 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. /// +#if NET48 public string TitleResource; +#else + public string? TitleResource; +#endif /// /// An ordinal value of a resource, such as an icon, in an executable file @@ -128,6 +136,10 @@ namespace SabreTools.Models.PortableExecutable /// 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. /// +#if NET48 public byte[] CreationData; +#else + public byte[]? CreationData; +#endif } } diff --git a/PortableExecutable/DialogItemTemplateExtended.cs b/PortableExecutable/DialogItemTemplateExtended.cs index 827fc77..28e451b 100644 --- a/PortableExecutable/DialogItemTemplateExtended.cs +++ b/PortableExecutable/DialogItemTemplateExtended.cs @@ -87,7 +87,11 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. /// +#if NET48 public string ClassResource; +#else + public string? ClassResource; +#endif /// /// The ordinal value of a predefined system class. @@ -106,7 +110,11 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. /// +#if NET48 public string TitleResource; +#else + public string? TitleResource; +#endif /// /// An ordinal value of a resource, such as an icon, in an executable file @@ -126,6 +134,10 @@ namespace SabreTools.Models.PortableExecutable /// 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. /// +#if NET48 public byte[] CreationData; +#else + public byte[]? CreationData; +#endif } } diff --git a/PortableExecutable/DialogTemplate.cs b/PortableExecutable/DialogTemplate.cs index 8774778..9fead63 100644 --- a/PortableExecutable/DialogTemplate.cs +++ b/PortableExecutable/DialogTemplate.cs @@ -99,7 +99,11 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the menu, class, title, or typeface arrays, you must use /// Unicode strings. /// +#if NET48 public string MenuResource; +#else + public string? MenuResource; +#endif /// /// The ordinal value of a menu resource in an executable file. @@ -118,7 +122,11 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the menu, class, title, or typeface arrays, you must use /// Unicode strings. /// +#if NET48 public string ClassResource; +#else + public string? ClassResource; +#endif /// /// The ordinal value of a predefined system class. @@ -134,7 +142,11 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the menu, class, title, or typeface arrays, you must use /// Unicode strings. /// +#if NET48 public string TitleResource; +#else + public string? TitleResource; +#endif /// /// The 16-bit point size value and the typeface array follow the title array, but only if the @@ -158,6 +170,10 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the menu, class, title, or typeface arrays, you must use /// Unicode strings. /// +#if NET48 public string Typeface; +#else + public string? Typeface; +#endif } } diff --git a/PortableExecutable/DialogTemplateExtended.cs b/PortableExecutable/DialogTemplateExtended.cs index 6db6986..a73de47 100644 --- a/PortableExecutable/DialogTemplateExtended.cs +++ b/PortableExecutable/DialogTemplateExtended.cs @@ -110,7 +110,11 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. /// +#if NET48 public string MenuResource; +#else + public string? MenuResource; +#endif /// /// The ordinal value of a menu resource in an executable file. @@ -128,7 +132,11 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. /// +#if NET48 public string ClassResource; +#else + public string? ClassResource; +#endif /// /// The ordinal value of a predefined system window class. @@ -143,7 +151,11 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. /// +#if NET48 public string TitleResource; +#else + public string? TitleResource; +#endif /// /// The point size of the font to use for the text in the dialog box and its controls. @@ -183,6 +195,10 @@ namespace SabreTools.Models.PortableExecutable /// If you specify character strings in the class and title arrays, you must use Unicode strings. Use the /// MultiByteToWideChar function to generate Unicode strings from ANSI strings. /// +#if NET48 public string Typeface; +#else + public string? Typeface; +#endif } } diff --git a/PortableExecutable/DirEntry.cs b/PortableExecutable/DirEntry.cs index 9987002..597baa7 100644 --- a/PortableExecutable/DirEntry.cs +++ b/PortableExecutable/DirEntry.cs @@ -16,6 +16,10 @@ /// The FONTDIRENTRY structure for the specified font directly follows the DIRENTRY structure /// for that font. /// +#if NET48 public FontDirEntry Entry; +#else + public FontDirEntry? Entry; +#endif } } diff --git a/PortableExecutable/Executable.cs b/PortableExecutable/Executable.cs index 86a46b6..d87645c 100644 --- a/PortableExecutable/Executable.cs +++ b/PortableExecutable/Executable.cs @@ -12,24 +12,40 @@ namespace SabreTools.Models.PortableExecutable /// /// MS-DOS executable stub /// +#if NET48 public MSDOS.Executable Stub { get; set; } +#else + public MSDOS.Executable? Stub { get; set; } +#endif /// /// After the MS-DOS stub, at the file offset specified at offset 0x3c, is a 4-byte /// signature that identifies the file as a PE format image file. This signature is "PE\0\0" /// (the letters "P" and "E" followed by two null bytes). /// +#if NET48 public string Signature { get; set; } +#else + public string? Signature { get; set; } +#endif /// /// COFF file header /// +#if NET48 public COFFFileHeader COFFFileHeader { get; set; } +#else + public COFFFileHeader? COFFFileHeader { get; set; } +#endif /// /// Optional header /// +#if NET48 public OptionalHeader OptionalHeader { get; set; } +#else + public OptionalHeader? OptionalHeader { get; set; } +#endif // TODO: Support grouped sections in section reading and parsing // https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#grouped-sections-object-only @@ -40,27 +56,47 @@ namespace SabreTools.Models.PortableExecutable /// /// Section table /// +#if NET48 public SectionHeader[] SectionTable { get; set; } +#else + public SectionHeader[]? SectionTable { get; set; } +#endif /// /// COFF symbol table /// +#if NET48 public COFFSymbolTableEntry[] COFFSymbolTable { get; set; } +#else + public COFFSymbolTableEntry[]? COFFSymbolTable { get; set; } +#endif /// /// COFF string table /// +#if NET48 public COFFStringTable COFFStringTable { get; set; } +#else + public COFFStringTable? COFFStringTable { get; set; } +#endif /// /// Attribute certificate table /// +#if NET48 public AttributeCertificateTableEntry[] AttributeCertificateTable { get; set; } +#else + public AttributeCertificateTableEntry[]? AttributeCertificateTable { get; set; } +#endif /// /// Delay-load directory table /// +#if NET48 public DelayLoadDirectoryTable DelayLoadDirectoryTable { get; set; } +#else + public DelayLoadDirectoryTable? DelayLoadDirectoryTable { get; set; } +#endif #region Named Sections @@ -71,12 +107,20 @@ namespace SabreTools.Models.PortableExecutable /// /// Base relocation table (.reloc) /// +#if NET48 public BaseRelocationBlock[] BaseRelocationTable { get; set; } +#else + public BaseRelocationBlock[]? BaseRelocationTable { get; set; } +#endif /// /// Debug table (.debug*) /// +#if NET48 public DebugTable DebugTable { get; set; } +#else + public DebugTable? DebugTable { get; set; } +#endif // .drectve - A section is a directive section if it has the IMAGE_SCN_LNK_INFO // flag set in the section header and has the .drectve section name. The linker @@ -97,17 +141,29 @@ namespace SabreTools.Models.PortableExecutable /// /// Export table (.edata) /// +#if NET48 public ExportTable ExportTable { get; set; } +#else + public ExportTable? ExportTable { get; set; } +#endif /// /// Import table (.idata) /// +#if NET48 public ImportTable ImportTable { get; set; } +#else + public ImportTable? ImportTable { get; set; } +#endif /// /// Resource directory table (.rsrc) /// +#if NET48 public ResourceDirectoryTable ResourceDirectoryTable { get; set; } +#else + public ResourceDirectoryTable? ResourceDirectoryTable { get; set; } +#endif // .sxdata - The valid exception handlers of an object are listed in the .sxdata // section of that object. The section is marked IMAGE_SCN_LNK_INFO. It contains diff --git a/PortableExecutable/ExportDirectoryTable.cs b/PortableExecutable/ExportDirectoryTable.cs index d5b88d6..e27fbd7 100644 --- a/PortableExecutable/ExportDirectoryTable.cs +++ b/PortableExecutable/ExportDirectoryTable.cs @@ -42,7 +42,11 @@ namespace SabreTools.Models.PortableExecutable /// /// ASCII string that contains the name of the DLL. /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// The starting ordinal number for exports in this image. This field specifies diff --git a/PortableExecutable/ExportNamePointerTable.cs b/PortableExecutable/ExportNamePointerTable.cs index 04e5bf9..1e79473 100644 --- a/PortableExecutable/ExportNamePointerTable.cs +++ b/PortableExecutable/ExportNamePointerTable.cs @@ -13,6 +13,10 @@ /// /// The pointers are 32 bits each and are relative to the image base. /// +#if NET48 public uint[] Pointers; +#else + public uint[]? Pointers; +#endif } } diff --git a/PortableExecutable/ExportNameTable.cs b/PortableExecutable/ExportNameTable.cs index a1de1c1..8035f0c 100644 --- a/PortableExecutable/ExportNameTable.cs +++ b/PortableExecutable/ExportNameTable.cs @@ -22,6 +22,10 @@ /// /// A series of null-terminated ASCII strings of variable length. /// +#if NET48 public string[] Strings; +#else + public string[]? Strings; +#endif } } diff --git a/PortableExecutable/ExportOrdinalTable.cs b/PortableExecutable/ExportOrdinalTable.cs index 3c36437..f9bb480 100644 --- a/PortableExecutable/ExportOrdinalTable.cs +++ b/PortableExecutable/ExportOrdinalTable.cs @@ -37,6 +37,10 @@ /// /// An array of 16-bit unbiased indexes into the export address table /// +#if NET48 public ushort[] Indexes; +#else + public ushort[]? Indexes; +#endif } } diff --git a/PortableExecutable/ExportTable.cs b/PortableExecutable/ExportTable.cs index 307bc1e..8290c23 100644 --- a/PortableExecutable/ExportTable.cs +++ b/PortableExecutable/ExportTable.cs @@ -19,7 +19,11 @@ /// A table with just one row (unlike the debug directory). This table indicates the /// locations and sizes of the other export tables. /// +#if NET48 public ExportDirectoryTable ExportDirectoryTable; +#else + public ExportDirectoryTable? ExportDirectoryTable; +#endif /// /// An array of RVAs of exported symbols. These are the actual addresses of the exported @@ -27,12 +31,20 @@ /// can import a symbol by using an index to this table (an ordinal) or, optionally, by /// using the public name that corresponds to the ordinal if a public name is defined. /// +#if NET48 public ExportAddressTableEntry[] ExportAddressTable; +#else + public ExportAddressTableEntry[]? ExportAddressTable; +#endif /// /// An array of pointers to the public export names, sorted in ascending order. /// +#if NET48 public ExportNamePointerTable NamePointerTable; +#else + public ExportNamePointerTable? NamePointerTable; +#endif /// /// An array of the ordinals that correspond to members of the name pointer table. The @@ -40,7 +52,11 @@ /// must have the same number of members. Each ordinal is an index into the export address /// table. /// +#if NET48 public ExportOrdinalTable OrdinalTable; +#else + public ExportOrdinalTable? OrdinalTable; +#endif /// /// A series of null-terminated ASCII strings. Members of the name pointer table point into @@ -48,6 +64,10 @@ /// exported; they are not necessarily the same as the private names that are used within /// the image file. /// +#if NET48 public ExportNameTable ExportNameTable; +#else + public ExportNameTable? ExportNameTable; +#endif } } diff --git a/PortableExecutable/FontDirEntry.cs b/PortableExecutable/FontDirEntry.cs index 40c3fef..0b3105a 100644 --- a/PortableExecutable/FontDirEntry.cs +++ b/PortableExecutable/FontDirEntry.cs @@ -22,7 +22,11 @@ /// The font supplier's copyright information. /// /// 60 characters +#if NET48 public byte[] Copyright; +#else + public byte[]? Copyright; +#endif /// /// The type of font file. @@ -164,11 +168,19 @@ /// /// The name of the device if this font file is designated for a specific device. /// +#if NET48 public string DeviceName; +#else + public string? DeviceName; +#endif /// /// The typeface name of the font. /// +#if NET48 public string FaceName; +#else + public string? FaceName; +#endif } } diff --git a/PortableExecutable/FontGroupHeader.cs b/PortableExecutable/FontGroupHeader.cs index 591cce0..cc8fa89 100644 --- a/PortableExecutable/FontGroupHeader.cs +++ b/PortableExecutable/FontGroupHeader.cs @@ -16,6 +16,10 @@ /// A structure that contains a unique ordinal identifier for each font in the resource. The DE /// member is a placeholder for the variable-length array of DIRENTRY structures. /// +#if NET48 public DirEntry[] DE; +#else + public DirEntry[]? DE; +#endif } } diff --git a/PortableExecutable/HintNameTableEntry.cs b/PortableExecutable/HintNameTableEntry.cs index 149707c..3ad1b22 100644 --- a/PortableExecutable/HintNameTableEntry.cs +++ b/PortableExecutable/HintNameTableEntry.cs @@ -18,6 +18,10 @@ /// must be matched to the public name in the DLL. This string is case sensitive /// and terminated by a null byte. /// +#if NET48 public string Name; +#else + public string? Name; +#endif } } diff --git a/PortableExecutable/ImportDirectoryTableEntry.cs b/PortableExecutable/ImportDirectoryTableEntry.cs index e3b63bc..d142e81 100644 --- a/PortableExecutable/ImportDirectoryTableEntry.cs +++ b/PortableExecutable/ImportDirectoryTableEntry.cs @@ -42,7 +42,11 @@ namespace SabreTools.Models.PortableExecutable /// /// ASCII string that contains the name of the DLL. /// +#if NET48 public string Name; +#else + public string? Name; +#endif /// /// The RVA of the import address table. The contents of this table are identical diff --git a/PortableExecutable/ImportTable.cs b/PortableExecutable/ImportTable.cs index aa69b81..a41578c 100644 --- a/PortableExecutable/ImportTable.cs +++ b/PortableExecutable/ImportTable.cs @@ -23,23 +23,39 @@ namespace SabreTools.Models.PortableExecutable /// The import information begins with the import directory table, which describes the /// remainder of the import information. /// +#if NET48 public ImportDirectoryTableEntry[] ImportDirectoryTable; +#else + public ImportDirectoryTableEntry[]? ImportDirectoryTable; +#endif /// /// An import lookup table is an array of 32-bit numbers for PE32 or an array of 64-bit /// numbers for PE32+. /// +#if NET48 public Dictionary ImportLookupTables; +#else + public Dictionary? ImportLookupTables; +#endif /// /// These addresses are the actual memory addresses of the symbols, although technically /// they are still called "virtual addresses". /// +#if NET48 public Dictionary ImportAddressTables; +#else + public Dictionary? ImportAddressTables; +#endif /// /// One hint/name table suffices for the entire import section. /// +#if NET48 public HintNameTableEntry[] HintNameTable; +#else + public HintNameTableEntry[]? HintNameTable; +#endif } } diff --git a/PortableExecutable/LoadConfigurationDirectory.cs b/PortableExecutable/LoadConfigurationDirectory.cs index ad677e3..c6709be 100644 --- a/PortableExecutable/LoadConfigurationDirectory.cs +++ b/PortableExecutable/LoadConfigurationDirectory.cs @@ -282,7 +282,11 @@ /// Code integrity information. /// /// 12 bytes +#if NET48 public byte[] CodeIntegrity; +#else + public byte[]? CodeIntegrity; +#endif #region GuardAddressTakenIatEntryTable diff --git a/PortableExecutable/MenuItem.cs b/PortableExecutable/MenuItem.cs index fe01b8c..cae6672 100644 --- a/PortableExecutable/MenuItem.cs +++ b/PortableExecutable/MenuItem.cs @@ -24,7 +24,11 @@ /// A null-terminated Unicode string that contains the text for this menu item. /// There is no fixed limit on the size of this string. /// +#if NET48 public string NormalMenuText; +#else + public string? NormalMenuText; +#endif #endregion @@ -55,7 +59,11 @@ /// A null-terminated Unicode string that contains the text for this menu item. /// There is no fixed limit on the size of this string. /// +#if NET48 public string PopupMenuText; +#else + public string? PopupMenuText; +#endif #endregion } diff --git a/PortableExecutable/MenuItemExtended.cs b/PortableExecutable/MenuItemExtended.cs index d90a569..305724c 100644 --- a/PortableExecutable/MenuItemExtended.cs +++ b/PortableExecutable/MenuItemExtended.cs @@ -32,6 +32,10 @@ /// A null-terminated Unicode string that contains the text for this menu item. /// There is no fixed limit on the size of this string. /// +#if NET48 public string MenuText; +#else + public string? MenuText; +#endif } } diff --git a/PortableExecutable/MenuResource.cs b/PortableExecutable/MenuResource.cs index f692d62..a44b0ad 100644 --- a/PortableExecutable/MenuResource.cs +++ b/PortableExecutable/MenuResource.cs @@ -14,12 +14,20 @@ /// /// Menu header structure /// +#if NET48 public MenuHeader MenuHeader; +#else + public MenuHeader? MenuHeader; +#endif /// /// Menu extended header structure /// +#if NET48 public MenuHeaderExtended ExtendedMenuHeader; +#else + public MenuHeaderExtended? ExtendedMenuHeader; +#endif #endregion @@ -28,12 +36,20 @@ /// /// Menu items /// +#if NET48 public MenuItem[] MenuItems; +#else + public MenuItem[]? MenuItems; +#endif /// /// Extended menu items /// +#if NET48 public MenuItemExtended[] ExtendedMenuItems; +#else + public MenuItemExtended[]? ExtendedMenuItems; +#endif #endregion } diff --git a/PortableExecutable/MessageResourceData.cs b/PortableExecutable/MessageResourceData.cs index 97d84be..6d11509 100644 --- a/PortableExecutable/MessageResourceData.cs +++ b/PortableExecutable/MessageResourceData.cs @@ -17,11 +17,19 @@ namespace SabreTools.Models.PortableExecutable /// /// An array of structures. The array is the size indicated by the NumberOfBlocks member. /// +#if NET48 public MessageResourceBlock[] Blocks; +#else + public MessageResourceBlock[]? Blocks; +#endif /// /// Message resource entries /// +#if NET48 public Dictionary Entries; +#else + public Dictionary? Entries; +#endif } } diff --git a/PortableExecutable/MessageResourceEntry.cs b/PortableExecutable/MessageResourceEntry.cs index a1244d5..04ef016 100644 --- a/PortableExecutable/MessageResourceEntry.cs +++ b/PortableExecutable/MessageResourceEntry.cs @@ -20,6 +20,10 @@ /// /// Pointer to an array that contains the error message or message box display text. /// +#if NET48 public string Text; +#else + public string? Text; +#endif } } diff --git a/PortableExecutable/NB10ProgramDatabase.cs b/PortableExecutable/NB10ProgramDatabase.cs index 9d868c0..1b4d89b 100644 --- a/PortableExecutable/NB10ProgramDatabase.cs +++ b/PortableExecutable/NB10ProgramDatabase.cs @@ -37,6 +37,10 @@ namespace SabreTools.Models.PortableExecutable /// Null-terminated name of the PDB file. It can also contain full /// or partial path to the file. /// +#if NET48 public string PdbFileName; +#else + public string? PdbFileName; +#endif } } diff --git a/PortableExecutable/OptionalHeader.cs b/PortableExecutable/OptionalHeader.cs index 0ff8c4b..8640ace 100644 --- a/PortableExecutable/OptionalHeader.cs +++ b/PortableExecutable/OptionalHeader.cs @@ -275,37 +275,65 @@ /// /// The export table address and size. /// +#if NET48 public DataDirectory ExportTable; +#else + public DataDirectory? ExportTable; +#endif /// /// The import table address and size. /// +#if NET48 public DataDirectory ImportTable; +#else + public DataDirectory? ImportTable; +#endif /// /// The resource table address and size. /// +#if NET48 public DataDirectory ResourceTable; +#else + public DataDirectory? ResourceTable; +#endif /// /// The exception table address and size. /// +#if NET48 public DataDirectory ExceptionTable; +#else + public DataDirectory? ExceptionTable; +#endif /// /// The attribute certificate table address and size. /// +#if NET48 public DataDirectory CertificateTable; +#else + public DataDirectory? CertificateTable; +#endif /// /// The base relocation table address and size. /// +#if NET48 public DataDirectory BaseRelocationTable; +#else + public DataDirectory? BaseRelocationTable; +#endif /// /// The debug data starting address and size. /// +#if NET48 public DataDirectory Debug; +#else + public DataDirectory? Debug; +#endif /// /// Reserved, must be 0 @@ -316,37 +344,65 @@ /// The RVA of the value to be stored in the global pointer register. /// The size member of this structure must be set to zero. /// +#if NET48 public DataDirectory GlobalPtr; +#else + public DataDirectory? GlobalPtr; +#endif /// /// The thread local storage (TLS) table address and size. /// +#if NET48 public DataDirectory ThreadLocalStorageTable; +#else + public DataDirectory? ThreadLocalStorageTable; +#endif /// /// The load configuration table address and size. /// +#if NET48 public DataDirectory LoadConfigTable; +#else + public DataDirectory? LoadConfigTable; +#endif /// /// The bound import table address and size. /// +#if NET48 public DataDirectory BoundImport; +#else + public DataDirectory? BoundImport; +#endif /// /// The import address table address and size /// +#if NET48 public DataDirectory ImportAddressTable; +#else + public DataDirectory? ImportAddressTable; +#endif /// /// The delay import descriptor address and size. /// +#if NET48 public DataDirectory DelayImportDescriptor; +#else + public DataDirectory? DelayImportDescriptor; +#endif /// /// The CLR runtime header address and size. /// +#if NET48 public DataDirectory CLRRuntimeHeader; +#else + public DataDirectory? CLRRuntimeHeader; +#endif /// /// Reserved, must be zero diff --git a/PortableExecutable/RSDSProgramDatabase.cs b/PortableExecutable/RSDSProgramDatabase.cs index d3e7cbb..a667644 100644 --- a/PortableExecutable/RSDSProgramDatabase.cs +++ b/PortableExecutable/RSDSProgramDatabase.cs @@ -31,6 +31,10 @@ namespace SabreTools.Models.PortableExecutable /// /// zero terminated UTF8 path and file name /// +#if NET48 public string PathAndFileName; +#else + public string? PathAndFileName; +#endif } } diff --git a/PortableExecutable/ResourceDataEntry.cs b/PortableExecutable/ResourceDataEntry.cs index 1eb120f..54163d9 100644 --- a/PortableExecutable/ResourceDataEntry.cs +++ b/PortableExecutable/ResourceDataEntry.cs @@ -27,7 +27,11 @@ namespace SabreTools.Models.PortableExecutable /// /// The resource data that is pointed to by the Data RVA field. /// +#if NET48 public byte[] Data; +#else + public byte[]? Data; +#endif /// /// The code page that is used to decode code point values within the diff --git a/PortableExecutable/ResourceDirectoryEntry.cs b/PortableExecutable/ResourceDirectoryEntry.cs index 94b3ae1..4b6222a 100644 --- a/PortableExecutable/ResourceDirectoryEntry.cs +++ b/PortableExecutable/ResourceDirectoryEntry.cs @@ -31,7 +31,11 @@ /// A string that gives the Type, Name, or Language ID entry, depending on /// level of table. /// +#if NET48 public ResourceDirectoryString Name; +#else + public ResourceDirectoryString? Name; +#endif /// /// A 32-bit integer that identifies the Type, Name, or Language ID entry. @@ -50,7 +54,11 @@ /// /// Resource data entry (a leaf). /// +#if NET48 public ResourceDataEntry DataEntry; +#else + public ResourceDataEntry? DataEntry; +#endif /// /// High bit 1. The lower 31 bits are the address of another resource @@ -61,7 +69,11 @@ /// /// Another resource directory table (the next level down). /// +#if NET48 public ResourceDirectoryTable Subdirectory; +#else + public ResourceDirectoryTable? Subdirectory; +#endif #endregion } diff --git a/PortableExecutable/ResourceDirectoryString.cs b/PortableExecutable/ResourceDirectoryString.cs index 86eea7a..b65d425 100644 --- a/PortableExecutable/ResourceDirectoryString.cs +++ b/PortableExecutable/ResourceDirectoryString.cs @@ -18,6 +18,10 @@ /// /// The variable-length Unicode string data, word-aligned. /// +#if NET48 public byte[] UnicodeString; +#else + public byte[]? UnicodeString; +#endif } } diff --git a/PortableExecutable/ResourceDirectoryTable.cs b/PortableExecutable/ResourceDirectoryTable.cs index c2ae9ea..3786e94 100644 --- a/PortableExecutable/ResourceDirectoryTable.cs +++ b/PortableExecutable/ResourceDirectoryTable.cs @@ -57,6 +57,10 @@ namespace SabreTools.Models.PortableExecutable /// strings to identify Type, Name, or Language entries (depending on the /// level of the table). /// +#if NET48 public ResourceDirectoryEntry[] Entries; +#else + public ResourceDirectoryEntry[]? Entries; +#endif } } diff --git a/PortableExecutable/SectionHeader.cs b/PortableExecutable/SectionHeader.cs index ef3d41c..f7cc424 100644 --- a/PortableExecutable/SectionHeader.cs +++ b/PortableExecutable/SectionHeader.cs @@ -33,7 +33,11 @@ namespace SabreTools.Models.PortableExecutable /// to an executable file. /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] +#if NET48 public byte[] Name; +#else + public byte[]? Name; +#endif /// /// The total size of the section when loaded into memory. If this value is @@ -104,11 +108,19 @@ namespace SabreTools.Models.PortableExecutable /// /// COFF Relocations (Object Only) /// +#if NET48 public COFFRelocation[] COFFRelocations; +#else + public COFFRelocation[]? COFFRelocations; +#endif /// /// COFF Line Numbers (Deprecated) /// +#if NET48 public COFFLineNumber[] COFFLineNumbers; +#else + public COFFLineNumber[]? COFFLineNumbers; +#endif } } diff --git a/PortableExecutable/SecuROMAddD.cs b/PortableExecutable/SecuROMAddD.cs index cd10ae9..ca09c92 100644 --- a/PortableExecutable/SecuROMAddD.cs +++ b/PortableExecutable/SecuROMAddD.cs @@ -30,12 +30,20 @@ namespace SabreTools.Models.PortableExecutable /// /// Version, always 8 bytes? /// +#if NET48 public string Version; +#else + public string? Version; +#endif /// /// Unknown (Build? Formatted as a string) /// +#if NET48 public char[] Build; +#else + public char[]? Build; +#endif /// /// Unknown (0x14h), Variable number of bytes before entry table @@ -50,11 +58,19 @@ namespace SabreTools.Models.PortableExecutable /// "554900-001" in 4.84.76.7968 /// "548520-001" in 4.85.07.0009 /// +#if NET48 public byte[] Unknown14h; +#else + public byte[]? Unknown14h; +#endif /// /// Entry table /// +#if NET48 public SecuROMAddDEntry[] Entries; +#else + public SecuROMAddDEntry[]? Entries; +#endif } } diff --git a/PortableExecutable/SecuROMAddDEntry.cs b/PortableExecutable/SecuROMAddDEntry.cs index 8149040..63de2d7 100644 --- a/PortableExecutable/SecuROMAddDEntry.cs +++ b/PortableExecutable/SecuROMAddDEntry.cs @@ -64,7 +64,11 @@ namespace SabreTools.Models.PortableExecutable /// Entry file name (null-terminated) /// /// 12 bytes long in the sample (all 3 entries) in 4.47.00.0039 +#if NET48 public string FileName; +#else + public string? FileName; +#endif /// /// Unknown (0x2C) diff --git a/PortableExecutable/StringData.cs b/PortableExecutable/StringData.cs index 0538d11..ca0693f 100644 --- a/PortableExecutable/StringData.cs +++ b/PortableExecutable/StringData.cs @@ -64,7 +64,11 @@ /// set in the dwFileFlags member of the VS_FIXEDFILEINFO structure. For example, Value /// could be "Private build for Olivetti solving mouse problems on M250 and M250E computers". /// +#if NET48 public string Key; +#else + public string? Key; +#endif /// /// As many zero words as necessary to align the Value member on a 32-bit boundary. @@ -74,6 +78,10 @@ /// /// A zero-terminated string. See the szKey member description for more information. /// +#if NET48 public string Value; +#else + public string? Value; +#endif } } diff --git a/PortableExecutable/StringFileInfo.cs b/PortableExecutable/StringFileInfo.cs index 496375d..6e8a7c3 100644 --- a/PortableExecutable/StringFileInfo.cs +++ b/PortableExecutable/StringFileInfo.cs @@ -26,7 +26,11 @@ /// /// The Unicode string L"StringFileInfo". /// +#if NET48 public string Key; +#else + public string? Key; +#endif /// /// As many zero words as necessary to align the Children member on a 32-bit boundary. @@ -38,6 +42,10 @@ /// member indicates the appropriate language and code page for displaying the text in /// that StringTable structure. /// +#if NET48 public StringTable[] Children; +#else + public StringTable[]? Children; +#endif } } diff --git a/PortableExecutable/StringTable.cs b/PortableExecutable/StringTable.cs index 59b8664..d8bf92b 100644 --- a/PortableExecutable/StringTable.cs +++ b/PortableExecutable/StringTable.cs @@ -31,7 +31,11 @@ /// identifier contains two parts: the low-order 10 bits specify the major language, /// and the high-order 6 bits specify the sublanguage. /// +#if NET48 public string Key; +#else + public string? Key; +#endif /// /// As many zero words as necessary to align the Children member on a 32-bit boundary. @@ -41,6 +45,10 @@ /// /// An array of one or more StringData structures. /// +#if NET48 public StringData[] Children; +#else + public StringData[]? Children; +#endif } } diff --git a/PortableExecutable/VarData.cs b/PortableExecutable/VarData.cs index a6d62c2..83be490 100644 --- a/PortableExecutable/VarData.cs +++ b/PortableExecutable/VarData.cs @@ -26,7 +26,11 @@ /// /// The Unicode string L"Translation". /// +#if NET48 public string Key; +#else + public string? Key; +#endif /// /// As many zero words as necessary to align the Value member on a 32-bit boundary. @@ -45,6 +49,10 @@ /// independent. If the Var structure is omitted, the file will be interpreted as both /// language and code page independent. /// +#if NET48 public uint[] Value; +#else + public uint[]? Value; +#endif } } diff --git a/PortableExecutable/VarFileInfo.cs b/PortableExecutable/VarFileInfo.cs index c228c06..a21f319 100644 --- a/PortableExecutable/VarFileInfo.cs +++ b/PortableExecutable/VarFileInfo.cs @@ -26,7 +26,11 @@ /// /// The Unicode string L"VarFileInfo". /// +#if NET48 public string Key; +#else + public string? Key; +#endif /// /// As many zero words as necessary to align the Children member on a 32-bit boundary. @@ -36,6 +40,10 @@ /// /// Typically contains a list of languages that the application or DLL supports. /// +#if NET48 public VarData[] Children; +#else + public VarData[]? Children; +#endif } } diff --git a/PortableExecutable/VersionInfo.cs b/PortableExecutable/VersionInfo.cs index 46a7067..b277bcd 100644 --- a/PortableExecutable/VersionInfo.cs +++ b/PortableExecutable/VersionInfo.cs @@ -29,7 +29,11 @@ /// /// The Unicode string L"VS_VERSION_INFO". /// +#if NET48 public string Key; +#else + public string? Key; +#endif /// /// Contains as many zero words as necessary to align the Value member on a 32-bit boundary. @@ -40,7 +44,11 @@ /// Arbitrary data associated with this VS_VERSIONINFO structure. The ValueLength member /// specifies the length of this member; if ValueLength is zero, this member does not exist. /// +#if NET48 public FixedFileInfo Value; +#else + public FixedFileInfo? Value; +#endif /// /// As many zero words as necessary to align the Children member on a 32-bit boundary. @@ -51,11 +59,19 @@ /// /// The StringFileInfo structure to store user-defined string information data. /// +#if NET48 public StringFileInfo StringFileInfo; +#else + public StringFileInfo? StringFileInfo; +#endif /// /// The VarFileInfo structure to store language information data. /// +#if NET48 public VarFileInfo VarFileInfo; +#else + public VarFileInfo? VarFileInfo; +#endif } } diff --git a/Quantum/Archive.cs b/Quantum/Archive.cs index f1e556a..60186c7 100644 --- a/Quantum/Archive.cs +++ b/Quantum/Archive.cs @@ -9,12 +9,20 @@ namespace SabreTools.Models.Quantum /// /// Quantum header /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// This is immediately followed by the list of files /// +#if NET48 public FileDescriptor[] FileList { get; set; } +#else + public FileDescriptor[]? FileList { get; set; } +#endif /// /// Immediately following the list of files is the compressed data diff --git a/Quantum/FileDescriptor.cs b/Quantum/FileDescriptor.cs index 82e03b2..54dd2f2 100644 --- a/Quantum/FileDescriptor.cs +++ b/Quantum/FileDescriptor.cs @@ -14,7 +14,11 @@ namespace SabreTools.Models.Quantum /// /// File name, variable length string, not zero-terminated /// +#if NET48 public string FileName; +#else + public string? FileName; +#endif /// /// Length of comment field @@ -24,7 +28,11 @@ namespace SabreTools.Models.Quantum /// /// Comment field, variable length string, not zero-terminated /// +#if NET48 public string CommentField; +#else + public string? CommentField; +#endif /// /// Fully expanded file size in bytes diff --git a/Quantum/Header.cs b/Quantum/Header.cs index d5a29e8..2078608 100644 --- a/Quantum/Header.cs +++ b/Quantum/Header.cs @@ -12,7 +12,11 @@ namespace SabreTools.Models.Quantum /// /// Quantum signature: 0x44 0x53 /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// Quantum major version number diff --git a/README.MD b/README.MD index 4e7cb63..8d8e504 100644 --- a/README.MD +++ b/README.MD @@ -3,7 +3,8 @@ This library comprises of models that represent either directly serializable or representative structures for all SabreTools projects. All of the main models representing metadata files should have parsers created outside of the current code. In most completed models for serialization, there is a section that looks like the following: -``` + +```c# #region DO NOT USE IN PRODUCTION /// Should be empty diff --git a/SFFS/FileEntry.cs b/SFFS/FileEntry.cs index 899b403..ed71eba 100644 --- a/SFFS/FileEntry.cs +++ b/SFFS/FileEntry.cs @@ -10,7 +10,11 @@ namespace SabreTools.Models.SFFS /// MD5 hash of filename (not encrypted,) /// /// 0x10 bytes +#if NET48 public byte[] FilenameMD5Hash; +#else + public byte[]? FilenameMD5Hash; +#endif /// /// Index of fileheader (encrypted with filename) diff --git a/SFFS/FileHeader.cs b/SFFS/FileHeader.cs index 6b70c57..bd8b7b9 100644 --- a/SFFS/FileHeader.cs +++ b/SFFS/FileHeader.cs @@ -15,6 +15,10 @@ namespace SabreTools.Models.SFFS /// File info (timestamps, size, data position, encrypted) /// /// Unknown format +#if NET48 public byte[] FileInfo; +#else + public byte[]? FileInfo; +#endif } } diff --git a/SFFS/StarForceFileSystem.cs b/SFFS/StarForceFileSystem.cs index 81277a4..ad0c14d 100644 --- a/SFFS/StarForceFileSystem.cs +++ b/SFFS/StarForceFileSystem.cs @@ -18,16 +18,28 @@ /// /// Header /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// Files /// +#if NET48 public FileEntry[] Files { get; set; } +#else + public FileEntry[]? Files { get; set; } +#endif /// /// File headers /// +#if NET48 public FileHeader[] FileHeaders { get; set; } +#else + public FileHeader[]? FileHeaders { get; set; } +#endif } } diff --git a/SGA/DirectoryHeader.cs b/SGA/DirectoryHeader.cs index aa8c225..eb8bead 100644 --- a/SGA/DirectoryHeader.cs +++ b/SGA/DirectoryHeader.cs @@ -5,18 +5,34 @@ namespace SabreTools.Models.SGA { public uint SectionOffset; +#if NET48 public T SectionCount; +#else + public T? SectionCount; +#endif public uint FolderOffset; +#if NET48 public T FolderCount; +#else + public T? FolderCount; +#endif public uint FileOffset; +#if NET48 public T FileCount; +#else + public T? FileCount; +#endif public uint StringTableOffset; +#if NET48 public T StringTableCount; +#else + public T? StringTableCount; +#endif } } diff --git a/SGA/File.cs b/SGA/File.cs index 0027399..ffe5a6f 100644 --- a/SGA/File.cs +++ b/SGA/File.cs @@ -9,11 +9,19 @@ namespace SabreTools.Models.SGA /// ///Header data /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// Directory data /// +#if NET48 public Directory Directory { get; set; } +#else + public Directory? Directory { get; set; } +#endif } } diff --git a/SGA/File4.cs b/SGA/File4.cs index 639b873..ecc9a1e 100644 --- a/SGA/File4.cs +++ b/SGA/File4.cs @@ -5,7 +5,11 @@ namespace SabreTools.Models.SGA { public uint NameOffset; +#if NET48 public string Name; +#else + public string? Name; +#endif public uint Offset; diff --git a/SGA/FileHeader.cs b/SGA/FileHeader.cs index d660368..115c6a8 100644 --- a/SGA/FileHeader.cs +++ b/SGA/FileHeader.cs @@ -3,7 +3,11 @@ namespace SabreTools.Models.SGA /// public sealed class FileHeader { +#if NET48 public string Name; +#else + public string? Name; +#endif public uint CRC32; } diff --git a/SGA/Folder.cs b/SGA/Folder.cs index 0b9a034..a5b63da 100644 --- a/SGA/Folder.cs +++ b/SGA/Folder.cs @@ -5,14 +5,34 @@ namespace SabreTools.Models.SGA { public uint NameOffset; +#if NET48 public string Name; +#else + public string? Name; +#endif +#if NET48 public T FolderStartIndex; +#else + public T? FolderStartIndex; +#endif +#if NET48 public T FolderEndIndex; +#else + public T? FolderEndIndex; +#endif +#if NET48 public T FileStartIndex; +#else + public T? FileStartIndex; +#endif +#if NET48 public T FileEndIndex; +#else + public T? FileEndIndex; +#endif } } diff --git a/SGA/Header.cs b/SGA/Header.cs index f5beb19..9264b98 100644 --- a/SGA/Header.cs +++ b/SGA/Header.cs @@ -3,7 +3,11 @@ namespace SabreTools.Models.SGA /// public abstract class Header { +#if NET48 public string Signature; +#else + public string? Signature; +#endif public ushort MajorVersion; diff --git a/SGA/Header4.cs b/SGA/Header4.cs index 9b3a1cb..474d0c5 100644 --- a/SGA/Header4.cs +++ b/SGA/Header4.cs @@ -3,11 +3,23 @@ namespace SabreTools.Models.SGA /// public sealed class Header4 : Header { +#if NET48 public byte[] FileMD5; +#else + public byte[]? FileMD5; +#endif +#if NET48 public string Name; +#else + public string? Name; +#endif +#if NET48 public byte[] HeaderMD5; +#else + public byte[]? HeaderMD5; +#endif public uint HeaderLength; diff --git a/SGA/Header6.cs b/SGA/Header6.cs index 4cf5457..5277677 100644 --- a/SGA/Header6.cs +++ b/SGA/Header6.cs @@ -3,7 +3,11 @@ namespace SabreTools.Models.SGA /// public sealed class Header6 : Header { +#if NET48 public string Name; +#else + public string? Name; +#endif public uint HeaderLength; diff --git a/SGA/Section.cs b/SGA/Section.cs index 5b08a9a..3856702 100644 --- a/SGA/Section.cs +++ b/SGA/Section.cs @@ -3,18 +3,46 @@ namespace SabreTools.Models.SGA /// public abstract class Section { +#if NET48 public string Alias; +#else + public string? Alias; +#endif +#if NET48 public string Name; +#else + public string? Name; +#endif +#if NET48 public T FolderStartIndex; +#else + public T? FolderStartIndex; +#endif +#if NET48 public T FolderEndIndex; +#else + public T? FolderEndIndex; +#endif +#if NET48 public T FileStartIndex; +#else + public T? FileStartIndex; +#endif +#if NET48 public T FileEndIndex; +#else + public T? FileEndIndex; +#endif +#if NET48 public T FolderRootIndex; +#else + public T? FolderRootIndex; +#endif } } diff --git a/SGA/SpecializedDirectory.cs b/SGA/SpecializedDirectory.cs index 9eb3361..525deeb 100644 --- a/SGA/SpecializedDirectory.cs +++ b/SGA/SpecializedDirectory.cs @@ -16,31 +16,55 @@ namespace SabreTools.Models.SGA /// /// Source SGA file /// +#if NET48 public File File { get; set; } +#else + public File? File { get; set; } +#endif /// /// Directory header data /// +#if NET48 public TDirectoryHeader DirectoryHeader { get; set; } +#else + public TDirectoryHeader? DirectoryHeader { get; set; } +#endif /// /// Sections data /// +#if NET48 public TSection[] Sections { get; set; } +#else + public TSection[]? Sections { get; set; } +#endif /// /// Folders data /// +#if NET48 public TFolder[] Folders { get; set; } +#else + public TFolder[]? Folders { get; set; } +#endif /// /// Files data /// +#if NET48 public TFile[] Files { get; set; } +#else + public TFile[]? Files { get; set; } +#endif /// /// String table data /// +#if NET48 public Dictionary StringTable { get; set; } +#else + public Dictionary? StringTable { get; set; } +#endif } } diff --git a/TAR/Archive.cs b/TAR/Archive.cs index a739d02..59adaf3 100644 --- a/TAR/Archive.cs +++ b/TAR/Archive.cs @@ -5,6 +5,10 @@ namespace SabreTools.Models.TAR /// /// File header /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif } } \ No newline at end of file diff --git a/TAR/Header.cs b/TAR/Header.cs index ab1b6ce..377fcbe 100644 --- a/TAR/Header.cs +++ b/TAR/Header.cs @@ -5,7 +5,11 @@ namespace SabreTools.Models.TAR /// /// File name /// +#if NET48 public string FileName; +#else + public string? FileName; +#endif /// /// File mode @@ -45,41 +49,73 @@ namespace SabreTools.Models.TAR /// /// Name of linked file /// +#if NET48 public string LinkName; +#else + public string? LinkName; +#endif /// /// UStar indicator, "ustar", then NUL /// +#if NET48 public string Magic; +#else + public string? Magic; +#endif /// /// UStar version, "00" /// +#if NET48 public string Version; +#else + public string? Version; +#endif /// /// Owner user name /// +#if NET48 public string UserName; +#else + public string? UserName; +#endif /// /// Owner group name /// +#if NET48 public string GroupName; +#else + public string? GroupName; +#endif /// /// Device major number /// +#if NET48 public string DevMajor; +#else + public string? DevMajor; +#endif /// /// Device minor number /// +#if NET48 public string DevMinor; +#else + public string? DevMinor; +#endif /// /// Filename prefix /// +#if NET48 public string Prefix; +#else + public string? Prefix; +#endif } } \ No newline at end of file diff --git a/VBSP/File.cs b/VBSP/File.cs index 5363136..a630094 100644 --- a/VBSP/File.cs +++ b/VBSP/File.cs @@ -9,6 +9,10 @@ namespace SabreTools.Models.VBSP /// /// Directory header data /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif } } \ No newline at end of file diff --git a/VBSP/Header.cs b/VBSP/Header.cs index 07fcd18..8af2e46 100644 --- a/VBSP/Header.cs +++ b/VBSP/Header.cs @@ -6,7 +6,11 @@ namespace SabreTools.Models.VBSP /// /// BSP file signature. /// +#if NET48 public string Signature; +#else + public string? Signature; +#endif /// /// BSP file version. @@ -21,7 +25,11 @@ namespace SabreTools.Models.VBSP /// /// Lumps. /// +#if NET48 public Lump[] Lumps; +#else + public Lump[]? Lumps; +#endif /// /// The map's revision (iteration, version) number. diff --git a/VBSP/Lump.cs b/VBSP/Lump.cs index 23ebb77..e8bf537 100644 --- a/VBSP/Lump.cs +++ b/VBSP/Lump.cs @@ -15,6 +15,10 @@ namespace SabreTools.Models.VBSP /// /// Default to (char)0, (char)0, (char)0, (char)0. /// +#if NET48 public char[] FourCC; +#else + public char[]? FourCC; +#endif } } diff --git a/VPK/ArchiveHash.cs b/VPK/ArchiveHash.cs index 23448af..981d86c 100644 --- a/VPK/ArchiveHash.cs +++ b/VPK/ArchiveHash.cs @@ -12,6 +12,10 @@ namespace SabreTools.Models.VPK /// /// MD5 /// +#if NET48 public byte[] Hash; +#else + public byte[]? Hash; +#endif } } diff --git a/VPK/DirectoryItem.cs b/VPK/DirectoryItem.cs index edf334b..e9b889e 100644 --- a/VPK/DirectoryItem.cs +++ b/VPK/DirectoryItem.cs @@ -3,14 +3,34 @@ namespace SabreTools.Models.VPK /// public sealed class DirectoryItem { +#if NET48 public string Extension; +#else + public string? Extension; +#endif +#if NET48 public string Path; +#else + public string? Path; +#endif +#if NET48 public string Name; +#else + public string? Name; +#endif +#if NET48 public DirectoryEntry DirectoryEntry; +#else + public DirectoryEntry? DirectoryEntry; +#endif +#if NET48 public byte[] PreloadData; +#else + public byte[]? PreloadData; +#endif } } diff --git a/VPK/File.cs b/VPK/File.cs index 7fa7802..28a9d99 100644 --- a/VPK/File.cs +++ b/VPK/File.cs @@ -9,21 +9,37 @@ namespace SabreTools.Models.VPK /// /// Header data /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// Extended header data /// +#if NET48 public ExtendedHeader ExtendedHeader { get; set; } +#else + public ExtendedHeader? ExtendedHeader { get; set; } +#endif /// /// Archive hashes data /// +#if NET48 public ArchiveHash[] ArchiveHashes { get; set; } +#else + public ArchiveHash[]? ArchiveHashes { get; set; } +#endif /// /// Directory items data /// +#if NET48 public DirectoryItem[] DirectoryItems { get; set; } +#else + public DirectoryItem[]? DirectoryItems { get; set; } +#endif } } diff --git a/WAD/File.cs b/WAD/File.cs index 8280024..4ad783c 100644 --- a/WAD/File.cs +++ b/WAD/File.cs @@ -9,16 +9,28 @@ namespace SabreTools.Models.WAD /// /// Deserialized header data /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// Deserialized lumps data /// +#if NET48 public Lump[] Lumps { get; set; } +#else + public Lump[]? Lumps { get; set; } +#endif /// /// Deserialized lump infos data /// +#if NET48 public LumpInfo[] LumpInfos { get; set; } +#else + public LumpInfo[]? LumpInfos { get; set; } +#endif } } diff --git a/WAD/Header.cs b/WAD/Header.cs index 60f6a0e..9f4655a 100644 --- a/WAD/Header.cs +++ b/WAD/Header.cs @@ -3,7 +3,11 @@ namespace SabreTools.Models.WAD /// public sealed class Header { +#if NET48 public string Signature; +#else + public string? Signature; +#endif public uint LumpCount; diff --git a/WAD/Lump.cs b/WAD/Lump.cs index 877008e..28114e8 100644 --- a/WAD/Lump.cs +++ b/WAD/Lump.cs @@ -17,6 +17,10 @@ namespace SabreTools.Models.WAD public byte Padding1; +#if NET48 public string Name; +#else + public string? Name; +#endif } } diff --git a/WAD/LumpInfo.cs b/WAD/LumpInfo.cs index 279634a..cb5a47a 100644 --- a/WAD/LumpInfo.cs +++ b/WAD/LumpInfo.cs @@ -3,7 +3,11 @@ namespace SabreTools.Models.WAD /// public sealed class LumpInfo { +#if NET48 public string Name; +#else + public string? Name; +#endif public uint Width; @@ -13,10 +17,18 @@ namespace SabreTools.Models.WAD // 12 bytes of unknown data +#if NET48 public byte[] PixelData; +#else + public byte[]? PixelData; +#endif public uint PaletteSize; +#if NET48 public byte[] PaletteData; +#else + public byte[]? PaletteData; +#endif } } diff --git a/XZP/DirectoryItem.cs b/XZP/DirectoryItem.cs index 87988d2..78985cc 100644 --- a/XZP/DirectoryItem.cs +++ b/XZP/DirectoryItem.cs @@ -7,7 +7,11 @@ namespace SabreTools.Models.XZP public uint NameOffset; +#if NET48 public string Name; +#else + public string? Name; +#endif public uint TimeCreated; } diff --git a/XZP/File.cs b/XZP/File.cs index 196e211..ef1e6fd 100644 --- a/XZP/File.cs +++ b/XZP/File.cs @@ -9,31 +9,55 @@ namespace SabreTools.Models.XZP /// /// Header data /// +#if NET48 public Header Header { get; set; } +#else + public Header? Header { get; set; } +#endif /// /// Directory entries data /// +#if NET48 public DirectoryEntry[] DirectoryEntries { get; set; } +#else + public DirectoryEntry[]? DirectoryEntries { get; set; } +#endif /// /// Preload directory entries data /// +#if NET48 public DirectoryEntry[] PreloadDirectoryEntries { get; set; } +#else + public DirectoryEntry[]? PreloadDirectoryEntries { get; set; } +#endif /// /// Preload directory mappings data /// +#if NET48 public DirectoryMapping[] PreloadDirectoryMappings { get; set; } +#else + public DirectoryMapping[]? PreloadDirectoryMappings { get; set; } +#endif /// /// Directory items data /// +#if NET48 public DirectoryItem[] DirectoryItems { get; set; } +#else + public DirectoryItem[]? DirectoryItems { get; set; } +#endif /// /// Footer data /// +#if NET48 public Footer Footer { get; set; } +#else + public Footer? Footer { get; set; } +#endif } } diff --git a/XZP/Footer.cs b/XZP/Footer.cs index 368ac89..50fb701 100644 --- a/XZP/Footer.cs +++ b/XZP/Footer.cs @@ -5,6 +5,10 @@ namespace SabreTools.Models.XZP { public uint FileLength; +#if NET48 public string Signature; +#else + public string? Signature; +#endif } } diff --git a/XZP/Header.cs b/XZP/Header.cs index 589ca88..3aac969 100644 --- a/XZP/Header.cs +++ b/XZP/Header.cs @@ -3,7 +3,11 @@ namespace SabreTools.Models.XZP /// public sealed class Header { +#if NET48 public string Signature; +#else + public string? Signature; +#endif public uint Version;