Decompiled source of NoMoreCompanyLogo v1.1.0

BepInEx/plugins/NoMoreCompanyLogo.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MoreCompany;

[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("NoMoreCompanyLogo")]
[assembly: AssemblyConfiguration("release")]
[assembly: AssemblyDescription("Removes the more company logo from the main menu screen")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: AssemblyInformationalVersion("1.1.0+332b01fbe7a7919f75cf6228b0aebf32ec836ce1")]
[assembly: AssemblyProduct("NoMoreCompanyLogo")]
[assembly: AssemblyTitle("NoMoreCompanyLogo")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.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 NoMoreCompanyLogo
{
	[BepInPlugin("io.daxcess.nomorecompanylogo", "NoMoreCompanyLogo", "1.1.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private const string MORECOMPANY = "me.swipez.melonloader.morecompany";

		private const string PLUGIN_GUID = "io.daxcess.nomorecompanylogo";

		private const string PLUGIN_NAME = "NoMoreCompanyLogo";

		private const string PLUGIN_VERSION = "1.1.0";

		private void Awake()
		{
			if (!Chainloader.PluginInfos.ContainsKey("me.swipez.melonloader.morecompany"))
			{
				((BaseUnityPlugin)this).Logger.LogDebug((object)"MoreCompany is not installed, shutting down...");
				return;
			}
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin io.daxcess.nomorecompanylogo is loaded!");
		}
	}
	[HarmonyPatch]
	internal static class MoreCompanyPatches
	{
		[HarmonyPatch(typeof(MenuManagerLogoOverridePatch), "Awake_Postfix")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> RemoveLogoPatchTranspiler(IEnumerable<CodeInstruction> instructions)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
			{
				new CodeMatch((OpCode?)OpCodes.Ldstr, (object)"MenuContainer/MainButtons/HeaderImage", (string)null)
			}).SetOperandAndAdvance((object)"INVALID OBJECT").MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
			{
				new CodeMatch((OpCode?)OpCodes.Ldstr, (object)"MenuContainer/LoadingScreen", (string)null)
			})
				.SetOperandAndAdvance((object)"INVALID OBJECT")
				.InstructionEnumeration();
		}

		[HarmonyPatch(typeof(MenuManagerVersionDisplayPatch), "Postfix")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> DisableVersionTextOverride(IEnumerable<CodeInstruction> instructions)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			return new CodeMatcher(instructions, (ILGenerator)null).MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
			{
				new CodeMatch((OpCode?)OpCodes.Ldstr, (object)"{0} (MC)", (string)null)
			}).SetOperandAndAdvance((object)"{0}").InstructionEnumeration();
		}
	}
}