2022-11-03 23:38:51 -07:00
|
|
|
|
using System.Runtime.InteropServices;
|
|
|
|
|
|
|
2023-03-07 16:59:14 -05:00
|
|
|
|
namespace BinaryObjectScanner.Models.NewExecutable
|
2022-11-03 23:38:51 -07:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// The segment table contains an entry for each segment in the executable
|
|
|
|
|
|
/// file. The number of segment table entries are defined in the segmented
|
|
|
|
|
|
/// EXE header. The first entry in the segment table is segment number 1.
|
|
|
|
|
|
/// 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)]
|
2022-12-27 17:12:55 -08:00
|
|
|
|
public sealed class SegmentTableEntry
|
2022-11-03 23:38:51 -07:00
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Logical-sector offset (n byte) to the contents of the segment
|
|
|
|
|
|
/// data, relative to the beginning of the file. Zero means no
|
|
|
|
|
|
/// file data.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ushort Offset;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Length of the segment in the file, in bytes. Zero means 64K.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ushort Length;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Flag word.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public SegmentTableEntryFlag FlagWord;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Minimum allocation size of the segment, in bytes. Total size
|
|
|
|
|
|
/// of the segment. Zero means 64K.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public ushort MinimumAllocationSize;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|