Class GenericPlatform
- Namespace
- AsmResolver.PE.Platforms
- Assembly
- AsmResolver.PE.dll
Represents the generic fallback target platform.
public sealed class GenericPlatform : Platform
- Inheritance
-
GenericPlatform
- Inherited Members
Remarks
This class implements the bare minimum for any platform that is not supported through a dedicated Platform class. It is therefore also not able to generate native code (such as thunk stubs or IAT initializers), and will throw NotSupportedException when instructed to do so.
Note that for .NET binaries, the generic platform is not the same as AnyCPU. AnyCPU binaries are compiled as if they were i386 binaries and thus use the I386Platform instead.
Properties
Is32Bit
Gets a value indicating whether the platform is a 32-bit platform.
public override bool Is32Bit { get; }
Property Value
IsClrBootstrapperRequired
Gets a value indicating whether PEs with a .NET image embedded requires a CLR bootstrapper.
public override bool IsClrBootstrapperRequired { get; }
Property Value
TargetMachine
Gets the machine type associated to the platform.
public override MachineType TargetMachine { get; }
Property Value
ThunkStubAlignment
Gets the default byte-boundary used in aligning thunk stubs in a PE file.
public override uint ThunkStubAlignment { get; }
Property Value
Methods
CreateAddressTableInitializer(ISymbol)
Creates a new address table initializer stub.
public override 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 override RelocatableSegment CreateThunkStub(ISymbol entryPoint)
Parameters
entryPointISymbolThe symbol to jump to.
Returns
- RelocatableSegment
The created stub.
TryExtractThunkAddress(PEImage, BinaryStreamReader, out uint)
Attempts to extract the original RVA from the code at the provided thunk address reader.
public override 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.