Class ImageSectionHeader
Represents the section header for one section.
Namespace: PeNet.Header.Pe
Assembly: PeNet.dll
Syntax
public class ImageSectionHeader : AbstractStructure
Constructors
| Improve this Doc View SourceImageSectionHeader(IRawFile, Int64, UInt64)
Create a new ImageSectionHeader object.
Declaration
public ImageSectionHeader(IRawFile peFile, long offset, ulong imageBaseAddress)
Parameters
Type | Name | Description |
---|---|---|
IRawFile | peFile | A PE file. |
System.Int64 | offset | Raw offset to the section header. |
System.UInt64 | imageBaseAddress | Base address of the image from the Optional header. |
Properties
| Improve this Doc View SourceCharacteristics
Section characteristics.
Declaration
public ScnCharacteristicsType Characteristics { get; set; }
Property Value
Type | Description |
---|---|
ScnCharacteristicsType |
CharacteristicsResolved
The section characteristics flags resolved to readable strings.
Declaration
public List<string> CharacteristicsResolved { get; }
Property Value
Type | Description |
---|---|
List<System.String> |
ImageBaseAddress
Base address of the image from the Optional header.
Declaration
public ulong ImageBaseAddress { get; }
Property Value
Type | Description |
---|---|
System.UInt64 |
Name
The section name as a string.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
System.String |
NumberOfLinenumbers
The number of line-number entries for the section.
Declaration
public ushort NumberOfLinenumbers { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
NumberOfRelocations
The number of relocations for the section. Is zero for executable images.
Declaration
public ushort NumberOfRelocations { get; set; }
Property Value
Type | Description |
---|---|
System.UInt16 |
PointerToLinenumbers
Pointer to the beginning of the line-numbers in the file. Zero if there are no line-numbers in the file.
Declaration
public uint PointerToLinenumbers { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
PointerToRawData
Raw address of the section in the file.
Declaration
public uint PointerToRawData { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
PointerToRelocations
Pointer to the beginning of the relocation. If there are none, the value is zero.
Declaration
public uint PointerToRelocations { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
SizeOfRawData
Size of the section in raw on disk. Must be a multiple of the file alignment specified in the optional header. If its less than the virtual size, the rest is filled with zeros.
Declaration
public uint SizeOfRawData { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
VirtualAddress
RVA of the section start in memory.
Declaration
public uint VirtualAddress { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
VirtualSize
Size of the section when loaded into memory. If it's bigger than the raw data size, the rest of the section is filled with zeros.
Declaration
public uint VirtualSize { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Methods
| Improve this Doc View SourceResolveCharacteristics(ScnCharacteristicsType)
Resolves the section flags to human readable strings.
Declaration
public static List<string> ResolveCharacteristics(ScnCharacteristicsType sectionFlags)
Parameters
Type | Name | Description |
---|---|---|
ScnCharacteristicsType | sectionFlags | Sections flags from the SectionHeader object. |
Returns
Type | Description |
---|---|
List<System.String> | List with flag names for the section. |
ToArray()
Convert the section header to a byte array with the correct layout for a PE file.
Declaration
public byte[] ToArray()
Returns
Type | Description |
---|---|
System.Byte[] | Section header as a byte array. |