Decompiled source of LogMute v1.0.0

LogMute.dll

Decompiled 5 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using IL.RoR2;
using IL.RoR2.UI;
using Microsoft.CodeAnalysis;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour;
using RoR2;
using UnityEngine;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LogMute")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("LogMute")]
[assembly: AssemblyTitle("LogMute")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LogMute
{
	[BepInPlugin("_score.LogMute", "LogMute", "1.0.0")]
	public class LogMutePlugin : BaseUnityPlugin
	{
		[CompilerGenerated]
		private static class <>O
		{
			public static Manipulator <0>__EffectComponent_Start;

			public static Manipulator <1>__EffectManagerHelper_Reset;

			public static Manipulator <2>__EffectManagerHelper_StopAllParticleSystems;

			public static Manipulator <3>__Tracer_PrepForPoolUsage;

			public static Manipulator <4>__EffectManager_SpawnEffect_GameObject_EffectData_bool;

			public static Manipulator <5>__InputSourceFilter_Refresh;

			public static Manipulator <6>__NoRegister;

			public static Manipulator <7>__NoRegister2;

			public static Manipulator <8>__NoRegister3;

			public static Manipulator <9>__NoParent;

			public static Manipulator <10>__NoFix;

			public static Action<object> <11>__Fuck;

			public static Action<object, Object> <12>__FuckUnity;

			public static Action<string, object[]> <13>__FuckYou;

			public static Action<Object, string, object[]> <14>__ExtraFuckYou;
		}

		public const string PluginGUID = "_score.LogMute";

		public const string PluginAuthor = "score";

		public const string PluginName = "LogMute";

		public const string PluginVersion = "1.0.0";

		private static void Fuck(object you)
		{
		}

		private static void FuckUnity(object you, Object fuck)
		{
		}

		private static void FuckYou(string fuck, object[] you)
		{
		}

		private static void ExtraFuckYou(Object extra, string fuck, object[] you)
		{
		}

		public void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Expected O, but got Unknown
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Expected O, but got Unknown
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Expected O, but got Unknown
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Expected O, but got Unknown
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Expected O, but got Unknown
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Expected O, but got Unknown
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Expected O, but got Unknown
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Expected O, but got Unknown
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Expected O, but got Unknown
			object obj = <>O.<0>__EffectComponent_Start;
			if (obj == null)
			{
				Manipulator val = EffectComponent_Start;
				<>O.<0>__EffectComponent_Start = val;
				obj = (object)val;
			}
			EffectComponent.Start += (Manipulator)obj;
			object obj2 = <>O.<1>__EffectManagerHelper_Reset;
			if (obj2 == null)
			{
				Manipulator val2 = EffectManagerHelper_Reset;
				<>O.<1>__EffectManagerHelper_Reset = val2;
				obj2 = (object)val2;
			}
			EffectManagerHelper.Reset += (Manipulator)obj2;
			object obj3 = <>O.<2>__EffectManagerHelper_StopAllParticleSystems;
			if (obj3 == null)
			{
				Manipulator val3 = EffectManagerHelper_StopAllParticleSystems;
				<>O.<2>__EffectManagerHelper_StopAllParticleSystems = val3;
				obj3 = (object)val3;
			}
			EffectManagerHelper.StopAllParticleSystems += (Manipulator)obj3;
			object obj4 = <>O.<3>__Tracer_PrepForPoolUsage;
			if (obj4 == null)
			{
				Manipulator val4 = Tracer_PrepForPoolUsage;
				<>O.<3>__Tracer_PrepForPoolUsage = val4;
				obj4 = (object)val4;
			}
			Tracer.PrepForPoolUsage += (Manipulator)obj4;
			object obj5 = <>O.<4>__EffectManager_SpawnEffect_GameObject_EffectData_bool;
			if (obj5 == null)
			{
				Manipulator val5 = EffectManager_SpawnEffect_GameObject_EffectData_bool;
				<>O.<4>__EffectManager_SpawnEffect_GameObject_EffectData_bool = val5;
				obj5 = (object)val5;
			}
			EffectManager.SpawnEffect_GameObject_EffectData_bool += (Manipulator)obj5;
			object obj6 = <>O.<5>__InputSourceFilter_Refresh;
			if (obj6 == null)
			{
				Manipulator val6 = InputSourceFilter_Refresh;
				<>O.<5>__InputSourceFilter_Refresh = val6;
				obj6 = (object)val6;
			}
			InputSourceFilter.Refresh += (Manipulator)obj6;
			MethodInfo methodInfo = AccessTools.DeclaredMethod(typeof(NetworkScene), "RegisterPrefab", new Type[1] { typeof(GameObject) }, (Type[])null);
			object obj7 = <>O.<6>__NoRegister;
			if (obj7 == null)
			{
				Manipulator val7 = NoRegister;
				<>O.<6>__NoRegister = val7;
				obj7 = (object)val7;
			}
			new ILHook((MethodBase)methodInfo, (Manipulator)obj7);
			MethodInfo methodInfo2 = AccessTools.DeclaredMethod(typeof(NetworkScene), "RegisterPrefab", new Type[2]
			{
				typeof(GameObject),
				typeof(NetworkHash128)
			}, (Type[])null);
			object obj8 = <>O.<7>__NoRegister2;
			if (obj8 == null)
			{
				Manipulator val8 = NoRegister2;
				<>O.<7>__NoRegister2 = val8;
				obj8 = (object)val8;
			}
			new ILHook((MethodBase)methodInfo2, (Manipulator)obj8);
			MethodInfo methodInfo3 = AccessTools.DeclaredMethod(typeof(NetworkScene), "RegisterSpawnHandler", (Type[])null, (Type[])null);
			object obj9 = <>O.<8>__NoRegister3;
			if (obj9 == null)
			{
				Manipulator val9 = NoRegister3;
				<>O.<8>__NoRegister3 = val9;
				obj9 = (object)val9;
			}
			new ILHook((MethodBase)methodInfo3, (Manipulator)obj9);
			MethodInfo methodInfo4 = AccessTools.DeclaredPropertySetter(typeof(Transform), "parent");
			object obj10 = <>O.<9>__NoParent;
			if (obj10 == null)
			{
				Manipulator val10 = NoParent;
				<>O.<9>__NoParent = val10;
				obj10 = (object)val10;
			}
			new ILHook((MethodBase)methodInfo4, (Manipulator)obj10);
			MethodInfo methodInfo5 = AccessTools.DeclaredPropertyGetter(typeof(ItemDef), "itemIndex");
			object obj11 = <>O.<10>__NoFix;
			if (obj11 == null)
			{
				Manipulator val11 = NoFix;
				<>O.<10>__NoFix = val11;
				obj11 = (object)val11;
			}
			new ILHook((MethodBase)methodInfo5, (Manipulator)obj11);
			MethodInfo methodInfo6 = AccessTools.DeclaredPropertyGetter(typeof(ItemTierDef), "tier");
			object obj12 = <>O.<10>__NoFix;
			if (obj12 == null)
			{
				Manipulator val12 = NoFix;
				<>O.<10>__NoFix = val12;
				obj12 = (object)val12;
			}
			new ILHook((MethodBase)methodInfo6, (Manipulator)obj12);
			MethodInfo methodInfo7 = AccessTools.DeclaredPropertyGetter(typeof(EquipmentDef), "equipmentIndex");
			object obj13 = <>O.<10>__NoFix;
			if (obj13 == null)
			{
				Manipulator val13 = NoFix;
				<>O.<10>__NoFix = val13;
				obj13 = (object)val13;
			}
			new ILHook((MethodBase)methodInfo7, (Manipulator)obj13);
		}

		private static void NoRegister(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "Log")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogWarning")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogError")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
		}

		private static void NoRegister2(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "Log")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogError")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
		}

		private static void NoRegister3(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogError")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogError")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogError")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "Log")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
		}

		private static void NoFix(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogError")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogError")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
		}

		private static void NoParent(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogWarning")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object, Object>>((Action<object, Object>)FuckUnity);
			}
		}

		private static void InputSourceFilter_Refresh(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogWarningFormat")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<string, object[]>>((Action<string, object[]>)FuckYou);
			}
		}

		private static void EffectManager_SpawnEffect_GameObject_EffectData_bool(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogError")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<object>>((Action<object>)Fuck);
			}
		}

		private static void Tracer_PrepForPoolUsage(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogFormat")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<string, object[]>>((Action<string, object[]>)FuckYou);
			}
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogFormat")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<string, object[]>>((Action<string, object[]>)FuckYou);
			}
		}

		private static void EffectManagerHelper_StopAllParticleSystems(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogFormat")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<string, object[]>>((Action<string, object[]>)FuckYou);
			}
		}

		private static void EffectManagerHelper_Reset(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogFormat")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<string, object[]>>((Action<string, object[]>)FuckYou);
			}
		}

		private static void EffectComponent_Start(ILContext il)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			ILCursor val = new ILCursor(il);
			if (val.TryGotoNext(new Func<Instruction, bool>[1]
			{
				(Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Debug>(x, "LogErrorFormat")
			}))
			{
				val.Remove();
				val.EmitDelegate<Action<Object, string, object[]>>((Action<Object, string, object[]>)ExtraFuckYou);
			}
		}
	}
}