haha forgot to push,,,

This commit is contained in:
2025-09-11 19:54:25 -04:00
parent d45fc2c953
commit 9318ac75d6
25 changed files with 296 additions and 86 deletions

View File

@@ -1,4 +1,6 @@
using System.Reflection;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;
using HarmonyLib;
using undead_universal_patch_il2cpp.Core;
using undead_universal_patch_il2cpp.Core.Config;
@@ -22,19 +24,16 @@ namespace undead_universal_patch_il2cpp.Patches
static void Prefix()
{
if (PatchConfig.HilePatch.Value) HilePatch.Patch();
if (!ServerPatchesConfig.CustomKnownDlls.Value && PatchConfig.HilePatch.Value) HilePatch.Patch();
}
}
public static class HilePatch
{
public static void Patch()
public static void Patch([Optional] string[] dlls)
{
GameObject cheatManagerObject = GameObject.Find("[CheatManager]");
HileManager hileManager = cheatManagerObject.GetComponent<HileManager>();
PropertyInfo knownDllsProperty = AccessTools.Property(typeof(HileManager), "KnownDlls");
knownDllsProperty.SetValue(hileManager, new Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppStringArray([
Util.ConditionalDebug($"Patching KnownDlls with {(dlls != null ? dlls.Length : 0)} new filenames");
string[] baseDlls = [
"GameAssembly.dll",
"UnityPlayer.dll",
"WinPixEventRuntime.dll",
@@ -46,9 +45,16 @@ namespace undead_universal_patch_il2cpp.Patches
"ddraw.dll",
"dxgi.dll",
"winhttp.dll"
]));
];
if (dlls != null) baseDlls = baseDlls.Concat(dlls).ToArray();
UniversalPatchPlugin.Log.LogInfo("Hile patch succeeded.");
GameObject cheatManagerObject = GameObject.Find("[CheatManager]");
HileManager hileManager = cheatManagerObject.GetComponent<HileManager>();
PropertyInfo knownDllsProperty = AccessTools.Property(typeof(HileManager), "KnownDlls");
knownDllsProperty.SetValue(hileManager, new Il2CppInterop.Runtime.InteropTypes.Arrays.Il2CppStringArray(baseDlls));
UniversalPatchPlugin.Log.LogInfo($"Hile patch succeeded: {baseDlls.Length} new KnownDlls.");
}
}
}