我一开始猜想这可能类似于 CE(Cheat Engine) 那样,从内存的层面上去修改一些东西(感觉很复杂,没有研究过)。直到我偷偷地把它拖进了 dnSpy(一个反编译软件),短暂地分析代码后,得出的结果让我大吃一惊——居然使用了 Lib.Harmony(我接触过 Lib.Harmony 但是我只知道它是用来制作 Unity 游戏的 Mod 的),然后我才意识到 Lib.Harmony 功能强大,不仅仅是做 Unity 游戏 Mod 的工具。
Harmony 2 Introduction
Harmony gives you an elegant(优雅的) and high level way to alter functionality(实用地更改) in applications written in C#. It does this at runtime by monkey patching methods unlike other solutions that change the content of dll files.
It supports Mono and .NET environments on W