Skip to content

MethodDefinitionExtensions Class

Extension methods for MethodDefinition.

C#
public static class MethodDefinitionExtensions

Inheritance object

Manipulate a MethodDefinition in an ILHook-like environment without being in a real ILHook. Useful when runtime detouring is not possible, such as when writing IL modifications in BepInEx preloader patchers.

Using this method while already in an ILHook is pointless.

C#
public static void ILWeave(this MethodDefinition method, ILManipulationInfo.Manipulator manipulator)

method MethodDefinition
The target method to manipulate.

manipulator ILManipulationInfo.Manipulator
An IL manipulator method accepting a ILManipulationInfo.