Table of Contents

Class CilAssembler

Namespace
AsmResolver.PE.DotNet.Cil
Assembly
AsmResolver.PE.dll

Provides a mechanism for encoding CIL instructions to an output stream.

public class CilAssembler
Inheritance
CilAssembler
Inherited Members

Constructors

CilAssembler(BinaryStreamWriter, ICilOperandBuilder)

Creates a new CIL instruction encoder.

public CilAssembler(BinaryStreamWriter writer, ICilOperandBuilder operandBuilder)

Parameters

writer BinaryStreamWriter

The output stream to write the encoded instructions to.

operandBuilder ICilOperandBuilder

The object to use for creating raw operands.

CilAssembler(BinaryStreamWriter, ICilOperandBuilder, Func<string?>?, IErrorListener)

Creates a new CIL instruction encoder.

public CilAssembler(BinaryStreamWriter writer, ICilOperandBuilder operandBuilder, Func<string?>? getMethodBodyName, IErrorListener errorListener)

Parameters

writer BinaryStreamWriter

The output stream to write the encoded instructions to.

operandBuilder ICilOperandBuilder

The object to use for creating raw operands.

getMethodBodyName Func<string>

A delegate that is used for lazily obtaining the name of the method body.

errorListener IErrorListener

The object used for recording error listener.

CilAssembler(BinaryStreamWriter, ICilOperandBuilder, string?, IErrorListener)

Creates a new CIL instruction encoder.

public CilAssembler(BinaryStreamWriter writer, ICilOperandBuilder operandBuilder, string? methodBodyName, IErrorListener errorListener)

Parameters

writer BinaryStreamWriter

The output stream to write the encoded instructions to.

operandBuilder ICilOperandBuilder

The object to use for creating raw operands.

methodBodyName string

The name of the method that is being serialized.

errorListener IErrorListener

The object used for recording error listener.

Methods

WriteInstruction(CilInstruction)

Writes a single instruction to the output stream.

public void WriteInstruction(CilInstruction instruction)

Parameters

instruction CilInstruction

The instruction to write.

WriteInstructions(IList<CilInstruction>)

Writes a collection of CIL instructions to the output stream.

public void WriteInstructions(IList<CilInstruction> instructions)

Parameters

instructions IList<CilInstruction>

The instructions to write.