Table of Contents

Class CilInstructionCollectionExtensions

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

Provides extensions to collections of CilInstruction.

public static class CilInstructionCollectionExtensions
Inheritance
CilInstructionCollectionExtensions
Inherited Members

Methods

GetByOffset(IList<CilInstruction>, int)

Searches for an instruction with the given offset.

public static CilInstruction? GetByOffset(this IList<CilInstruction> self, int offset)

Parameters

self IList<CilInstruction>

The list of instructions.

offset int

The offset of the instruction to find.

Returns

CilInstruction

The instruction with the provided offset, or null if none could be found.

Remarks

Requires the offsets of the instructions pre-calculated.

GetIndexByOffset(IList<CilInstruction>, int)

Searches for an instruction with the given offset.

public static int GetIndexByOffset(this IList<CilInstruction> self, int offset)

Parameters

self IList<CilInstruction>

The list of instructions.

offset int

The offset of the instruction to find.

Returns

int

The index the instruction is located at, or -1 if an instruction with the provided offset could not be found.

Remarks

Requires the offsets of the instructions pre-calculated.