Show / Hide Table of Contents

Class ImageSectionHeader

Represents the section header for one section.

Inheritance
System.Object
AbstractStructure
ImageSectionHeader
Namespace: PeNet.Header.Pe
Assembly: PeNet.dll
Syntax
public class ImageSectionHeader : AbstractStructure

Constructors

| Improve this Doc View Source

ImageSectionHeader(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 Source

Characteristics

Section characteristics.

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

CharacteristicsResolved

The section characteristics flags resolved to readable strings.

Declaration
public List<string> CharacteristicsResolved { get; }
Property Value
Type Description
List<System.String>
| Improve this Doc View Source

ImageBaseAddress

Base address of the image from the Optional header.

Declaration
public ulong ImageBaseAddress { get; }
Property Value
Type Description
System.UInt64
| Improve this Doc View Source

Name

The section name as a string.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String
| Improve this Doc View Source

NumberOfLinenumbers

The number of line-number entries for the section.

Declaration
public ushort NumberOfLinenumbers { get; set; }
Property Value
Type Description
System.UInt16
| Improve this Doc 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
System.UInt16
| Improve this Doc 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
System.UInt32
| Improve this Doc View Source

PointerToRawData

Raw address of the section in the file.

Declaration
public uint PointerToRawData { get; set; }
Property Value
Type Description
System.UInt32
| Improve this Doc 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
System.UInt32
| Improve this Doc 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
System.UInt32
| Improve this Doc View Source

VirtualAddress

RVA of the section start in memory.

Declaration
public uint VirtualAddress { get; set; }
Property Value
Type Description
System.UInt32
| Improve this Doc 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
System.UInt32

Methods

| Improve this Doc 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<System.String>

List with flag names for the section.

| Improve this Doc 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
System.Byte[]

Section header as a byte array.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX