Remove LayoutKind.Sequential

This may be replaced in the future when byte-serialzable types are more well-defined
This commit is contained in:
Matt Nadareski
2023-09-10 21:33:22 -04:00
parent 670b8428c2
commit 41a90278d5
71 changed files with 74 additions and 290 deletions

View File

@@ -1,12 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.BFPK
namespace SabreTools.Models.BFPK
{
/// <summary>
/// Header
/// </summary>
/// <see cref="https://forum.xentax.com/viewtopic.php?t=5102"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class Header
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The debug information is defined by the debugger and is not controlled by
@@ -13,7 +11,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DebugInformation
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The entry table contains object and offset information that is used to resolve
@@ -17,7 +15,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class EntryTableBundle
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The Fixup Page Table provides a simple mapping of a logical page number
@@ -17,7 +15,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class FixupPageTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The import module name table defines the module name strings imported through
@@ -17,7 +15,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ImportModuleNameTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The import procedure name table defines the procedure name strings imported
@@ -20,7 +18,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ImportModuleProcedureNameTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The `information block` in the LE header contains the linker version number,
@@ -12,7 +10,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class InformationBlock
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The Module Format Directives Table is an optional table that allows additional
@@ -15,7 +13,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ModuleFormatDirectivesTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The resident and non-resident name tables define the ASCII names and ordinal
@@ -27,7 +25,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class NonResidentNamesTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The Object page table provides information about a logical page in an object.
@@ -15,7 +13,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ObjectPageMapEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The object table contains information that describes each segment in
@@ -14,7 +12,6 @@ namespace SabreTools.Models.LinearExecutable
/// </remarks>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ObjectTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The Per-Page Checksum table provides space for a cryptographic checksum for
@@ -13,7 +11,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class PerPageChecksumTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The resident and non-resident name tables define the ASCII names and ordinal
@@ -27,7 +25,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResidentNamesTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The resource table is an array of resource table entries. Each resource table
@@ -15,7 +13,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.LinearExecutable
namespace SabreTools.Models.LinearExecutable
{
/// <summary>
/// The Verify Record Directive Table is an optional table. It maintains a record
@@ -11,7 +9,6 @@ namespace SabreTools.Models.LinearExecutable
/// </summary>
/// <see href="https://faydoc.tripod.com/formats/exe-LE.htm"/>
/// <see href="http://www.edm2.com/index.php/LX_-_Linear_eXecutable_Module_Format_Description"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class VerifyRecordDirectiveTableEntry
{
/// <summary>

View File

@@ -1,5 +1,3 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MSDOS
{
/// <summary>
@@ -8,7 +6,6 @@ namespace SabreTools.Models.MSDOS
/// </summary>
/// <see href="https://wiki.osdev.org/MZ"/>
/// <see href="http://www.pinvoke.net/default.aspx/Structures.IMAGE_DOS_HEADER"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ExecutableHeader
{
#region Standard Fields
@@ -16,11 +13,10 @@ namespace SabreTools.Models.MSDOS
/// <summary>
/// 0x5A4D (ASCII for 'M' and 'Z')
/// </summary>
[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
/// <summary>
@@ -105,11 +101,10 @@ namespace SabreTools.Models.MSDOS
/// <summary>
/// Reserved words
/// </summary>
[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
/// <summary>
@@ -125,11 +120,10 @@ namespace SabreTools.Models.MSDOS
/// <summary>
/// Reserved words
/// </summary>
[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
/// <summary>

View File

@@ -1,12 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MSDOS
namespace SabreTools.Models.MSDOS
{
/// <summary>
/// Each pointer in the relocation table looks as such
/// </summary>
/// <see href="https://wiki.osdev.org/MZ"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class RelocationEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MicrosoftCabinet
namespace SabreTools.Models.MicrosoftCabinet
{
/// <summary>
/// Each CFDATA structure describes some amount of compressed data, as shown in the following
@@ -9,7 +7,6 @@ namespace SabreTools.Models.MicrosoftCabinet
/// contiguous.
/// </summary>
/// <see href="http://download.microsoft.com/download/5/0/1/501ED102-E53F-4CE0-AA6B-B0F93629DDC6/Exchange/%5BMS-CAB%5D.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class CFDATA
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MicrosoftCabinet
namespace SabreTools.Models.MicrosoftCabinet
{
/// <summary>
/// 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.
/// </summary>
/// <see href="http://download.microsoft.com/download/5/0/1/501ED102-E53F-4CE0-AA6B-B0F93629DDC6/Exchange/%5BMS-CAB%5D.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class CFFILE
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MicrosoftCabinet
namespace SabreTools.Models.MicrosoftCabinet
{
/// <summary>
/// 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.
/// </summary>
/// <see href="http://download.microsoft.com/download/5/0/1/501ED102-E53F-4CE0-AA6B-B0F93629DDC6/Exchange/%5BMS-CAB%5D.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class CFFOLDER
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MicrosoftCabinet
namespace SabreTools.Models.MicrosoftCabinet
{
/// <summary>
/// The CFHEADER structure shown in the following packet diagram provides information about this
/// cabinet (.cab) file.
/// </summary>
/// <see href="http://download.microsoft.com/download/5/0/1/501ED102-E53F-4CE0-AA6B-B0F93629DDC6/Exchange/%5BMS-CAB%5D.pdf"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class CFHEADER
{
/// <summary>

View File

@@ -1,12 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// MoPaQ archive header
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ArchiveHeader
{
#region V1 Properties

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// 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.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class BetTable
{
// TODO: Extract this out and make in common between HET and BET

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// 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.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class BlockEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// 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.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class HashEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// 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.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class HetTable
{
// TODO: Extract this out and make in common between HET and BET

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// Each incremental patch file in a patch MPQ starts with a header. It is supposed
/// to be a structure with variable length.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class PatchHeader
{
#region PATCH Header

View File

@@ -1,12 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// This structure contains size of the patch, flags and also MD5 of the patch.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class PatchInfo
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.MoPaQ
namespace SabreTools.Models.MoPaQ
{
/// <summary>
/// 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.
/// </summary>
/// <see href="http://zezula.net/en/mpq/mpqformat.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class UserData
{
/// <summary>

View File

@@ -1,5 +1,3 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
{
/// <summary>
@@ -8,7 +6,6 @@ namespace SabreTools.Models.NewExecutable
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
/// <see href="https://github.com/libyal/libexe/blob/main/documentation/Executable%20(EXE)%20file%20format.asciidoc#24-ne-extended-header"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ExecutableHeader
{
/// <summary>
@@ -16,7 +13,6 @@ namespace SabreTools.Models.NewExecutable
/// "N" is low-order byte.
/// "E" is high-order byte.
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
#if NET48
public string Magic;
#else

View File

@@ -1,9 +1,6 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ImportNameRelocationRecord
{
/// <summary>

View File

@@ -1,9 +1,6 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ImportOrdinalRelocationRecord
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// The imported-name table follows the module-reference table. This table
@@ -11,7 +9,6 @@ namespace SabreTools.Models.NewExecutable
/// sensitive.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ImportedNameTableEntry
{
/// <summary>

View File

@@ -1,9 +1,6 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class InternalRefRelocationRecord
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ModuleReferenceTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// The nonresident-name table follows the entry table, and contains a
@@ -11,7 +9,6 @@ namespace SabreTools.Models.NewExecutable
/// table.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class NonResidentNameTableEntry
{
/// <summary>

View File

@@ -1,9 +1,6 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class OSFixupRelocationRecord
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// A table of relocation records follows. The following is the format
/// of each relocation record.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class RelocationRecord
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// 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:
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResidentNameTableEntry
{
/// <summary>

View File

@@ -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:
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceTable
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// Resource type and name strings are stored at the end of the
@@ -8,7 +6,6 @@ namespace SabreTools.Models.NewExecutable
/// are case sensitive.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceTypeAndNameString
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// A table of resource type information blocks follows. The following
/// is the format of each type information block:
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceTypeInformationEntry
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// A table of resources for this type follows. The following is
/// the format of each resource (8 bytes each):
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceTypeResourceEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.NewExecutable
namespace SabreTools.Models.NewExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="http://bytepointer.com/resources/win16_ne_exe_format_win3.0.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class SegmentTableEntry
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/menurc/acceltableentry"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class AcceleratorTableEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class COFFFileHeader
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// Object files contain COFF relocations, which specify how the section data
@@ -17,7 +15,6 @@ namespace SabreTools.Models.PortableExecutable
/// specified in the section header.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class COFFRelocation
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DataDirectory
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// Image files contain an optional debug directory that indicates what form
@@ -19,7 +17,6 @@ namespace SabreTools.Models.PortableExecutable
/// RVA is its address.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DebugDirectoryEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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).
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DelayLoadDirectoryTable
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-dlgitemtemplate"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DialogItemTemplate
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/dlgbox/dlgitemtemplateex"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DialogItemTemplateExtended
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-dlgtemplate"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DialogTemplate
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// An extended dialog box template begins with a DLGTEMPLATEEX header that describes
@@ -13,7 +11,6 @@ namespace SabreTools.Models.PortableExecutable
/// for a dialog box.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/dlgbox/dlgtemplateex"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class DialogTemplateExtended
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ExportDirectoryTable
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// Contains version information for a file. This information is language and
/// code page independent.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/api/verrsrc/ns-verrsrc-vs_fixedfileinfo"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class FixedFileInfo
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ImportDirectoryTableEntry
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/menurc/menuheader"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class MenuHeader
{
/// <summary>

View File

@@ -1,13 +1,10 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// Defines the header for an extended menu template. This structure definition is for
/// explanation only; it is not present in any standard header file.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/menurc/menuex-template-header"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class MenuHeaderExtended
{
/// <summary>

View File

@@ -1,12 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// PDB 2.0 files
/// </summary>
/// <see href="https://www.debuginfo.com/articles/debuginfomatch.html"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class NB10ProgramDatabase
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/menurc/newheader"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class NewHeader
{
/// <summary>

View File

@@ -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.
/// </summary>
/// <see href="http://www.godevtool.com/Other/pdb.htm"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class RSDSProgramDatabase
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceDataEntry
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class ResourceDirectoryTable
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/debug/pe-format"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class SectionHeader
{
/// <summary>
@@ -32,11 +29,10 @@ namespace SabreTools.Models.PortableExecutable
/// characters. Long names in object files are truncated if they are emitted
/// to an executable file.
/// </summary>
[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
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </remarks>
[StructLayout(LayoutKind.Sequential)]
public sealed class SecuROMAddD
{
/// <summary>

View File

@@ -1,6 +1,4 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
namespace SabreTools.Models.PortableExecutable
{
/// <summary>
/// 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.
/// </remarks>
[StructLayout(LayoutKind.Sequential)]
public sealed class SecuROMAddDEntry
{
/// <summary>

View File

@@ -1,12 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.Quantum
{
/// <summary>
/// Quantum archive file header
/// </summary>
/// <see href="https://handwiki.org/wiki/Software:Quantum_compression"/>
[StructLayout(LayoutKind.Sequential)]
public class Header
{
/// <summary>

View File

@@ -1,9 +1,6 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.SFFS
namespace SabreTools.Models.SFFS
{
/// <see href="https://forum.xentax.com/viewtopic.php?f=21&t=2084"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class FileEntry
{
/// <summary>

View File

@@ -1,9 +1,6 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.SFFS
namespace SabreTools.Models.SFFS
{
/// <see href="https://forum.xentax.com/viewtopic.php?f=21&t=2084"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class FileHeader
{
/// <summary>

View File

@@ -1,12 +1,9 @@
using System.Runtime.InteropServices;
namespace SabreTools.Models.SFFS
namespace SabreTools.Models.SFFS
{
/// <summary>
/// Header
/// </summary>
/// <see href="https://forum.xentax.com/viewtopic.php?f=21&t=2084"/>
[StructLayout(LayoutKind.Sequential)]
public sealed class Header
{
/// <summary>