mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-22 23:05:12 +00:00
MSDOS model cleanup
This commit is contained in:
@@ -8,4 +8,4 @@ namespace SabreTools.Data.Models.MSDOS
|
||||
|
||||
public const ushort SignatureUInt16 = 0x5a4d;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace SabreTools.Data.Models.MSDOS
|
||||
/// <summary>
|
||||
/// MS-DOS executable header
|
||||
/// </summary>
|
||||
public ExecutableHeader? Header { get; set; }
|
||||
public ExecutableHeader Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// After loading the executable into memory, the program loader goes through
|
||||
@@ -24,6 +24,6 @@ namespace SabreTools.Data.Models.MSDOS
|
||||
/// make the loader add start segment address to the value at offset
|
||||
/// 1*0x10+0x1A=0x2A within the program data.
|
||||
/// </summary>
|
||||
public RelocationEntry[]? RelocationTable { get; set; }
|
||||
public RelocationEntry[] RelocationTable { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace SabreTools.Data.Models.MSDOS
|
||||
/// </summary>
|
||||
/// <remarks>15 bytes</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 2)]
|
||||
public string? Magic;
|
||||
public string Magic;
|
||||
|
||||
/// <summary>
|
||||
/// Number of bytes in the last page.
|
||||
@@ -104,7 +104,7 @@ namespace SabreTools.Data.Models.MSDOS
|
||||
/// </summary>
|
||||
/// <remarks>4 entries/remarks>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public ushort[]? Reserved1;
|
||||
public ushort[] Reserved1 = new ushort[4];
|
||||
|
||||
/// <summary>
|
||||
/// Defined by name but no other information is given; typically zeroes
|
||||
@@ -121,7 +121,7 @@ namespace SabreTools.Data.Models.MSDOS
|
||||
/// </summary>
|
||||
/// <remarks>10 entries/remarks>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
|
||||
public ushort[]? Reserved2;
|
||||
public ushort[] Reserved2 = new ushort[10];
|
||||
|
||||
/// <summary>
|
||||
/// Starting address of the PE header
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace SabreTools.Serialization
|
||||
return null;
|
||||
|
||||
// Check for a valid new executable address
|
||||
if (msdos.Model.Header?.NewExeHeaderAddr == null || initialOffset + msdos.Model.Header.NewExeHeaderAddr >= stream.Length)
|
||||
if (initialOffset + msdos.Model.Header.NewExeHeaderAddr >= stream.Length)
|
||||
return wrapper;
|
||||
|
||||
// Try to read the executable info
|
||||
@@ -833,7 +833,7 @@ namespace SabreTools.Serialization
|
||||
return WrapperType.XZP;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ZSTD
|
||||
|
||||
if (magic.StartsWith([null, 0xB5, 0x2F, 0xFD]))
|
||||
|
||||
@@ -50,11 +50,11 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine();
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, RelocationEntry[]? entries)
|
||||
private static void Print(StringBuilder builder, RelocationEntry[] entries)
|
||||
{
|
||||
builder.AppendLine(" Relocation Table Information:");
|
||||
builder.AppendLine(" -------------------------");
|
||||
if (entries == null || entries.Length == 0)
|
||||
if (entries.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No relocation table items");
|
||||
builder.AppendLine();
|
||||
|
||||
Reference in New Issue
Block a user