diff --git a/BinaryObjectScanner.Wrappers/AACSMediaKeyBlock.cs b/BinaryObjectScanner.Wrappers/AACSMediaKeyBlock.cs index ab58d713..611026bb 100644 --- a/BinaryObjectScanner.Wrappers/AACSMediaKeyBlock.cs +++ b/BinaryObjectScanner.Wrappers/AACSMediaKeyBlock.cs @@ -18,7 +18,11 @@ namespace BinaryObjectScanner.Wrappers #region Records /// +#if NET48 public SabreTools.Models.AACS.Record[] Records => _model.Records; +#else + public SabreTools.Models.AACS.Record?[] Records => _model.Records; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/BFPK.cs b/BinaryObjectScanner.Wrappers/BFPK.cs index b9f5bd68..279cbb1b 100644 --- a/BinaryObjectScanner.Wrappers/BFPK.cs +++ b/BinaryObjectScanner.Wrappers/BFPK.cs @@ -32,7 +32,11 @@ namespace BinaryObjectScanner.Wrappers #region Files /// +#if NET48 public SabreTools.Models.BFPK.FileEntry[] FileTable => _model.Files; +#else + public SabreTools.Models.BFPK.FileEntry?[] FileTable => _model.Files; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/BSP.cs b/BinaryObjectScanner.Wrappers/BSP.cs index 91de16ca..ada32c92 100644 --- a/BinaryObjectScanner.Wrappers/BSP.cs +++ b/BinaryObjectScanner.Wrappers/BSP.cs @@ -27,7 +27,11 @@ namespace BinaryObjectScanner.Wrappers #region Lumps /// +#if NET48 public SabreTools.Models.BSP.Lump[] Lumps => _model.Lumps; +#else + public SabreTools.Models.BSP.Lump?[] Lumps => _model.Lumps; +#endif #endregion @@ -44,7 +48,11 @@ namespace BinaryObjectScanner.Wrappers #region Textures /// +#if NET48 public SabreTools.Models.BSP.Texture[] Textures => _model.Textures; +#else + public SabreTools.Models.BSP.Texture?[] Textures => _model.Textures; +#endif #endregion @@ -128,7 +136,7 @@ namespace BinaryObjectScanner.Wrappers public override StringBuilder PrettyPrint() { StringBuilder builder = new StringBuilder(); - + builder.AppendLine("BSP Information:"); builder.AppendLine("-------------------------"); builder.AppendLine(); diff --git a/BinaryObjectScanner.Wrappers/CIA.cs b/BinaryObjectScanner.Wrappers/CIA.cs index 371e40d0..42786c0b 100644 --- a/BinaryObjectScanner.Wrappers/CIA.cs +++ b/BinaryObjectScanner.Wrappers/CIA.cs @@ -49,7 +49,11 @@ namespace BinaryObjectScanner.Wrappers #region Certificate Chain /// +#if NET48 public SabreTools.Models.N3DS.Certificate[] CertificateChain => _model.CertificateChain; +#else + public SabreTools.Models.N3DS.Certificate?[]? CertificateChain => _model.CertificateChain; +#endif #endregion @@ -140,7 +144,11 @@ namespace BinaryObjectScanner.Wrappers public byte[] T_ContentIndex => _model.Ticket.ContentIndex; /// +#if NET48 public SabreTools.Models.N3DS.Certificate[] T_CertificateChain => _model.Ticket.CertificateChain; +#else + public SabreTools.Models.N3DS.Certificate?[]? T_CertificateChain => _model.Ticket.CertificateChain; +#endif #endregion @@ -222,20 +230,36 @@ namespace BinaryObjectScanner.Wrappers public byte[] TMD_SHA256HashContentInfoRecords => _model.TMDFileData.SHA256HashContentInfoRecords; /// +#if NET48 public SabreTools.Models.N3DS.ContentInfoRecord[] TMD_ContentInfoRecords => _model.TMDFileData.ContentInfoRecords; +#else + public SabreTools.Models.N3DS.ContentInfoRecord?[]? TMD_ContentInfoRecords => _model.TMDFileData.ContentInfoRecords; +#endif /// +#if NET48 public SabreTools.Models.N3DS.ContentChunkRecord[] TMD_ContentChunkRecords => _model.TMDFileData.ContentChunkRecords; +#else + public SabreTools.Models.N3DS.ContentChunkRecord?[]? TMD_ContentChunkRecords => _model.TMDFileData.ContentChunkRecords; +#endif /// +#if NET48 public SabreTools.Models.N3DS.Certificate[] TMD_CertificateChain => _model.TMDFileData.CertificateChain; +#else + public SabreTools.Models.N3DS.Certificate?[]? TMD_CertificateChain => _model.TMDFileData.CertificateChain; +#endif #endregion #region Partitions /// +#if NET48 public SabreTools.Models.N3DS.NCCHHeader[] Partitions => _model.Partitions; +#else + public SabreTools.Models.N3DS.NCCHHeader?[]? Partitions => _model.Partitions; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/GCF.cs b/BinaryObjectScanner.Wrappers/GCF.cs index a60ef78f..0f0cacf1 100644 --- a/BinaryObjectScanner.Wrappers/GCF.cs +++ b/BinaryObjectScanner.Wrappers/GCF.cs @@ -84,7 +84,11 @@ namespace BinaryObjectScanner.Wrappers #region Block Entries /// +#if NET48 public SabreTools.Models.GCF.BlockEntry[] BlockEntries => _model.BlockEntries; +#else + public SabreTools.Models.GCF.BlockEntry?[]? BlockEntries => _model.BlockEntries; +#endif #endregion @@ -107,7 +111,11 @@ namespace BinaryObjectScanner.Wrappers #region Fragmentation Maps /// +#if NET48 public SabreTools.Models.GCF.FragmentationMap[] FragmentationMaps => _model.FragmentationMaps; +#else + public SabreTools.Models.GCF.FragmentationMap?[]? FragmentationMaps => _model.FragmentationMaps; +#endif #endregion @@ -133,7 +141,11 @@ namespace BinaryObjectScanner.Wrappers #region Block Entry Maps /// +#if NET48 public SabreTools.Models.GCF.BlockEntryMap[] BlockEntryMaps => _model.BlockEntryMaps; +#else + public SabreTools.Models.GCF.BlockEntryMap?[]? BlockEntryMaps => _model.BlockEntryMaps; +#endif #endregion @@ -186,42 +198,66 @@ namespace BinaryObjectScanner.Wrappers #region Directory Entries /// +#if NET48 public SabreTools.Models.GCF.DirectoryEntry[] DirectoryEntries => _model.DirectoryEntries; +#else + public SabreTools.Models.GCF.DirectoryEntry?[]? DirectoryEntries => _model.DirectoryEntries; +#endif #endregion #region Directory Names /// - public System.Collections.Generic.Dictionary DirectoryNames => _model.DirectoryNames; +#if NET48 + public Dictionary DirectoryNames => _model.DirectoryNames; +#else + public Dictionary? DirectoryNames => _model.DirectoryNames; +#endif #endregion #region Directory Info 1 Entries /// +#if NET48 public SabreTools.Models.GCF.DirectoryInfo1Entry[] DirectoryInfo1Entries => _model.DirectoryInfo1Entries; +#else + public SabreTools.Models.GCF.DirectoryInfo1Entry?[]? DirectoryInfo1Entries => _model.DirectoryInfo1Entries; +#endif #endregion #region Directory Info 2 Entries /// +#if NET48 public SabreTools.Models.GCF.DirectoryInfo2Entry[] DirectoryInfo2Entries => _model.DirectoryInfo2Entries; +#else + public SabreTools.Models.GCF.DirectoryInfo2Entry?[]? DirectoryInfo2Entries => _model.DirectoryInfo2Entries; +#endif #endregion #region Directory Copy Entries /// +#if NET48 public SabreTools.Models.GCF.DirectoryCopyEntry[] DirectoryCopyEntries => _model.DirectoryCopyEntries; +#else + public SabreTools.Models.GCF.DirectoryCopyEntry?[]? DirectoryCopyEntries => _model.DirectoryCopyEntries; +#endif #endregion #region Directory Local Entries /// +#if NET48 public SabreTools.Models.GCF.DirectoryLocalEntry[] DirectoryLocalEntries => _model.DirectoryLocalEntries; +#else + public SabreTools.Models.GCF.DirectoryLocalEntry?[]? DirectoryLocalEntries => _model.DirectoryLocalEntries; +#endif #endregion @@ -238,7 +274,11 @@ namespace BinaryObjectScanner.Wrappers #region Directory Map Entries /// +#if NET48 public SabreTools.Models.GCF.DirectoryMapEntry[] DirectoryMapEntries => _model.DirectoryMapEntries; +#else + public SabreTools.Models.GCF.DirectoryMapEntry?[]? DirectoryMapEntries => _model.DirectoryMapEntries; +#endif #endregion @@ -271,14 +311,22 @@ namespace BinaryObjectScanner.Wrappers #region Checksum Map Entries /// +#if NET48 public SabreTools.Models.GCF.ChecksumMapEntry[] ChecksumMapEntries => _model.ChecksumMapEntries; +#else + public SabreTools.Models.GCF.ChecksumMapEntry?[]? ChecksumMapEntries => _model.ChecksumMapEntries; +#endif #endregion #region Checksum Entries /// +#if NET48 public SabreTools.Models.GCF.ChecksumEntry[] ChecksumEntries => _model.ChecksumEntries; +#else + public SabreTools.Models.GCF.ChecksumEntry?[]? ChecksumEntries => _model.ChecksumEntries; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/InstallShieldCabinet.cs b/BinaryObjectScanner.Wrappers/InstallShieldCabinet.cs index 6d3a3f35..5affb6d3 100644 --- a/BinaryObjectScanner.Wrappers/InstallShieldCabinet.cs +++ b/BinaryObjectScanner.Wrappers/InstallShieldCabinet.cs @@ -177,35 +177,55 @@ namespace BinaryObjectScanner.Wrappers #region File Descriptors /// +#if NET48 public SabreTools.Models.InstallShieldCabinet.FileDescriptor[] FileDescriptors => _model.FileDescriptors; +#else + public SabreTools.Models.InstallShieldCabinet.FileDescriptor?[]? FileDescriptors => _model.FileDescriptors; +#endif #endregion #region File Group Offsets /// +#if NET48 public Dictionary FileGroupOffsets => _model.FileGroupOffsets; +#else + public Dictionary? FileGroupOffsets => _model.FileGroupOffsets; +#endif #endregion #region File Groups /// +#if NET48 public SabreTools.Models.InstallShieldCabinet.FileGroup[] FileGroups => _model.FileGroups; +#else + public SabreTools.Models.InstallShieldCabinet.FileGroup?[]? FileGroups => _model.FileGroups; +#endif #endregion #region Component Offsets /// +#if NET48 public Dictionary ComponentOffsets => _model.ComponentOffsets; +#else + public Dictionary? ComponentOffsets => _model.ComponentOffsets; +#endif #endregion #region Components /// +#if NET48 public SabreTools.Models.InstallShieldCabinet.Component[] Components => _model.Components; +#else + public SabreTools.Models.InstallShieldCabinet.Component?[]? Components => _model.Components; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/LinearExecutable.cs b/BinaryObjectScanner.Wrappers/LinearExecutable.cs index cfec7ea0..12fbe4dd 100644 --- a/BinaryObjectScanner.Wrappers/LinearExecutable.cs +++ b/BinaryObjectScanner.Wrappers/LinearExecutable.cs @@ -229,43 +229,95 @@ namespace BinaryObjectScanner.Wrappers #region Tables /// +#if NET48 public SabreTools.Models.LinearExecutable.ObjectTableEntry[] ObjectTable => _model.ObjectTable; +#else + public SabreTools.Models.LinearExecutable.ObjectTableEntry?[]? ObjectTable => _model.ObjectTable; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.ObjectPageMapEntry[] ObjectPageMap => _model.ObjectPageMap; +#else + public SabreTools.Models.LinearExecutable.ObjectPageMapEntry?[]? ObjectPageMap => _model.ObjectPageMap; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.ResourceTableEntry[] ResourceTable => _model.ResourceTable; +#else + public SabreTools.Models.LinearExecutable.ResourceTableEntry?[]? ResourceTable => _model.ResourceTable; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.ResidentNamesTableEntry[] ResidentNamesTable => _model.ResidentNamesTable; +#else + public SabreTools.Models.LinearExecutable.ResidentNamesTableEntry?[]? ResidentNamesTable => _model.ResidentNamesTable; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.EntryTableBundle[] EntryTable => _model.EntryTable; +#else + public SabreTools.Models.LinearExecutable.EntryTableBundle?[]? EntryTable => _model.EntryTable; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.ModuleFormatDirectivesTableEntry[] ModuleFormatDirectivesTable => _model.ModuleFormatDirectivesTable; +#else + public SabreTools.Models.LinearExecutable.ModuleFormatDirectivesTableEntry?[]? ModuleFormatDirectivesTable => _model.ModuleFormatDirectivesTable; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.VerifyRecordDirectiveTableEntry[] VerifyRecordDirectiveTable => _model.VerifyRecordDirectiveTable; +#else + public SabreTools.Models.LinearExecutable.VerifyRecordDirectiveTableEntry?[]? VerifyRecordDirectiveTable => _model.VerifyRecordDirectiveTable; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.PerPageChecksumTableEntry[] PerPageChecksumTable => _model.PerPageChecksumTable; +#else + public SabreTools.Models.LinearExecutable.PerPageChecksumTableEntry?[]? PerPageChecksumTable => _model.PerPageChecksumTable; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.FixupPageTableEntry[] FixupPageTable => _model.FixupPageTable; +#else + public SabreTools.Models.LinearExecutable.FixupPageTableEntry?[]? FixupPageTable => _model.FixupPageTable; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.FixupRecordTableEntry[] FixupRecordTable => _model.FixupRecordTable; +#else + public SabreTools.Models.LinearExecutable.FixupRecordTableEntry?[]? FixupRecordTable => _model.FixupRecordTable; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.ImportModuleNameTableEntry[] ImportModuleNameTable => _model.ImportModuleNameTable; +#else + public SabreTools.Models.LinearExecutable.ImportModuleNameTableEntry?[]? ImportModuleNameTable => _model.ImportModuleNameTable; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.ImportModuleProcedureNameTableEntry[] ImportModuleProcedureNameTable => _model.ImportModuleProcedureNameTable; +#else + public SabreTools.Models.LinearExecutable.ImportModuleProcedureNameTableEntry?[]? ImportModuleProcedureNameTable => _model.ImportModuleProcedureNameTable; +#endif /// +#if NET48 public SabreTools.Models.LinearExecutable.NonResidentNamesTableEntry[] NonResidentNamesTable => _model.NonResidentNamesTable; +#else + public SabreTools.Models.LinearExecutable.NonResidentNamesTableEntry?[]? NonResidentNamesTable => _model.NonResidentNamesTable; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/MSDOS.cs b/BinaryObjectScanner.Wrappers/MSDOS.cs index f86985ce..cdff2700 100644 --- a/BinaryObjectScanner.Wrappers/MSDOS.cs +++ b/BinaryObjectScanner.Wrappers/MSDOS.cs @@ -82,7 +82,11 @@ namespace BinaryObjectScanner.Wrappers #region Relocation Table /// +#if NET48 public SabreTools.Models.MSDOS.RelocationEntry[] RelocationTable => _model.RelocationTable; +#else + public SabreTools.Models.MSDOS.RelocationEntry?[]? RelocationTable => _model.RelocationTable; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/MicrosoftCabinet.cs b/BinaryObjectScanner.Wrappers/MicrosoftCabinet.cs index 76de3bd4..911b0e98 100644 --- a/BinaryObjectScanner.Wrappers/MicrosoftCabinet.cs +++ b/BinaryObjectScanner.Wrappers/MicrosoftCabinet.cs @@ -86,14 +86,22 @@ namespace BinaryObjectScanner.Wrappers #region Folders /// +#if NET48 public SabreTools.Models.MicrosoftCabinet.CFFOLDER[] Folders => _model.Folders; +#else + public SabreTools.Models.MicrosoftCabinet.CFFOLDER?[]? Folders => _model.Folders; +#endif #endregion #region Files /// +#if NET48 public SabreTools.Models.MicrosoftCabinet.CFFILE[] Files => _model.Files; +#else + public SabreTools.Models.MicrosoftCabinet.CFFILE?[]? Files => _model.Files; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/N3DS.cs b/BinaryObjectScanner.Wrappers/N3DS.cs index 7cb74df0..a0135f53 100644 --- a/BinaryObjectScanner.Wrappers/N3DS.cs +++ b/BinaryObjectScanner.Wrappers/N3DS.cs @@ -38,7 +38,11 @@ namespace BinaryObjectScanner.Wrappers public byte[] PartitionsCryptType => _model.Header.PartitionsCryptType; /// +#if NET48 public SabreTools.Models.N3DS.PartitionTableEntry[] PartitionsTable => _model.Header.PartitionsTable; +#else + public SabreTools.Models.N3DS.PartitionTableEntry?[]? PartitionsTable => _model.Header.PartitionsTable; +#endif #endregion @@ -194,28 +198,44 @@ namespace BinaryObjectScanner.Wrappers #region Partitions /// +#if NET48 public SabreTools.Models.N3DS.NCCHHeader[] Partitions => _model.Partitions; +#else + public SabreTools.Models.N3DS.NCCHHeader?[]? Partitions => _model.Partitions; +#endif #endregion #region Extended Headers /// +#if NET48 public SabreTools.Models.N3DS.NCCHExtendedHeader[] ExtendedHeaders => _model.ExtendedHeaders; +#else + public SabreTools.Models.N3DS.NCCHExtendedHeader?[]? ExtendedHeaders => _model.ExtendedHeaders; +#endif #endregion #region ExeFS Headers /// +#if NET48 public SabreTools.Models.N3DS.ExeFSHeader[] ExeFSHeaders => _model.ExeFSHeaders; +#else + public SabreTools.Models.N3DS.ExeFSHeader?[]? ExeFSHeaders => _model.ExeFSHeaders; +#endif #endregion #region RomFS Headers /// +#if NET48 public SabreTools.Models.N3DS.RomFSHeader[] RomFSHeaders => _model.RomFSHeaders; +#else + public SabreTools.Models.N3DS.RomFSHeader?[]? RomFSHeaders => _model.RomFSHeaders; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/NCF.cs b/BinaryObjectScanner.Wrappers/NCF.cs index 5d10c56e..196378d2 100644 --- a/BinaryObjectScanner.Wrappers/NCF.cs +++ b/BinaryObjectScanner.Wrappers/NCF.cs @@ -1,3 +1,4 @@ +using System.Collections.Generic; using System.IO; using System.Text; @@ -100,42 +101,66 @@ namespace BinaryObjectScanner.Wrappers #region Directory Entries /// +#if NET48 public SabreTools.Models.NCF.DirectoryEntry[] DirectoryEntries => _model.DirectoryEntries; +#else + public SabreTools.Models.NCF.DirectoryEntry?[]? DirectoryEntries => _model.DirectoryEntries; +#endif #endregion #region Directory Names /// - public System.Collections.Generic.Dictionary DirectoryNames => _model.DirectoryNames; +#if NET48 + public Dictionary DirectoryNames => _model.DirectoryNames; +#else + public Dictionary? DirectoryNames => _model.DirectoryNames; +#endif #endregion #region Directory Info 1 Entries /// +#if NET48 public SabreTools.Models.NCF.DirectoryInfo1Entry[] DirectoryInfo1Entries => _model.DirectoryInfo1Entries; +#else + public SabreTools.Models.NCF.DirectoryInfo1Entry?[]? DirectoryInfo1Entries => _model.DirectoryInfo1Entries; +#endif #endregion #region Directory Info 2 Entries /// +#if NET48 public SabreTools.Models.NCF.DirectoryInfo2Entry[] DirectoryInfo2Entries => _model.DirectoryInfo2Entries; +#else + public SabreTools.Models.NCF.DirectoryInfo2Entry?[]? DirectoryInfo2Entries => _model.DirectoryInfo2Entries; +#endif #endregion #region Directory Copy Entries /// +#if NET48 public SabreTools.Models.NCF.DirectoryCopyEntry[] DirectoryCopyEntries => _model.DirectoryCopyEntries; +#else + public SabreTools.Models.NCF.DirectoryCopyEntry?[]? DirectoryCopyEntries => _model.DirectoryCopyEntries; +#endif #endregion #region Directory Local Entries /// +#if NET48 public SabreTools.Models.NCF.DirectoryLocalEntry[] DirectoryLocalEntries => _model.DirectoryLocalEntries; +#else + public SabreTools.Models.NCF.DirectoryLocalEntry?[]? DirectoryLocalEntries => _model.DirectoryLocalEntries; +#endif #endregion @@ -152,7 +177,11 @@ namespace BinaryObjectScanner.Wrappers #region Unknown Entries /// +#if NET48 public SabreTools.Models.NCF.UnknownEntry[] UnknownEntries => _model.UnknownEntries; +#else + public SabreTools.Models.NCF.UnknownEntry?[]? UnknownEntries => _model.UnknownEntries; +#endif #endregion @@ -185,14 +214,22 @@ namespace BinaryObjectScanner.Wrappers #region Checksum Map Entries /// +#if NET48 public SabreTools.Models.NCF.ChecksumMapEntry[] ChecksumMapEntries => _model.ChecksumMapEntries; +#else + public SabreTools.Models.NCF.ChecksumMapEntry?[]? ChecksumMapEntries => _model.ChecksumMapEntries; +#endif #endregion #region Checksum Entries /// +#if NET48 public SabreTools.Models.NCF.ChecksumEntry[] ChecksumEntries => _model.ChecksumEntries; +#else + public SabreTools.Models.NCF.ChecksumEntry?[]? ChecksumEntries => _model.ChecksumEntries; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/NewExecutable.cs b/BinaryObjectScanner.Wrappers/NewExecutable.cs index fa831868..9da627b7 100644 --- a/BinaryObjectScanner.Wrappers/NewExecutable.cs +++ b/BinaryObjectScanner.Wrappers/NewExecutable.cs @@ -186,25 +186,53 @@ namespace BinaryObjectScanner.Wrappers #region Tables /// +#if NET48 public SabreTools.Models.NewExecutable.SegmentTableEntry[] SegmentTable => _model.SegmentTable; +#else + public SabreTools.Models.NewExecutable.SegmentTableEntry?[]? SegmentTable => _model.SegmentTable; +#endif /// +#if NET48 public SabreTools.Models.NewExecutable.ResourceTable ResourceTable => _model.ResourceTable; +#else + public SabreTools.Models.NewExecutable.ResourceTable? ResourceTable => _model.ResourceTable; +#endif /// +#if NET48 public SabreTools.Models.NewExecutable.ResidentNameTableEntry[] ResidentNameTable => _model.ResidentNameTable; +#else + public SabreTools.Models.NewExecutable.ResidentNameTableEntry?[]? ResidentNameTable => _model.ResidentNameTable; +#endif /// +#if NET48 public SabreTools.Models.NewExecutable.ModuleReferenceTableEntry[] ModuleReferenceTable => _model.ModuleReferenceTable; +#else + public SabreTools.Models.NewExecutable.ModuleReferenceTableEntry?[]? ModuleReferenceTable => _model.ModuleReferenceTable; +#endif /// +#if NET48 public Dictionary ImportedNameTable => _model.ImportedNameTable; +#else + public Dictionary? ImportedNameTable => _model.ImportedNameTable; +#endif /// +#if NET48 public SabreTools.Models.NewExecutable.EntryTableBundle[] EntryTable => _model.EntryTable; +#else + public SabreTools.Models.NewExecutable.EntryTableBundle?[]? EntryTable => _model.EntryTable; +#endif /// +#if NET48 public SabreTools.Models.NewExecutable.NonResidentNameTableEntry[] NonResidentNameTable => _model.NonResidentNameTable; +#else + public SabreTools.Models.NewExecutable.NonResidentNameTableEntry?[]? NonResidentNameTable => _model.NonResidentNameTable; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/Nitro.cs b/BinaryObjectScanner.Wrappers/Nitro.cs index 44c54b8d..0e938a22 100644 --- a/BinaryObjectScanner.Wrappers/Nitro.cs +++ b/BinaryObjectScanner.Wrappers/Nitro.cs @@ -300,17 +300,29 @@ namespace BinaryObjectScanner.Wrappers #region Name Table /// +#if NET48 public SabreTools.Models.Nitro.FolderAllocationTableEntry[] FolderAllocationTable => _model.NameTable.FolderAllocationTable; +#else + public SabreTools.Models.Nitro.FolderAllocationTableEntry?[]? FolderAllocationTable => _model.NameTable.FolderAllocationTable; +#endif /// +#if NET48 public SabreTools.Models.Nitro.NameListEntry[] NameList => _model.NameTable.NameList; +#else + public SabreTools.Models.Nitro.NameListEntry?[]? NameList => _model.NameTable.NameList; +#endif #endregion #region File Allocation Table /// +#if NET48 public SabreTools.Models.Nitro.FileAllocationTableEntry[] FileAllocationTable => _model.FileAllocationTable; +#else + public SabreTools.Models.Nitro.FileAllocationTableEntry?[]? FileAllocationTable => _model.FileAllocationTable; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/PAK.cs b/BinaryObjectScanner.Wrappers/PAK.cs index 46f9fea4..7a01c087 100644 --- a/BinaryObjectScanner.Wrappers/PAK.cs +++ b/BinaryObjectScanner.Wrappers/PAK.cs @@ -30,7 +30,11 @@ namespace BinaryObjectScanner.Wrappers #region Directory Items /// +#if NET48 public SabreTools.Models.PAK.DirectoryItem[] DirectoryItems => _model.DirectoryItems; +#else + public SabreTools.Models.PAK.DirectoryItem?[]? DirectoryItems => _model.DirectoryItems; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/PFF.cs b/BinaryObjectScanner.Wrappers/PFF.cs index 02f5d9e5..44f23f24 100644 --- a/BinaryObjectScanner.Wrappers/PFF.cs +++ b/BinaryObjectScanner.Wrappers/PFF.cs @@ -36,7 +36,11 @@ namespace BinaryObjectScanner.Wrappers #region Segments /// +#if NET48 public SabreTools.Models.PFF.Segment[] Segments => _model.Segments; +#else + public SabreTools.Models.PFF.Segment?[]? Segments => _model.Segments; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/PlayJAudioFile.cs b/BinaryObjectScanner.Wrappers/PlayJAudioFile.cs index 7249b763..312d21cb 100644 --- a/BinaryObjectScanner.Wrappers/PlayJAudioFile.cs +++ b/BinaryObjectScanner.Wrappers/PlayJAudioFile.cs @@ -214,7 +214,11 @@ namespace BinaryObjectScanner.Wrappers #region Unknown Block 3 /// +#if NET48 public SabreTools.Models.PlayJ.DataFile[] DataFiles => _model.DataFiles; +#else + public SabreTools.Models.PlayJ.DataFile?[]? DataFiles => _model.DataFiles; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/PortableExecutable.cs b/BinaryObjectScanner.Wrappers/PortableExecutable.cs index b456204e..b301c5fe 100644 --- a/BinaryObjectScanner.Wrappers/PortableExecutable.cs +++ b/BinaryObjectScanner.Wrappers/PortableExecutable.cs @@ -287,16 +287,28 @@ namespace BinaryObjectScanner.Wrappers #region Tables /// +#if NET48 public SabreTools.Models.PortableExecutable.SectionHeader[] SectionTable => _model.SectionTable; +#else + public SabreTools.Models.PortableExecutable.SectionHeader?[]? SectionTable => _model.SectionTable; +#endif /// +#if NET48 public SabreTools.Models.PortableExecutable.COFFSymbolTableEntry[] COFFSymbolTable => _model.COFFSymbolTable; +#else + public SabreTools.Models.PortableExecutable.COFFSymbolTableEntry?[]? COFFSymbolTable => _model.COFFSymbolTable; +#endif /// public SabreTools.Models.PortableExecutable.COFFStringTable COFFStringTable => _model.COFFStringTable; /// +#if NET48 public SabreTools.Models.PortableExecutable.AttributeCertificateTableEntry[] AttributeCertificateTable => _model.AttributeCertificateTable; +#else + public SabreTools.Models.PortableExecutable.AttributeCertificateTableEntry?[]? AttributeCertificateTable => _model.AttributeCertificateTable; +#endif /// public SabreTools.Models.PortableExecutable.DelayLoadDirectoryTable DelayLoadDirectoryTable => _model.DelayLoadDirectoryTable; @@ -306,7 +318,11 @@ namespace BinaryObjectScanner.Wrappers #region Sections /// +#if NET48 public SabreTools.Models.PortableExecutable.BaseRelocationBlock[] BaseRelocationTable => _model.BaseRelocationTable; +#else + public SabreTools.Models.PortableExecutable.BaseRelocationBlock?[]? BaseRelocationTable => _model.BaseRelocationTable; +#endif /// public SabreTools.Models.PortableExecutable.DebugTable DebugTable => _model.DebugTable; @@ -321,7 +337,11 @@ namespace BinaryObjectScanner.Wrappers public SabreTools.Models.PortableExecutable.ImportTable ImportTable => _model.ImportTable; /// +#if NET48 public string[] ImportHintNameTable => _model.ImportTable?.HintNameTable != null +#else + public string?[]? ImportHintNameTable => _model.ImportTable?.HintNameTable != null +#endif ? _model.ImportTable.HintNameTable.Select(entry => entry.Name).ToArray() : null; @@ -476,7 +496,7 @@ namespace BinaryObjectScanner.Wrappers // If we didn't find the end of section data if (endOfSectionData <= 0) endOfSectionData = -1; - + // Cache and return the position _overlayAddress = endOfSectionData; return _overlayAddress.Value; @@ -2423,7 +2443,11 @@ namespace BinaryObjectScanner.Wrappers { string padding = new string(' ', (level + 1) * 2); +#if NET48 Dictionary stringTable = null; +#else + Dictionary? stringTable = null; +#endif try { stringTable = entry.AsStringTable(); } catch { } if (stringTable == null) { @@ -3021,11 +3045,19 @@ namespace BinaryObjectScanner.Wrappers /// /// Partial path to check for /// Enumerable of matching debug data +#if NET48 public IEnumerable FindCodeViewDebugTableByPath(string path) +#else + public IEnumerable FindCodeViewDebugTableByPath(string path) +#endif { // Ensure that we have the debug data cached if (DebugData == null) +#if NET48 return Enumerable.Empty(); +#else + return Enumerable.Empty(); +#endif var nb10Found = DebugData.Select(r => r.Value) .Select(r => r as SabreTools.Models.PortableExecutable.NB10ProgramDatabase) @@ -3047,11 +3079,19 @@ namespace BinaryObjectScanner.Wrappers /// /// String value to check for /// Enumerable of matching debug data +#if NET48 public IEnumerable FindGenericDebugTableByValue(string value) +#else + public IEnumerable FindGenericDebugTableByValue(string value) +#endif { // Ensure that we have the resource data cached if (DebugData == null) +#if NET48 return Enumerable.Empty(); +#else + return Enumerable.Empty(); +#endif return DebugData.Select(r => r.Value) .Select(b => b as byte[]) @@ -3155,11 +3195,19 @@ namespace BinaryObjectScanner.Wrappers /// /// Dialog box title to check for /// Enumerable of matching resources +#if NET48 public IEnumerable FindDialogByTitle(string title) +#else + public IEnumerable FindDialogByTitle(string title) +#endif { // Ensure that we have the resource data cached if (ResourceData == null) +#if NET48 return Enumerable.Empty(); +#else + return Enumerable.Empty(); +#endif return ResourceData.Select(r => r.Value) .Select(r => r as SabreTools.Models.PortableExecutable.DialogBoxResource) @@ -3176,11 +3224,19 @@ namespace BinaryObjectScanner.Wrappers /// /// Dialog box item title to check for /// Enumerable of matching resources +#if NET48 public IEnumerable FindDialogBoxByItemTitle(string title) +#else + public IEnumerable FindDialogBoxByItemTitle(string title) +#endif { // Ensure that we have the resource data cached if (ResourceData == null) +#if NET48 return Enumerable.Empty(); +#else + return Enumerable.Empty(); +#endif return ResourceData.Select(r => r.Value) .Select(r => r as SabreTools.Models.PortableExecutable.DialogBoxResource) @@ -3209,14 +3265,26 @@ namespace BinaryObjectScanner.Wrappers /// /// String entry to check for /// Enumerable of matching resources +#if NET48 public IEnumerable> FindStringTableByEntry(string entry) +#else + public IEnumerable?> FindStringTableByEntry(string entry) +#endif { // Ensure that we have the resource data cached if (ResourceData == null) +#if NET48 return Enumerable.Empty>(); +#else + return Enumerable.Empty?>(); +#endif return ResourceData.Select(r => r.Value) +#if NET48 .Select(r => r as Dictionary) +#else + .Select(r => r as Dictionary) +#endif .Where(st => st != null) .Where(st => st.Select(kvp => kvp.Value) .Any(s => s.Contains(entry))); @@ -3227,11 +3295,19 @@ namespace BinaryObjectScanner.Wrappers /// /// Type name to check for /// Enumerable of matching resources +#if NET48 public IEnumerable FindResourceByNamedType(string typeName) +#else + public IEnumerable FindResourceByNamedType(string typeName) +#endif { // Ensure that we have the resource data cached if (ResourceData == null) +#if NET48 return Enumerable.Empty(); +#else + return Enumerable.Empty(); +#endif return ResourceData.Where(kvp => kvp.Key.Contains(typeName)) .Select(kvp => kvp.Value as byte[]) @@ -3243,11 +3319,19 @@ namespace BinaryObjectScanner.Wrappers /// /// String value to check for /// Enumerable of matching resources +#if NET48 public IEnumerable FindGenericResource(string value) +#else + public IEnumerable FindGenericResource(string value) +#endif { // Ensure that we have the resource data cached if (ResourceData == null) +#if NET48 return Enumerable.Empty(); +#else + return Enumerable.Empty(); +#endif return ResourceData.Select(r => r.Value) .Select(r => r as byte[]) diff --git a/BinaryObjectScanner.Wrappers/Quantum.cs b/BinaryObjectScanner.Wrappers/Quantum.cs index 43fecd5c..3e3519ec 100644 --- a/BinaryObjectScanner.Wrappers/Quantum.cs +++ b/BinaryObjectScanner.Wrappers/Quantum.cs @@ -39,7 +39,11 @@ namespace BinaryObjectScanner.Wrappers #region File List /// +#if NET48 public SabreTools.Models.Quantum.FileDescriptor[] FileList => _model.FileList; +#else + public SabreTools.Models.Quantum.FileDescriptor?[]? FileList => _model.FileList; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/SGA.cs b/BinaryObjectScanner.Wrappers/SGA.cs index fefe70d7..b32a35dc 100644 --- a/BinaryObjectScanner.Wrappers/SGA.cs +++ b/BinaryObjectScanner.Wrappers/SGA.cs @@ -30,7 +30,11 @@ namespace BinaryObjectScanner.Wrappers public ushort MinorVersion => _model.Header.MinorVersion; /// +#if NET48 public byte[] FileMD5 +#else + public byte[]? FileMD5 +#endif { get { @@ -44,7 +48,11 @@ namespace BinaryObjectScanner.Wrappers } /// +#if NET48 public string Name +#else + public string? Name +#endif { get { @@ -60,7 +68,11 @@ namespace BinaryObjectScanner.Wrappers } /// +#if NET48 public byte[] HeaderMD5 +#else + public byte[]? HeaderMD5 +#endif { get { @@ -286,7 +298,11 @@ namespace BinaryObjectScanner.Wrappers #region Sections /// +#if NET48 public object[] Sections +#else + public object?[]? Sections +#endif { get { @@ -306,7 +322,11 @@ namespace BinaryObjectScanner.Wrappers #region Folders /// +#if NET48 public object[] Folders +#else + public object?[]? Folders +#endif { get { @@ -326,7 +346,11 @@ namespace BinaryObjectScanner.Wrappers #region Files /// +#if NET48 public object[] Files +#else + public object?[]? Files +#endif { get { diff --git a/BinaryObjectScanner.Wrappers/VBSP.cs b/BinaryObjectScanner.Wrappers/VBSP.cs index 93e06ea7..79595428 100644 --- a/BinaryObjectScanner.Wrappers/VBSP.cs +++ b/BinaryObjectScanner.Wrappers/VBSP.cs @@ -22,7 +22,11 @@ namespace BinaryObjectScanner.Wrappers public int Version => _model.Header.Version; /// +#if NET48 public SabreTools.Models.VBSP.Lump[] Lumps => _model.Header.Lumps; +#else + public SabreTools.Models.VBSP.Lump?[]? Lumps => _model.Header.Lumps; +#endif /// public int MapRevision => _model.Header.MapRevision; diff --git a/BinaryObjectScanner.Wrappers/VPK.cs b/BinaryObjectScanner.Wrappers/VPK.cs index e2fdc46a..5bd516e9 100644 --- a/BinaryObjectScanner.Wrappers/VPK.cs +++ b/BinaryObjectScanner.Wrappers/VPK.cs @@ -50,14 +50,22 @@ namespace BinaryObjectScanner.Wrappers #region Archive Hashes /// +#if NET48 public SabreTools.Models.VPK.ArchiveHash[] ArchiveHashes => _model.ArchiveHashes; +#else + public SabreTools.Models.VPK.ArchiveHash?[]? ArchiveHashes => _model.ArchiveHashes; +#endif #endregion #region Directory Items /// +#if NET48 public SabreTools.Models.VPK.DirectoryItem[] DirectoryItems => _model.DirectoryItems; +#else + public SabreTools.Models.VPK.DirectoryItem?[]? DirectoryItems => _model.DirectoryItems; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/WAD.cs b/BinaryObjectScanner.Wrappers/WAD.cs index fe2cf781..cb89b1be 100644 --- a/BinaryObjectScanner.Wrappers/WAD.cs +++ b/BinaryObjectScanner.Wrappers/WAD.cs @@ -30,14 +30,22 @@ namespace BinaryObjectScanner.Wrappers #region Lumps /// +#if NET48 public SabreTools.Models.WAD.Lump[] Lumps => _model.Lumps; +#else + public SabreTools.Models.WAD.Lump?[]? Lumps => _model.Lumps; +#endif #endregion #region Lump Infos /// +#if NET48 public SabreTools.Models.WAD.LumpInfo[] LumpInfos => _model.LumpInfos; +#else + public SabreTools.Models.WAD.LumpInfo?[]? LumpInfos => _model.LumpInfos; +#endif #endregion diff --git a/BinaryObjectScanner.Wrappers/XZP.cs b/BinaryObjectScanner.Wrappers/XZP.cs index e3f701a7..85071e93 100644 --- a/BinaryObjectScanner.Wrappers/XZP.cs +++ b/BinaryObjectScanner.Wrappers/XZP.cs @@ -49,28 +49,44 @@ namespace BinaryObjectScanner.Wrappers #region Directory Entries /// +#if NET48 public SabreTools.Models.XZP.DirectoryEntry[] DirectoryEntries => _model.DirectoryEntries; +#else + public SabreTools.Models.XZP.DirectoryEntry?[]? DirectoryEntries => _model.DirectoryEntries; +#endif #endregion #region Preload Directory Entries /// +#if NET48 public SabreTools.Models.XZP.DirectoryEntry[] PreloadDirectoryEntries => _model.PreloadDirectoryEntries; +#else + public SabreTools.Models.XZP.DirectoryEntry?[]? PreloadDirectoryEntries => _model.PreloadDirectoryEntries; +#endif #endregion #region Preload Directory Entries /// +#if NET48 public SabreTools.Models.XZP.DirectoryMapping[] PreloadDirectoryMappings => _model.PreloadDirectoryMappings; +#else + public SabreTools.Models.XZP.DirectoryMapping?[]? PreloadDirectoryMappings => _model.PreloadDirectoryMappings; +#endif #endregion #region Directory Items /// +#if NET48 public SabreTools.Models.XZP.DirectoryItem[] DirectoryItems => _model.DirectoryItems; +#else + public SabreTools.Models.XZP.DirectoryItem?[]? DirectoryItems => _model.DirectoryItems; +#endif #endregion