base vs future configurable patches, add amplitude redirect and signalr handshake patches, galvanic corrosion support,

This commit is contained in:
2025-03-22 21:20:04 -04:00
parent 400bd791db
commit e9a241d742
15 changed files with 472 additions and 152 deletions

View File

@@ -1,63 +0,0 @@
using HarmonyLib;
using System;
using System.Reflection;
using UnityEngine;
namespace undead_universal_patch_il2cpp.Patches
{
[HarmonyPatch]
public static class HilePatch
{
public static void Patch()
{
Plugin.Log.LogInfo("Attempting hile patch");
HileManager man = GameObject.Find("/GameRoot/Startup/Core Systems/[CheatManager]").GetComponent<HileManager>();
string[] asdf = [
"GameAssembly.dll",
"UnityPlayer.dll",
"WinPixEventRuntime.dll",
"steam_api64.dll",
"steam_api.dll",
"d3d11.dll",
"d3d9.dll",
"d3d8.dll",
"ddraw.dll",
"dxgi.dll",
"winhttp.dll"
];
man.KnownDlls = asdf;
Plugin.Log.LogInfo("Hile patch successful.");
}
static string TargetTypeName = "BootSequence";
static string TargetMethodName = "set_CurrentState";
static string Description = "Add BepInEx to allowed DLLs";
static Type targetType = AccessTools.TypeByName(TargetTypeName);
static MethodInfo targetMethod = AccessTools.Method(targetType, TargetMethodName);
static bool Prepare()
{
if (targetMethod == null)
{
Plugin.Log.LogWarning($"'{Description}' disabled. The type for this patch was not found.");
return false;
}
Plugin.Log.LogInfo($"'{Description}' succeeded validation.");
return true;
}
static MethodBase TargetMethod()
{
return targetMethod;
}
static void Prefix(ref BootSequence __instance)
{
if (GenericConfig.HilePatch.Value && __instance.CurrentState == BootSequence.BootSequenceState.RECNET_CONNECTION) Patch();
}
}
}