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
BinaryStreamWriterThe output stream to write the encoded instructions to.
operandBuilder
ICilOperandBuilderThe 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
BinaryStreamWriterThe output stream to write the encoded instructions to.
operandBuilder
ICilOperandBuilderThe 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
IErrorListenerThe 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
BinaryStreamWriterThe output stream to write the encoded instructions to.
operandBuilder
ICilOperandBuilderThe object to use for creating raw operands.
methodBodyName
stringThe name of the method that is being serialized.
errorListener
IErrorListenerThe object used for recording error listener.
Methods
WriteInstruction(CilInstruction)
Writes a single instruction to the output stream.
public void WriteInstruction(CilInstruction instruction)
Parameters
instruction
CilInstructionThe 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.