Class NativeMethodBodySerializer
- Namespace
- AsmResolver.DotNet.Code.Native
- Assembly
- AsmResolver.DotNet.dll
Provides an implementation for the IMethodBodySerializer that serializes method bodies written in a native and unmanaged language.
public class NativeMethodBodySerializer : IMethodBodySerializer
- Inheritance
-
NativeMethodBodySerializer
- Implements
- Inherited Members
Methods
AddBaseRelocations(ISegment, INativeSymbolsProvider, AddressFixup)
Registers base relocations for the provided address fixup, if required.
protected virtual void AddBaseRelocations(ISegment segment, INativeSymbolsProvider provider, AddressFixup fixup)
Parameters
segment
ISegmentThe code segment that is being constructed.
provider
INativeSymbolsProviderThe object responsible for providing symbols referenced by the native method body.
fixup
AddressFixupThe fixup to build base relocations for.
FinalizeSymbol(ISegment, INativeSymbolsProvider, ISymbol)
Ensures the right symbol is used within the method body.
protected virtual ISymbol FinalizeSymbol(ISegment result, INativeSymbolsProvider provider, ISymbol symbol)
Parameters
result
ISegmentThe code segment that is being constructed.
provider
INativeSymbolsProviderThe object responsible for providing symbols referenced by the native method body.
symbol
ISymbolThe symbol to reference.
Returns
- ISymbol
The symbol.
SerializeMethodBody(MethodBodySerializationContext, MethodDefinition)
Serializes the body of the provided method definition into a segment that can be added to a PE image.
public ISegmentReference SerializeMethodBody(MethodBodySerializationContext context, MethodDefinition method)
Parameters
context
MethodBodySerializationContextThe context in which the serializer is situated in.
method
MethodDefinitionThe method to serialize the method body for.
Returns
- ISegmentReference
A reference to a segment that encodes the method body.