diff --git a/IPA.Injector/IPA.Injector.csproj b/IPA.Injector/IPA.Injector.csproj index 61a0e5e1..c088d9f0 100644 --- a/IPA.Injector/IPA.Injector.csproj +++ b/IPA.Injector/IPA.Injector.csproj @@ -90,6 +90,9 @@ + + 0.10.3 + 1.2.0 diff --git a/IPA.Injector/Injector.cs b/IPA.Injector/Injector.cs index aac921e5..d883e16e 100644 --- a/IPA.Injector/Injector.cs +++ b/IPA.Injector/Injector.cs @@ -177,23 +177,49 @@ namespace IPA.Injector bkp?.Add(unityPath); unityAsmDef.Write(unityPath); } + else + return; // shortcut } #endregion Insert patch into UnityEngine.CoreModule.dll loader.Debug("Ensuring Assembly-CSharp is virtualized"); - - #region Virtualize Assembly-CSharp.dll - + { var ascPath = Path.Combine(Environment.CurrentDirectory, "Beat Saber_Data", "Managed", "Assembly-CSharp.dll"); - var ascModule = VirtualizedModule.Load(ascPath); - ascModule.Virtualize(cAsmName, () => bkp?.Add(ascPath)); - } + #region Virtualize Assembly-CSharp.dll + + { + var ascModule = VirtualizedModule.Load(ascPath); + ascModule.Virtualize(cAsmName, () => bkp?.Add(ascPath)); + } + + #endregion Virtualize Assembly-CSharp.dll + + #region Anti-Yeet - #endregion Virtualize Assembly-CSharp.dll + if (SelfConfig.SelfConfigRef.Value.ApplyAntiYeet) + { + loader.Debug("Applying anti-yeet patch"); + + var ascAsmDef = AssemblyDefinition.ReadAssembly(ascPath, new ReaderParameters + { + ReadWrite = false, + InMemory = true, + ReadingMode = ReadingMode.Immediate + }); + var ascModDef = ascAsmDef.MainModule; + + var deleter = ascModDef.GetType("IPAPluginsDirDeleter"); + deleter.Methods.Clear(); // delete all methods + + ascAsmDef.Write(ascPath); + } + + #endregion + } } private static bool bootstrapped; diff --git a/IPA.Loader/Config/SelfConfig.cs b/IPA.Loader/Config/SelfConfig.cs index 8125b033..d4de19ff 100644 --- a/IPA.Loader/Config/SelfConfig.cs +++ b/IPA.Loader/Config/SelfConfig.cs @@ -33,10 +33,12 @@ namespace IPA.Config } internal const string IPAName = "Beat Saber IPA"; - internal const string IPAVersion = "3.12.6"; + internal const string IPAVersion = "3.12.7"; public bool Regenerate = true; + public bool ApplyAntiYeet = false; + public class DebugObject { public bool ShowCallSource = false; diff --git a/IPA.Loader/Loader/manifest.json b/IPA.Loader/Loader/manifest.json index edb6f8f5..eb429f0e 100644 --- a/IPA.Loader/Loader/manifest.json +++ b/IPA.Loader/Loader/manifest.json @@ -5,7 +5,7 @@ "gameVersion": "0.13.2", "id": "beatsaber-ipa-reloaded", "name": "BSIPA", - "version": "3.12.6", + "version": "3.12.7", "features": [ "define-feature(print, IPA.Loader.Features.PrintFeature)", "define-feature(debug, IPA.Loader.Features.DebugFeature)", diff --git a/IPA/Properties/AssemblyInfo.cs b/IPA/Properties/AssemblyInfo.cs index 774ca626..80628159 100644 --- a/IPA/Properties/AssemblyInfo.cs +++ b/IPA/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.12.6")] -[assembly: AssemblyFileVersion("3.12.6")] \ No newline at end of file +[assembly: AssemblyVersion("3.12.7")] +[assembly: AssemblyFileVersion("3.12.7")] \ No newline at end of file diff --git a/Refs/UnityEngine.CoreModule.dll b/Refs/UnityEngine.CoreModule.dll index 2bd6bca0..f6478af7 100644 Binary files a/Refs/UnityEngine.CoreModule.dll and b/Refs/UnityEngine.CoreModule.dll differ