Table of Contents

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 ISegment

The code segment that is being constructed.

provider INativeSymbolsProvider

The object responsible for providing symbols referenced by the native method body.

fixup AddressFixup

The 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 ISegment

The code segment that is being constructed.

provider INativeSymbolsProvider

The object responsible for providing symbols referenced by the native method body.

symbol ISymbol

The 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 MethodBodySerializationContext

The context in which the serializer is situated in.

method MethodDefinition

The method to serialize the method body for.

Returns

ISegmentReference

A reference to a segment that encodes the method body.