Show / Hide Table of Contents

Class ImageSectionHeader

Represents the section header for one section.

Inheritance
object
AbstractStructure
ImageSectionHeader
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: PeNet.Header.Pe
Assembly: PeNet.dll
Syntax
public class ImageSectionHeader : AbstractStructure

Constructors

| Edit this page View Source

ImageSectionHeader(IRawFile, long, ulong)

Create a new ImageSectionHeader object.

Declaration
public ImageSectionHeader(IRawFile peFile, long offset, ulong imageBaseAddress)
Parameters
Type Name Description
IRawFile peFile

A PE file.

long offset

Raw offset to the section header.

ulong imageBaseAddress

Base address of the image from the Optional header.

Properties

| Edit this page View Source

Characteristics

Section characteristics.

Declaration
public ScnCharacteristicsType Characteristics { get; set; }
Property Value
Type Description
ScnCharacteristicsType
| Edit this page View Source

CharacteristicsResolved

The section characteristics flags resolved to readable strings.

Declaration
public List<string> CharacteristicsResolved { get; }
Property Value
Type Description
List<string>
| Edit this page View Source

ImageBaseAddress

Base address of the image from the Optional header.

Declaration
public ulong ImageBaseAddress { get; }
Property Value
Type Description
ulong
| Edit this page View Source

Name

The section name as a string.

Declaration
public string Name { get; set; }
Property Value
Type Description
string
| Edit this page View Source

NumberOfLinenumbers

The number of line-number entries for the section.

Declaration
public ushort NumberOfLinenumbers { get; set; }
Property Value
Type Description
ushort
| Edit this page View Source

NumberOfRelocations

The number of relocations for the section. Is zero for executable images.

Declaration
public ushort NumberOfRelocations { get; set; }
Property Value
Type Description
ushort
| Edit this page View Source

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
uint
| Edit this page View Source

PointerToRawData

Raw address of the section in the file.

Declaration
public uint PointerToRawData { get; set; }
Property Value
Type Description
uint
| Edit this page View Source

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
uint
| Edit this page View Source

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
uint
| Edit this page View Source

VirtualAddress

RVA of the section start in memory.

Declaration
public uint VirtualAddress { get; set; }
Property Value
Type Description
uint
| Edit this page View Source

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
uint

Methods

| Edit this page View Source

ResolveCharacteristics(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<string>

List with flag names for the section.

| Edit this page View Source

ToArray()

Convert the section header to a byte array with the correct layout for a PE file.

Declaration
public byte[] ToArray()
Returns
Type Description
byte[]

Section header as a byte array.

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX