Skip to content

orf53975/AssemblyPatcher

 
 

Repository files navigation

####AssemblyPatcher

PatcherBase, SelectorBase

  • Allows creation of custom patchers. (MethodPatcher, PropertyPatcher, FieldPatcher)
  • Use PatcherBase as a starting point.
  • Create a marker interface to make AddPatch type-safe.
  • Create a Selector using SelectorBaseto allow custom member selection.

IPatch, PatchBase

  • Allows creation of custom patches for the Patchers. (LogMethodNamePatch, LogMethodParametersPatch).
  • Use PatchBase as a starting point.

Custom IPatch Example

  1. Declaration
public interface IMethodPatch : IPatch { }
public class LogMethodNamePatch : PatchBase, IMethodPatch { }
public class LogMethodParametersPatch : PatchBase, IMethodPatch { }
  1. Usage
var methodPatcher = new MethodPatcher(typeof(Calculator).Module);
methodPatcher.AddPatch(new LogMethodNamePatch());
methodPatcher.AddPatch(new LogMethodParametersPatch());
methodPatcher.AppliesTo(typeof(Calculator)).AppliesTo("Add", "Sub");
methodPatcher.ApplyPatches();

About

WIP - Assembly Patcher using dnlib

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%