Loading

Harmony运行时破解ServiceStack

破解步骤
新建一个类

[HarmonyPatch(typeof(LicenseUtils))]
[HarmonyPatch(nameof(LicenseUtils.ApprovedUsage))]
class ServiceStackPatch
{
    static bool Prefix()
    {
        return false;
    }
}

在使用ServiceStatck的某个类中添加静态构造方法
静态构造方法只会在使用该类之前调用一次,这样就能保证我们的补丁初始化只在使用ServiceStatck 前执行一次

static SomeClass()
{
    var harmony = new Harmony(nameof(Harmony));
    harmony.PatchAll();
}

原文链接:https://www.cnblogs.com/KSPT/p/16688355.html

posted @ 2022-09-13 10:28  知科行技  阅读(38)  评论(0编辑  收藏  举报