//use struct with LayoutKind.Explicit Attribute to simulate the union in C/C++
[StructLayout(LayoutKind.Explicit)]
public struct Misc
{
[FieldOffset(0)]
public System.UInt32 PhysicalAddress;
[FieldOffset(0)]
public System.UInt32 VirtualSize;
}
[StructLayout(LayoutKind.Sequential)]
internal struct IMAGE_SECTION_HEADER
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
public string Name;
public Misc Misc;
public UInt32 VirtualAddress;
public UInt32 SizeOfRawData;
public UInt32 PointerToRelocations;
public UInt32 PointerToLinenumbers;
public UInt16 NumberOfRelocations;
public UInt16 NumberOfLinenumbers;
public UInt32 Characteristics;
}
Structure IMAGE_SECTION_HEADER
Public TODO
End Structure
None.
None.