Table of Contents

Class Platform

Namespace
AsmResolver.PE.Platforms
Assembly
AsmResolver.PE.dll

Provides information and services for a particular target platform.

public abstract class Platform
Inheritance
Platform
Derived
Inherited Members

Properties

Is32Bit

Gets a value indicating whether the platform is a 32-bit platform.

public abstract bool Is32Bit { get; }

Property Value

bool

Is64Bit

Gets a value indicating whether the platform is a 64-bit platform.

public bool Is64Bit { get; }

Property Value

bool

IsClrBootstrapperRequired

Gets a value indicating whether PEs with a .NET image embedded requires a CLR bootstrapper.

public abstract bool IsClrBootstrapperRequired { get; }

Property Value

bool

PointerSize

Gets a value indicating the size of a single pointer.

public int PointerSize { get; }

Property Value

int

TargetMachine

Gets the machine type associated to the platform.

public abstract MachineType TargetMachine { get; }

Property Value

MachineType

Methods

CreateAddressTableInitializer(ISymbol)

Creates a new address table initializer stub.

public abstract AddressTableInitializerStub CreateAddressTableInitializer(ISymbol virtualProtect)

Parameters

virtualProtect ISymbol

The symbol to kernel32.dll!VirtualProtect to use for temporarily adjusting the memory protection bits while initializing the address table.

Returns

AddressTableInitializerStub

The initializer stub.

CreateThunkStub(ISymbol)

Creates a new thunk stub that transfers control to the provided symbol.

public abstract RelocatableSegment CreateThunkStub(ISymbol entryPoint)

Parameters

entryPoint ISymbol

The symbol to jump to.

Returns

RelocatableSegment

The created stub.

Get(MachineType)

Gets a target platform by its machine type.

public static Platform Get(MachineType machineType)

Parameters

machineType MachineType

The machine type.

Returns

Platform

The target platform.

Exceptions

NotSupportedException

Occurs when the platform is not supported.

TryExtractThunkAddress(PEImage, BinaryStreamReader, out uint)

Attempts to extract the original RVA from the code at the provided thunk address reader.

public abstract bool TryExtractThunkAddress(PEImage image, BinaryStreamReader reader, out uint rva)

Parameters

image PEImage

The image containing the thunk.

reader BinaryStreamReader

The thunk reader.

rva uint

The extracted RVA.

Returns

bool

true if the RVA was extracted successfully from the code, false otherwise.

TryGet(MachineType, out Platform?)

Gets a target platform by its machine type.

public static bool TryGet(MachineType machineType, out Platform? platform)

Parameters

machineType MachineType

The machine type.

platform Platform

The target platform.

Returns

bool

true if the platform was found, false otherwise.