diff --git a/BFPK/Header.cs b/BFPK/Header.cs index 5efbe70..ad13ad9 100644 --- a/BFPK/Header.cs +++ b/BFPK/Header.cs @@ -1,12 +1,9 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.BFPK +namespace SabreTools.Models.BFPK { /// /// Header /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class Header { /// diff --git a/LinearExecutable/DebugInformation.cs b/LinearExecutable/DebugInformation.cs index 6725430..5f6b361 100644 --- a/LinearExecutable/DebugInformation.cs +++ b/LinearExecutable/DebugInformation.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The debug information is defined by the debugger and is not controlled by @@ -13,7 +11,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class DebugInformation { /// diff --git a/LinearExecutable/EntryTableBundle.cs b/LinearExecutable/EntryTableBundle.cs index 9893ad2..638750e 100644 --- a/LinearExecutable/EntryTableBundle.cs +++ b/LinearExecutable/EntryTableBundle.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The entry table contains object and offset information that is used to resolve @@ -17,7 +15,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class EntryTableBundle { /// diff --git a/LinearExecutable/FixupPageTableEntry.cs b/LinearExecutable/FixupPageTableEntry.cs index b1279ee..e386d1c 100644 --- a/LinearExecutable/FixupPageTableEntry.cs +++ b/LinearExecutable/FixupPageTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The Fixup Page Table provides a simple mapping of a logical page number @@ -17,7 +15,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class FixupPageTableEntry { /// diff --git a/LinearExecutable/ImportModuleNameTableEntry.cs b/LinearExecutable/ImportModuleNameTableEntry.cs index 7ef82d0..f202143 100644 --- a/LinearExecutable/ImportModuleNameTableEntry.cs +++ b/LinearExecutable/ImportModuleNameTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The import module name table defines the module name strings imported through @@ -17,7 +15,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ImportModuleNameTableEntry { /// diff --git a/LinearExecutable/ImportProcedureNameTableEntry.cs b/LinearExecutable/ImportProcedureNameTableEntry.cs index fa26d2f..b52550d 100644 --- a/LinearExecutable/ImportProcedureNameTableEntry.cs +++ b/LinearExecutable/ImportProcedureNameTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The import procedure name table defines the procedure name strings imported @@ -20,7 +18,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ImportModuleProcedureNameTableEntry { /// diff --git a/LinearExecutable/InformationBlock.cs b/LinearExecutable/InformationBlock.cs index b635376..3defb14 100644 --- a/LinearExecutable/InformationBlock.cs +++ b/LinearExecutable/InformationBlock.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The `information block` in the LE header contains the linker version number, @@ -12,7 +10,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class InformationBlock { /// diff --git a/LinearExecutable/ModuleFormatDirectivesTableEntry.cs b/LinearExecutable/ModuleFormatDirectivesTableEntry.cs index 9530351..41aafcb 100644 --- a/LinearExecutable/ModuleFormatDirectivesTableEntry.cs +++ b/LinearExecutable/ModuleFormatDirectivesTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The Module Format Directives Table is an optional table that allows additional @@ -15,7 +13,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ModuleFormatDirectivesTableEntry { /// diff --git a/LinearExecutable/NonResidentNamesTableEntry.cs b/LinearExecutable/NonResidentNamesTableEntry.cs index f72c358..2a5aefd 100644 --- a/LinearExecutable/NonResidentNamesTableEntry.cs +++ b/LinearExecutable/NonResidentNamesTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The resident and non-resident name tables define the ASCII names and ordinal @@ -27,7 +25,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class NonResidentNamesTableEntry { /// diff --git a/LinearExecutable/ObjectPageMapEntry.cs b/LinearExecutable/ObjectPageMapEntry.cs index 25f7525..29dd268 100644 --- a/LinearExecutable/ObjectPageMapEntry.cs +++ b/LinearExecutable/ObjectPageMapEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The Object page table provides information about a logical page in an object. @@ -15,7 +13,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ObjectPageMapEntry { /// diff --git a/LinearExecutable/ObjectTableEntry.cs b/LinearExecutable/ObjectTableEntry.cs index acc15ed..e851e41 100644 --- a/LinearExecutable/ObjectTableEntry.cs +++ b/LinearExecutable/ObjectTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The object table contains information that describes each segment in @@ -14,7 +12,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ObjectTableEntry { /// diff --git a/LinearExecutable/PerPageChecksumTableEntry.cs b/LinearExecutable/PerPageChecksumTableEntry.cs index c07ef92..9ede004 100644 --- a/LinearExecutable/PerPageChecksumTableEntry.cs +++ b/LinearExecutable/PerPageChecksumTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The Per-Page Checksum table provides space for a cryptographic checksum for @@ -13,7 +11,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class PerPageChecksumTableEntry { /// diff --git a/LinearExecutable/ResidentNamesTableEntry.cs b/LinearExecutable/ResidentNamesTableEntry.cs index 80e292b..d52ba48 100644 --- a/LinearExecutable/ResidentNamesTableEntry.cs +++ b/LinearExecutable/ResidentNamesTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The resident and non-resident name tables define the ASCII names and ordinal @@ -27,7 +25,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ResidentNamesTableEntry { /// diff --git a/LinearExecutable/ResourceTableEntry.cs b/LinearExecutable/ResourceTableEntry.cs index 7c08b4e..bd991ef 100644 --- a/LinearExecutable/ResourceTableEntry.cs +++ b/LinearExecutable/ResourceTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The resource table is an array of resource table entries. Each resource table @@ -15,7 +13,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ResourceTableEntry { /// diff --git a/LinearExecutable/VerifyRecordDirectiveTableEntry.cs b/LinearExecutable/VerifyRecordDirectiveTableEntry.cs index 9b24b49..115892e 100644 --- a/LinearExecutable/VerifyRecordDirectiveTableEntry.cs +++ b/LinearExecutable/VerifyRecordDirectiveTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.LinearExecutable +namespace SabreTools.Models.LinearExecutable { /// /// The Verify Record Directive Table is an optional table. It maintains a record @@ -11,7 +9,6 @@ namespace SabreTools.Models.LinearExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class VerifyRecordDirectiveTableEntry { /// diff --git a/MSDOS/ExecutableHeader.cs b/MSDOS/ExecutableHeader.cs index ac2c9d8..452775a 100644 --- a/MSDOS/ExecutableHeader.cs +++ b/MSDOS/ExecutableHeader.cs @@ -1,5 +1,3 @@ -using System.Runtime.InteropServices; - namespace SabreTools.Models.MSDOS { /// @@ -8,7 +6,6 @@ namespace SabreTools.Models.MSDOS /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ExecutableHeader { #region Standard Fields @@ -16,11 +13,10 @@ namespace SabreTools.Models.MSDOS /// /// 0x5A4D (ASCII for 'M' and 'Z') /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] #if NET48 - public string Magic; + public string Magic { get; set; } #else - public string? Magic; + public string? Magic { get; set; } #endif /// @@ -105,11 +101,10 @@ namespace SabreTools.Models.MSDOS /// /// Reserved words /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] #if NET48 - public ushort[] Reserved1; + public ushort[] Reserved1 { get; set; } = new ushort[4]; #else - public ushort[]? Reserved1; + public ushort[]? Reserved1 { get; set; } = new ushort[4]; #endif /// @@ -125,11 +120,10 @@ namespace SabreTools.Models.MSDOS /// /// Reserved words /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] #if NET48 - public ushort[] Reserved2; + public ushort[] Reserved2 { get; set; } = new ushort[10]; #else - public ushort[]? Reserved2; + public ushort[]? Reserved2 { get; set; } = new ushort[10]; #endif /// diff --git a/MSDOS/RelocationEntry.cs b/MSDOS/RelocationEntry.cs index 81cbc86..53cf736 100644 --- a/MSDOS/RelocationEntry.cs +++ b/MSDOS/RelocationEntry.cs @@ -1,12 +1,9 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MSDOS +namespace SabreTools.Models.MSDOS { /// /// Each pointer in the relocation table looks as such /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class RelocationEntry { /// diff --git a/MicrosoftCabinet/CFDATA.cs b/MicrosoftCabinet/CFDATA.cs index da28484..bb3315d 100644 --- a/MicrosoftCabinet/CFDATA.cs +++ b/MicrosoftCabinet/CFDATA.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MicrosoftCabinet +namespace SabreTools.Models.MicrosoftCabinet { /// /// Each CFDATA structure describes some amount of compressed data, as shown in the following @@ -9,7 +7,6 @@ namespace SabreTools.Models.MicrosoftCabinet /// contiguous. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class CFDATA { /// diff --git a/MicrosoftCabinet/CFFILE.cs b/MicrosoftCabinet/CFFILE.cs index 3a6f0e8..7664b34 100644 --- a/MicrosoftCabinet/CFFILE.cs +++ b/MicrosoftCabinet/CFFILE.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MicrosoftCabinet +namespace SabreTools.Models.MicrosoftCabinet { /// /// Each CFFILE structure contains information about one of the files stored (or at least partially @@ -12,7 +10,6 @@ namespace SabreTools.Models.MicrosoftCabinet /// will be last. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class CFFILE { /// diff --git a/MicrosoftCabinet/CFFOLDER.cs b/MicrosoftCabinet/CFFOLDER.cs index 8b69f27..e575c2d 100644 --- a/MicrosoftCabinet/CFFOLDER.cs +++ b/MicrosoftCabinet/CFFOLDER.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MicrosoftCabinet +namespace SabreTools.Models.MicrosoftCabinet { /// /// Each CFFOLDER structure contains information about one of the folders or partial folders stored in @@ -22,7 +20,6 @@ namespace SabreTools.Models.MicrosoftCabinet /// previous cabinet file. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class CFFOLDER { /// diff --git a/MicrosoftCabinet/CFHEADER.cs b/MicrosoftCabinet/CFHEADER.cs index 433aad7..720419b 100644 --- a/MicrosoftCabinet/CFHEADER.cs +++ b/MicrosoftCabinet/CFHEADER.cs @@ -1,13 +1,10 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MicrosoftCabinet +namespace SabreTools.Models.MicrosoftCabinet { /// /// The CFHEADER structure shown in the following packet diagram provides information about this /// cabinet (.cab) file. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class CFHEADER { /// diff --git a/MoPaQ/ArchiveHeader.cs b/MoPaQ/ArchiveHeader.cs index 8d0e550..15519b2 100644 --- a/MoPaQ/ArchiveHeader.cs +++ b/MoPaQ/ArchiveHeader.cs @@ -1,12 +1,9 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MoPaQ +namespace SabreTools.Models.MoPaQ { /// /// MoPaQ archive header /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ArchiveHeader { #region V1 Properties diff --git a/MoPaQ/BetTable.cs b/MoPaQ/BetTable.cs index 4abe8b9..2779d46 100644 --- a/MoPaQ/BetTable.cs +++ b/MoPaQ/BetTable.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MoPaQ +namespace SabreTools.Models.MoPaQ { /// /// The BET table is present if the BetTablePos64 member of MPQ header is set @@ -8,7 +6,6 @@ namespace SabreTools.Models.MoPaQ /// replace it. It is also supposed to be more effective. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class BetTable { // TODO: Extract this out and make in common between HET and BET diff --git a/MoPaQ/BlockEntry.cs b/MoPaQ/BlockEntry.cs index 5a49cdd..48b6904 100644 --- a/MoPaQ/BlockEntry.cs +++ b/MoPaQ/BlockEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MoPaQ +namespace SabreTools.Models.MoPaQ { /// /// Block table contains informations about file sizes and way of their storage within @@ -8,7 +6,6 @@ namespace SabreTools.Models.MoPaQ /// of block table entry is (like hash table entry). The block table is also encrypted. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class BlockEntry { /// diff --git a/MoPaQ/HashEntry.cs b/MoPaQ/HashEntry.cs index ba282b4..67ccb91 100644 --- a/MoPaQ/HashEntry.cs +++ b/MoPaQ/HashEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MoPaQ +namespace SabreTools.Models.MoPaQ { /// /// Hash table is used for searching files by name. The file name is converted to @@ -10,7 +8,6 @@ namespace SabreTools.Models.MoPaQ /// table is 16 bytes. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class HashEntry { /// diff --git a/MoPaQ/HetTable.cs b/MoPaQ/HetTable.cs index d826b5f..2a62c9d 100644 --- a/MoPaQ/HetTable.cs +++ b/MoPaQ/HetTable.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MoPaQ +namespace SabreTools.Models.MoPaQ { /// /// The HET table is present if the HetTablePos64 member of MPQ header is @@ -9,7 +7,6 @@ namespace SabreTools.Models.MoPaQ /// table. HET table can be encrypted and compressed. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class HetTable { // TODO: Extract this out and make in common between HET and BET diff --git a/MoPaQ/PatchHeader.cs b/MoPaQ/PatchHeader.cs index 8ab6e57..b5631fc 100644 --- a/MoPaQ/PatchHeader.cs +++ b/MoPaQ/PatchHeader.cs @@ -1,13 +1,10 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MoPaQ +namespace SabreTools.Models.MoPaQ { /// /// Each incremental patch file in a patch MPQ starts with a header. It is supposed /// to be a structure with variable length. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class PatchHeader { #region PATCH Header diff --git a/MoPaQ/PatchInfo.cs b/MoPaQ/PatchInfo.cs index cc6a84c..83e719e 100644 --- a/MoPaQ/PatchInfo.cs +++ b/MoPaQ/PatchInfo.cs @@ -1,12 +1,9 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MoPaQ +namespace SabreTools.Models.MoPaQ { /// /// This structure contains size of the patch, flags and also MD5 of the patch. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class PatchInfo { /// diff --git a/MoPaQ/UserData.cs b/MoPaQ/UserData.cs index f2651f7..f5b147b 100644 --- a/MoPaQ/UserData.cs +++ b/MoPaQ/UserData.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.MoPaQ +namespace SabreTools.Models.MoPaQ { /// /// MPQ User Data are optional, and is commonly used in custom maps for @@ -8,7 +6,6 @@ namespace SabreTools.Models.MoPaQ /// from where the MPQ header should be searched. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class UserData { /// diff --git a/NewExecutable/ExecutableHeader.cs b/NewExecutable/ExecutableHeader.cs index 4f43e15..ebda8b7 100644 --- a/NewExecutable/ExecutableHeader.cs +++ b/NewExecutable/ExecutableHeader.cs @@ -1,5 +1,3 @@ -using System.Runtime.InteropServices; - namespace SabreTools.Models.NewExecutable { /// @@ -8,7 +6,6 @@ namespace SabreTools.Models.NewExecutable /// /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ExecutableHeader { /// @@ -16,7 +13,6 @@ namespace SabreTools.Models.NewExecutable /// "N" is low-order byte. /// "E" is high-order byte. /// - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] #if NET48 public string Magic; #else diff --git a/NewExecutable/ImportNameRelocationRecord.cs b/NewExecutable/ImportNameRelocationRecord.cs index 2470d7d..a71bd3d 100644 --- a/NewExecutable/ImportNameRelocationRecord.cs +++ b/NewExecutable/ImportNameRelocationRecord.cs @@ -1,9 +1,6 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// - [StructLayout(LayoutKind.Sequential)] public sealed class ImportNameRelocationRecord { /// diff --git a/NewExecutable/ImportOrdinalRelocationRecord.cs b/NewExecutable/ImportOrdinalRelocationRecord.cs index 1f3e05f..0d357b0 100644 --- a/NewExecutable/ImportOrdinalRelocationRecord.cs +++ b/NewExecutable/ImportOrdinalRelocationRecord.cs @@ -1,9 +1,6 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// - [StructLayout(LayoutKind.Sequential)] public sealed class ImportOrdinalRelocationRecord { /// diff --git a/NewExecutable/ImportedNameTableEntry.cs b/NewExecutable/ImportedNameTableEntry.cs index 9ba08a0..3fe09f8 100644 --- a/NewExecutable/ImportedNameTableEntry.cs +++ b/NewExecutable/ImportedNameTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// /// The imported-name table follows the module-reference table. This table @@ -11,7 +9,6 @@ namespace SabreTools.Models.NewExecutable /// sensitive. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ImportedNameTableEntry { /// diff --git a/NewExecutable/InternalRefRelocationRecord.cs b/NewExecutable/InternalRefRelocationRecord.cs index 16e8342..4a6b38c 100644 --- a/NewExecutable/InternalRefRelocationRecord.cs +++ b/NewExecutable/InternalRefRelocationRecord.cs @@ -1,9 +1,6 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// - [StructLayout(LayoutKind.Sequential)] public sealed class InternalRefRelocationRecord { /// diff --git a/NewExecutable/ModuleReferenceTableEntry.cs b/NewExecutable/ModuleReferenceTableEntry.cs index 780a58b..2b1b23a 100644 --- a/NewExecutable/ModuleReferenceTableEntry.cs +++ b/NewExecutable/ModuleReferenceTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// /// The module-reference table follows the resident-name table. Each entry @@ -8,7 +6,6 @@ namespace SabreTools.Models.NewExecutable /// names table; each entry is 2 bytes long. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ModuleReferenceTableEntry { /// diff --git a/NewExecutable/NonResidentNameTableEntry.cs b/NewExecutable/NonResidentNameTableEntry.cs index 48c161d..3e2e46b 100644 --- a/NewExecutable/NonResidentNameTableEntry.cs +++ b/NewExecutable/NonResidentNameTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// /// The nonresident-name table follows the entry table, and contains a @@ -11,7 +9,6 @@ namespace SabreTools.Models.NewExecutable /// table. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class NonResidentNameTableEntry { /// diff --git a/NewExecutable/OSFixupRelocationRecord.cs b/NewExecutable/OSFixupRelocationRecord.cs index 4b33637..b7a79b3 100644 --- a/NewExecutable/OSFixupRelocationRecord.cs +++ b/NewExecutable/OSFixupRelocationRecord.cs @@ -1,9 +1,6 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// - [StructLayout(LayoutKind.Sequential)] public sealed class OSFixupRelocationRecord { /// diff --git a/NewExecutable/RelocationRecord.cs b/NewExecutable/RelocationRecord.cs index daccd21..22f37a2 100644 --- a/NewExecutable/RelocationRecord.cs +++ b/NewExecutable/RelocationRecord.cs @@ -1,13 +1,10 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// /// A table of relocation records follows. The following is the format /// of each relocation record. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class RelocationRecord { /// diff --git a/NewExecutable/ResidentNameTableEntry.cs b/NewExecutable/ResidentNameTableEntry.cs index 642bc95..baabc86 100644 --- a/NewExecutable/ResidentNameTableEntry.cs +++ b/NewExecutable/ResidentNameTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// /// The resident-name table follows the resource table, and contains this @@ -10,7 +8,6 @@ namespace SabreTools.Models.NewExecutable /// describes the format of the name strings: /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ResidentNameTableEntry { /// diff --git a/NewExecutable/ResourceTable.cs b/NewExecutable/ResourceTable.cs index c279b90..6a4eb3c 100644 --- a/NewExecutable/ResourceTable.cs +++ b/NewExecutable/ResourceTable.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using System.Runtime.InteropServices; namespace SabreTools.Models.NewExecutable { @@ -14,7 +13,6 @@ namespace SabreTools.Models.NewExecutable /// following describes the contents of each of these structures: /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ResourceTable { /// diff --git a/NewExecutable/ResourceTypeAndNameString.cs b/NewExecutable/ResourceTypeAndNameString.cs index b7f6089..2c2ce49 100644 --- a/NewExecutable/ResourceTypeAndNameString.cs +++ b/NewExecutable/ResourceTypeAndNameString.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// /// Resource type and name strings are stored at the end of the @@ -8,7 +6,6 @@ namespace SabreTools.Models.NewExecutable /// are case sensitive. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ResourceTypeAndNameString { /// diff --git a/NewExecutable/ResourceTypeInformationEntry.cs b/NewExecutable/ResourceTypeInformationEntry.cs index 6ed1f28..a1fe18a 100644 --- a/NewExecutable/ResourceTypeInformationEntry.cs +++ b/NewExecutable/ResourceTypeInformationEntry.cs @@ -1,13 +1,10 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// /// A table of resource type information blocks follows. The following /// is the format of each type information block: /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ResourceTypeInformationEntry { /// diff --git a/NewExecutable/ResourceTypeResourceEntry.cs b/NewExecutable/ResourceTypeResourceEntry.cs index 53edb22..de25421 100644 --- a/NewExecutable/ResourceTypeResourceEntry.cs +++ b/NewExecutable/ResourceTypeResourceEntry.cs @@ -1,13 +1,10 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// /// A table of resources for this type follows. The following is /// the format of each resource (8 bytes each): /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ResourceTypeResourceEntry { /// diff --git a/NewExecutable/SegmentTableEntry.cs b/NewExecutable/SegmentTableEntry.cs index b85a660..5d947a9 100644 --- a/NewExecutable/SegmentTableEntry.cs +++ b/NewExecutable/SegmentTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.NewExecutable +namespace SabreTools.Models.NewExecutable { /// /// The segment table contains an entry for each segment in the executable @@ -9,7 +7,6 @@ namespace SabreTools.Models.NewExecutable /// The following is the structure of a segment table entry. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class SegmentTableEntry { /// diff --git a/PortableExecutable/AcceleratorTableEntry.cs b/PortableExecutable/AcceleratorTableEntry.cs index f87c77a..23f8571 100644 --- a/PortableExecutable/AcceleratorTableEntry.cs +++ b/PortableExecutable/AcceleratorTableEntry.cs @@ -1,13 +1,10 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Describes the data in an individual accelerator table resource. The structure definition /// provided here is for explanation only; it is not present in any standard header file. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class AcceleratorTableEntry { /// diff --git a/PortableExecutable/COFFFileHeader.cs b/PortableExecutable/COFFFileHeader.cs index 39fa94d..a283763 100644 --- a/PortableExecutable/COFFFileHeader.cs +++ b/PortableExecutable/COFFFileHeader.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// At the beginning of an object file, or immediately after the signature @@ -8,7 +6,6 @@ namespace SabreTools.Models.PortableExecutable /// Note that the Windows loader limits the number of sections to 96. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class COFFFileHeader { /// diff --git a/PortableExecutable/COFFRelocation.cs b/PortableExecutable/COFFRelocation.cs index e8b6765..b7fb2eb 100644 --- a/PortableExecutable/COFFRelocation.cs +++ b/PortableExecutable/COFFRelocation.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Object files contain COFF relocations, which specify how the section data @@ -17,7 +15,6 @@ namespace SabreTools.Models.PortableExecutable /// specified in the section header. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class COFFRelocation { /// diff --git a/PortableExecutable/DataDirectory.cs b/PortableExecutable/DataDirectory.cs index 4886956..4bf4701 100644 --- a/PortableExecutable/DataDirectory.cs +++ b/PortableExecutable/DataDirectory.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Each data directory gives the address and size of a table or string that Windows uses. @@ -11,7 +9,6 @@ namespace SabreTools.Models.PortableExecutable /// that the sections that contain specific tables have specific names. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class DataDirectory { /// diff --git a/PortableExecutable/DebugDirectoryEntry.cs b/PortableExecutable/DebugDirectoryEntry.cs index f6c95ba..e96dced 100644 --- a/PortableExecutable/DebugDirectoryEntry.cs +++ b/PortableExecutable/DebugDirectoryEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Image files contain an optional debug directory that indicates what form @@ -19,7 +17,6 @@ namespace SabreTools.Models.PortableExecutable /// RVA is its address. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class DebugDirectoryEntry { /// diff --git a/PortableExecutable/DelayLoadDirectoryTable.cs b/PortableExecutable/DelayLoadDirectoryTable.cs index 1b8b117..08b295a 100644 --- a/PortableExecutable/DelayLoadDirectoryTable.cs +++ b/PortableExecutable/DelayLoadDirectoryTable.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// The delay-load directory table is the counterpart to the import directory @@ -8,7 +6,6 @@ namespace SabreTools.Models.PortableExecutable /// the optional header data directories list (offset 200). /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class DelayLoadDirectoryTable { /// diff --git a/PortableExecutable/DialogItemTemplate.cs b/PortableExecutable/DialogItemTemplate.cs index 2b20890..a8d4f77 100644 --- a/PortableExecutable/DialogItemTemplate.cs +++ b/PortableExecutable/DialogItemTemplate.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Defines the dimensions and style of a control in a dialog box. One or more of these @@ -8,7 +6,6 @@ namespace SabreTools.Models.PortableExecutable /// for a dialog box. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class DialogItemTemplate { /// diff --git a/PortableExecutable/DialogItemTemplateExtended.cs b/PortableExecutable/DialogItemTemplateExtended.cs index 871d659..3a81175 100644 --- a/PortableExecutable/DialogItemTemplateExtended.cs +++ b/PortableExecutable/DialogItemTemplateExtended.cs @@ -1,13 +1,10 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// A block of text used by an extended dialog box template to describe the extended dialog box. /// For a description of the format of an extended dialog box template, see DLGTEMPLATEEX. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class DialogItemTemplateExtended { /// diff --git a/PortableExecutable/DialogTemplate.cs b/PortableExecutable/DialogTemplate.cs index 05b170e..49865c8 100644 --- a/PortableExecutable/DialogTemplate.cs +++ b/PortableExecutable/DialogTemplate.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Defines the dimensions and style of a dialog box. This structure, always the first @@ -9,7 +7,6 @@ namespace SabreTools.Models.PortableExecutable /// structures in the template. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class DialogTemplate { /// diff --git a/PortableExecutable/DialogTemplateExtended.cs b/PortableExecutable/DialogTemplateExtended.cs index 92e0c64..3e94aed 100644 --- a/PortableExecutable/DialogTemplateExtended.cs +++ b/PortableExecutable/DialogTemplateExtended.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// An extended dialog box template begins with a DLGTEMPLATEEX header that describes @@ -13,7 +11,6 @@ namespace SabreTools.Models.PortableExecutable /// for a dialog box. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class DialogTemplateExtended { /// diff --git a/PortableExecutable/ExportDirectoryTable.cs b/PortableExecutable/ExportDirectoryTable.cs index b3f853e..dbe4f98 100644 --- a/PortableExecutable/ExportDirectoryTable.cs +++ b/PortableExecutable/ExportDirectoryTable.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// The export symbol information begins with the export directory table, @@ -9,7 +7,6 @@ namespace SabreTools.Models.PortableExecutable /// imports to the entry points within this image. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ExportDirectoryTable { /// diff --git a/PortableExecutable/FixedFileInfo.cs b/PortableExecutable/FixedFileInfo.cs index 36b19a3..663cb18 100644 --- a/PortableExecutable/FixedFileInfo.cs +++ b/PortableExecutable/FixedFileInfo.cs @@ -1,13 +1,10 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Contains version information for a file. This information is language and /// code page independent. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class FixedFileInfo { /// diff --git a/PortableExecutable/ImportDirectoryTableEntry.cs b/PortableExecutable/ImportDirectoryTableEntry.cs index bfbd2d0..feedb6e 100644 --- a/PortableExecutable/ImportDirectoryTableEntry.cs +++ b/PortableExecutable/ImportDirectoryTableEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// The import information begins with the import directory table, which @@ -12,7 +10,6 @@ namespace SabreTools.Models.PortableExecutable /// which indicates the end of the directory table. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ImportDirectoryTableEntry { /// diff --git a/PortableExecutable/MenuHeader.cs b/PortableExecutable/MenuHeader.cs index 4d44da2..4a2f1f1 100644 --- a/PortableExecutable/MenuHeader.cs +++ b/PortableExecutable/MenuHeader.cs @@ -1,13 +1,10 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Contains version information for the menu resource. The structure definition provided /// here is for explanation only; it is not present in any standard header file. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class MenuHeader { /// diff --git a/PortableExecutable/MenuHeaderExtended.cs b/PortableExecutable/MenuHeaderExtended.cs index f35eb1a..df3601d 100644 --- a/PortableExecutable/MenuHeaderExtended.cs +++ b/PortableExecutable/MenuHeaderExtended.cs @@ -1,13 +1,10 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Defines the header for an extended menu template. This structure definition is for /// explanation only; it is not present in any standard header file. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class MenuHeaderExtended { /// diff --git a/PortableExecutable/NB10ProgramDatabase.cs b/PortableExecutable/NB10ProgramDatabase.cs index 081b384..0b10a97 100644 --- a/PortableExecutable/NB10ProgramDatabase.cs +++ b/PortableExecutable/NB10ProgramDatabase.cs @@ -1,12 +1,9 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// PDB 2.0 files /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class NB10ProgramDatabase { /// diff --git a/PortableExecutable/NewHeader.cs b/PortableExecutable/NewHeader.cs index 985f6ad..de0d522 100644 --- a/PortableExecutable/NewHeader.cs +++ b/PortableExecutable/NewHeader.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Contains the number of icon or cursor components in a resource group. The @@ -8,7 +6,6 @@ namespace SabreTools.Models.PortableExecutable /// in any standard header file. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class NewHeader { /// diff --git a/PortableExecutable/RSDSProgramDatabase.cs b/PortableExecutable/RSDSProgramDatabase.cs index 1248d10..23113e3 100644 --- a/PortableExecutable/RSDSProgramDatabase.cs +++ b/PortableExecutable/RSDSProgramDatabase.cs @@ -1,5 +1,4 @@ using System; -using System.Runtime.InteropServices; namespace SabreTools.Models.PortableExecutable { @@ -8,7 +7,6 @@ namespace SabreTools.Models.PortableExecutable /// or "DS" type which are emitted by Miscrosoft's link.exe from version 7 and above. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class RSDSProgramDatabase { /// diff --git a/PortableExecutable/ResourceDataEntry.cs b/PortableExecutable/ResourceDataEntry.cs index b17069a..804649e 100644 --- a/PortableExecutable/ResourceDataEntry.cs +++ b/PortableExecutable/ResourceDataEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// The resource directory string area consists of Unicode strings, which @@ -10,7 +8,6 @@ namespace SabreTools.Models.PortableExecutable /// alignment of the fixed-size directory entries. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ResourceDataEntry { /// diff --git a/PortableExecutable/ResourceDirectoryTable.cs b/PortableExecutable/ResourceDirectoryTable.cs index d311eda..eb7425f 100644 --- a/PortableExecutable/ResourceDirectoryTable.cs +++ b/PortableExecutable/ResourceDirectoryTable.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Each directory table is followed by a series of directory entries that @@ -15,7 +13,6 @@ namespace SabreTools.Models.PortableExecutable /// actually consists of directory entries. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class ResourceDirectoryTable { /// diff --git a/PortableExecutable/SectionHeader.cs b/PortableExecutable/SectionHeader.cs index d73f88a..4efb77c 100644 --- a/PortableExecutable/SectionHeader.cs +++ b/PortableExecutable/SectionHeader.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Each row of the section table is, in effect, a section header. This table @@ -20,7 +18,6 @@ namespace SabreTools.Models.PortableExecutable /// SectionAlignment value in the optional header. /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class SectionHeader { /// @@ -32,11 +29,10 @@ namespace SabreTools.Models.PortableExecutable /// characters. Long names in object files are truncated if they are emitted /// to an executable file. /// - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)] #if NET48 - public byte[] Name; + public byte[] Name { get; set; } = new byte[8]; #else - public byte[]? Name; + public byte[]? Name { get; set; } = new byte[8]; #endif /// diff --git a/PortableExecutable/SecuROMAddD.cs b/PortableExecutable/SecuROMAddD.cs index bf67970..b357765 100644 --- a/PortableExecutable/SecuROMAddD.cs +++ b/PortableExecutable/SecuROMAddD.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Overlay data associated with SecuROM executables @@ -10,7 +8,6 @@ namespace SabreTools.Models.PortableExecutable /// environment by using sample from legally obtained software that /// is protected by SecuROM. /// - [StructLayout(LayoutKind.Sequential)] public sealed class SecuROMAddD { /// diff --git a/PortableExecutable/SecuROMAddDEntry.cs b/PortableExecutable/SecuROMAddDEntry.cs index a515b4b..bfc2659 100644 --- a/PortableExecutable/SecuROMAddDEntry.cs +++ b/PortableExecutable/SecuROMAddDEntry.cs @@ -1,6 +1,4 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.PortableExecutable +namespace SabreTools.Models.PortableExecutable { /// /// Overlay data associated with SecuROM executables @@ -10,7 +8,6 @@ namespace SabreTools.Models.PortableExecutable /// environment by using sample from legally obtained software that /// is protected by SecuROM. /// - [StructLayout(LayoutKind.Sequential)] public sealed class SecuROMAddDEntry { /// diff --git a/Quantum/Header.cs b/Quantum/Header.cs index e88355b..dd4849b 100644 --- a/Quantum/Header.cs +++ b/Quantum/Header.cs @@ -1,12 +1,9 @@ -using System.Runtime.InteropServices; - namespace SabreTools.Models.Quantum { /// /// Quantum archive file header /// /// - [StructLayout(LayoutKind.Sequential)] public class Header { /// diff --git a/SFFS/FileEntry.cs b/SFFS/FileEntry.cs index 069f281..62132c0 100644 --- a/SFFS/FileEntry.cs +++ b/SFFS/FileEntry.cs @@ -1,9 +1,6 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.SFFS +namespace SabreTools.Models.SFFS { /// - [StructLayout(LayoutKind.Sequential)] public sealed class FileEntry { /// diff --git a/SFFS/FileHeader.cs b/SFFS/FileHeader.cs index a49c847..cbbadb7 100644 --- a/SFFS/FileHeader.cs +++ b/SFFS/FileHeader.cs @@ -1,9 +1,6 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.SFFS +namespace SabreTools.Models.SFFS { /// - [StructLayout(LayoutKind.Sequential)] public sealed class FileHeader { /// diff --git a/SFFS/Header.cs b/SFFS/Header.cs index 66ada37..1204cd7 100644 --- a/SFFS/Header.cs +++ b/SFFS/Header.cs @@ -1,12 +1,9 @@ -using System.Runtime.InteropServices; - -namespace SabreTools.Models.SFFS +namespace SabreTools.Models.SFFS { /// /// Header /// /// - [StructLayout(LayoutKind.Sequential)] public sealed class Header { ///