mirror of
https://github.com/SabreTools/SabreTools.Models.git
synced 2026-09-24 23:57:18 +00:00
Migrate many models to StructLayout
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
namespace SabreTools.Models.PortableExecutable
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Models.PortableExecutable
|
||||
{
|
||||
/// <summary>
|
||||
/// Object files contain COFF relocations, which specify how the section data
|
||||
@@ -15,6 +17,7 @@
|
||||
/// 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>
|
||||
@@ -24,7 +27,7 @@
|
||||
/// For example, if the first byte of the section has an address of 0x10,
|
||||
/// the third byte has an address of 0x12.
|
||||
/// </summary>
|
||||
public uint VirtualAddress { get; set; }
|
||||
public uint VirtualAddress;
|
||||
|
||||
/// <summary>
|
||||
/// A zero-based index into the symbol table. This symbol gives the address
|
||||
@@ -32,12 +35,13 @@
|
||||
/// storage class, then the symbol's address is the address with the first
|
||||
/// section of the same name.
|
||||
/// </summary>
|
||||
public uint SymbolTableIndex { get; set; }
|
||||
public uint SymbolTableIndex;
|
||||
|
||||
/// <summary>
|
||||
/// A value that indicates the kind of relocation that should be performed.
|
||||
/// Valid relocation types depend on machine type.
|
||||
/// </summary>
|
||||
public RelocationType TypeIndicator { get; set; }
|
||||
[MarshalAs(UnmanagedType.U2)]
|
||||
public RelocationType TypeIndicator;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user