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
Is64Bit
Gets a value indicating whether the platform is a 64-bit platform.
public bool Is64Bit { get; }
Property Value
IsClrBootstrapperRequired
Gets a value indicating whether PEs with a .NET image embedded requires a CLR bootstrapper.
public abstract bool IsClrBootstrapperRequired { get; }
Property Value
PointerSize
Gets a value indicating the size of a single pointer.
public int PointerSize { get; }
Property Value
TargetMachine
Gets the machine type associated to the platform.
public abstract MachineType TargetMachine { get; }
Property Value
ThunkStubAlignment
Gets the default byte-boundary used in aligning thunk stubs in a PE file.
public abstract uint ThunkStubAlignment { get; }
Property Value
Methods
CreateAddressTableInitializer(ISymbol)
Creates a new address table initializer stub.
public abstract AddressTableInitializerStub CreateAddressTableInitializer(ISymbol virtualProtect)
Parameters
virtualProtectISymbolThe symbol to
kernel32.dll!VirtualProtectto 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
entryPointISymbolThe 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
machineTypeMachineTypeThe machine type.
Returns
- Platform
The target platform.
Exceptions
- NotSupportedException
Occurs when the platform is not supported.
GetOrGeneric(MachineType)
Gets a target platform by its machine type, and falls back to GenericPlatform if the provided architecture is not officially supported.
public static Platform GetOrGeneric(MachineType machineType)
Parameters
machineTypeMachineTypeThe machine type.
Returns
- Platform
The target platform.
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
imagePEImageThe image containing the thunk.
readerBinaryStreamReaderThe thunk reader.
rvauintThe extracted RVA.
Returns
- bool
trueif the RVA was extracted successfully from the code,falseotherwise.
TryGet(MachineType, out Platform?)
Gets a target platform by its machine type.
public static bool TryGet(MachineType machineType, out Platform? platform)
Parameters
machineTypeMachineTypeThe machine type.
platformPlatformThe target platform.
Returns
- bool
trueif the platform was found,falseotherwise.