Warning:
HERE BE DRAGONS
The end-user guide ends here.
From now on, only the technical aspects of ReiPatcher are discussed.
ReiPatcher API: Setup
In this and subsequent chapters we will discuss how to use ReiPatcher’s API to create patchers.
This chapter mainly lists the requirements and suggestions on tools to use.
Tools and requirements
The following tools and libraries are required to create patchers:
- Target assemblies (the ones that are to be patched).
- ReiPatcher.
- .NET Framework 3.5 or later.
- Mono.Cecil (included in ReiPatcher).
- Basic knowledge of C# (or other language supporting .NET).
These tools and libraries are optional but will make patching much easier:
- Knowledge of CIL (Common Intermediate Language).
- IDE to program with. Some of the more popular ones are Visual Studio, MonoDevelop and SharpDevelop.
- ReSharper – a productivity tool for Visual Studio. Makes working with C# much faster.
- A .NET decompiler to view target assemblies’ code. Such tools are for instance ILSpy, Cecil Studio, dotPeek and .NET Reflector.
- Additional libraries to make patching easier.
In this tutorial we will use Visual Studio and C# 6.0 to create patchers.
Note: This tutorial only covers the usage of ReiPatcher. Make sure you are familiar with any other additional tools (like IDEs) before proceeding.
List of additional patcher tools
Below is a (not finished) list of pre-made libraries and templates to make patching easier.
Name | Links | Description |
---|---|---|
PatcherHelper.cs | GitHub | A compilation of common patching methods for Mono.Cecil. Created by neguse11 and is used in majority of his mods for CM3D2. |
Cecil.Inject | GitHub, Documentation | A separate library to extend the functionality of Mono.Cecil and provide patching capabilities. Used mainly as a separate DLL. Can be thought of as PatcherHelper.cs, but with more methods and proper documentation. |
Mono.Cecil.* Extensions | Found within Mono.Cecil | Additional minor helpers to work with IL within Mono.Cecil. For instance, Mono.Cecil.Rocks provides some methods to optimize IL code and so forth. |