mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-10-20 01:46:13 +00:00
24 lines
579 B
C#
24 lines
579 B
C#
using System.Reflection;
|
|
using BepInEx.Harmony;
|
|
using HarmonyLib;
|
|
|
|
namespace BepInEx.NetLauncher.RuntimeFixes
|
|
{
|
|
internal class AssemblyFix
|
|
{
|
|
private static Assembly EntryAssembly { get; set; }
|
|
|
|
public static void Execute(Assembly entryAssembly)
|
|
{
|
|
EntryAssembly = entryAssembly;
|
|
HarmonyWrapper.PatchAll(typeof(AssemblyFix), "bepinex.assemblyfix");
|
|
}
|
|
|
|
[HarmonyPrefix, HarmonyPatch(typeof(Assembly), nameof(Assembly.GetEntryAssembly))]
|
|
public static bool GetEntryAssemblyPrefix(ref Assembly __result)
|
|
{
|
|
__result = EntryAssembly;
|
|
return false;
|
|
}
|
|
}
|
|
} |