public static void Main(string[] args) { var assemblyPath = args[0]; var assemblyDefinition = AssemblyDefinition.ReadAssembly(assemblyPath); FieldOf.CecilFixup(assemblyDefinition); MethodOf.CecilFixup(assemblyDefinition); assemblyDefinition.Write(assemblyPath + "_patched"); }
public static void CheckMethodAttributes <T>(T func) { MethodInfo method = new MethodOf <T>(func); // Example attribute check: var ignoreAttribute = method.GetAttribute <IgnoreAttribute>(); if (ignoreAttribute != null) { // Do something here... } }
protected internal Expression VisitMethodOf(MethodOf methodOf) { return(methodOf.Update(methodOf.Member, methodOf.Type)); }