backend refactor yay!!! 1.4.0

This commit is contained in:
2025-08-09 04:46:40 -04:00
parent 8d1bac8201
commit 808da23afa
21 changed files with 616 additions and 77 deletions

43
Patches/ImageSignature.cs Normal file
View File

@@ -0,0 +1,43 @@
using System;
using HarmonyLib;
using System.Reflection;
using undead_universal_patch_il2cpp.Core;
namespace undead_universal_patch_il2cpp.Patches
{
[HarmonyPatch]
public class ImageSignaturePatch
{
public static string TargetTypeName = "Images";
public static string TargetMethodName = "VerifySignature";
public static string Description = "Image signature patch";
public static Type targetType = AccessTools.TypeByName(TargetTypeName);
public static bool Prepare()
{
if (!GenericConfig.ImageSignaturePatch.Value) return false;
if (targetType == null)
{
Plugin.Log.LogWarning($"'{Description}' disabled. The type for this patch was not found.");
return false;
}
if (targetType.GetMethod(TargetMethodName) == null)
{
Plugin.Log.LogWarning($"'{Description}' disabled. The method for this patch was not found.");
return false;
}
Plugin.Log.LogInfo($"'{Description}' succeeded validation.");
return true;
}
public static MethodBase TargetMethod() => targetType.GetMethod(TargetMethodName);
public static bool Prefix(ref bool __result)
{
if (GenericConfig.PatchDebug.Value) Plugin.Log.LogDebug("Verified image signature");
__result = true;
return false;
}
}
}