C# Class Mono.Cecil.Inject.ILUtils

Miscellaneous utilities used by the injector.
Mostra file Open project: denikson/Mono.Cecil.Inject Class Usage Examples

Public Methods

Method Description
CopyInstruction ( Instruction ins ) : Instruction

Creates a new IL instruction that is a copy of the provided one. Does not link the new instruction to a method.

ReplaceInstruction ( Instruction original, Instruction newIns ) : void

Replaces the insturction with another by replacing the opcode and the operand. Unlike ILProcessor.Replace, preserves the references to the original instruction (which branches might use, for instance).

Method Details

CopyInstruction() public static method

Creates a new IL instruction that is a copy of the provided one. Does not link the new instruction to a method.
public static CopyInstruction ( Instruction ins ) : Instruction
ins Mono.Cecil.Cil.Instruction Instruction to copy.
return Mono.Cecil.Cil.Instruction

ReplaceInstruction() public static method

Replaces the insturction with another by replacing the opcode and the operand. Unlike ILProcessor.Replace, preserves the references to the original instruction (which branches might use, for instance).
public static ReplaceInstruction ( Instruction original, Instruction newIns ) : void
original Mono.Cecil.Cil.Instruction The instruction to replace.
newIns Mono.Cecil.Cil.Instruction The instruction to replace with.
return void