Skip to content
/ Amity Public

Utility to create simple patches to existing assemblies

License

Notifications You must be signed in to change notification settings

bramhaag/Amity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Amity

Amity is a utility to create simple patches to exitsing assemblies. Inspired by Harmony

Examples

The assembly

public class MyClass
{
    public void MyMethod() 
    {
        Console.WriteLine("Hello, World!");
    }
}

This assembly is saved in C:\MyAssembly.dll

The patch

public class MyPatch {
    [AmityPatch(typeof(MyClass), "MyMethod", AmityPatch.Mode.Prefix)]
    public static void Patch() 
    {
        Console.WriteLine("Hello from Amity!");
    }
}

Applying the patch

public class Program
{
    public static void Main()
    {
        AmityInstance.Patch(typeof(MyPatch), @"C:\MyAssembly.dll", @"C:\MyNewAssembly.dll");
    }
}

Running this will generate the patched assembly in C:\MyNewAssembly.dll, the MyMethod() method in this assembly now looks like this:

public void MyMethod() 
{
    Console.WriteLine("Hello from Amity!");
    Console.WriteLine("Hello, World!");
}

About

Utility to create simple patches to existing assemblies

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages