haha forgot to push,,,
This commit is contained in:
@@ -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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user