Decompiled source of PeakVersionBypass v1.0.0

PeakVersionBypass.dll

Decompiled a week 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 BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Networking;
using Zorro.Core;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.turtledsr.peakversionbypass")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PeakVersionBypass")]
[assembly: AssemblyTitle("com.turtledsr.peakversionbypass")]
[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 peakversionbypass
{
	[BepInPlugin("com.turtledsr.peakversionbypass", "PeakVersionBypass", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(CloudAPI), "CheckVersion")]
		private static class CloudAPI_CheckVersion_Patch
		{
			private static bool Prefix(Action<LoginResponse> response)
			{
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: Expected O, but got Unknown
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				GameHandler.AddStatus<QueryingGameTimeStatus>((GameStatus)new QueryingGameTimeStatus());
				BuildVersion val = new BuildVersion(Application.version);
				string text = "https://peaklogin.azurewebsites.net/api/VersionCheck?version=" + ((BuildVersion)(ref val)).ToMatchmaking();
				Debug.Log((object)("Sending GET Request to: " + text));
				UnityWebRequest request = UnityWebRequest.Get(text);
				((AsyncOperation)request.SendWebRequest()).completed += delegate
				{
					//IL_000d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0013: Invalid comparison between Unknown and I4
					//IL_0082: Unknown result type (might be due to invalid IL or missing references)
					//IL_0088: Invalid comparison between Unknown and I4
					//IL_009e: Unknown result type (might be due to invalid IL or missing references)
					//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
					//IL_00af: Expected O, but got Unknown
					GameHandler.ClearStatus<QueryingGameTimeStatus>();
					if ((int)request.result == 1)
					{
						string text2 = request.downloadHandler.text;
						LoginResponse val2 = JsonUtility.FromJson<LoginResponse>(text2);
						val2.VersionOkay = true;
						Debug.Log((object)("Got message: " + text2));
						response?.Invoke(val2);
					}
					else
					{
						Debug.Log((object)("Got error: " + request.error));
						if ((int)request.result != 2)
						{
							response?.Invoke(new LoginResponse
							{
								VersionOkay = false
							});
						}
					}
				};
				return false;
			}
		}

		internal static ManualLogSource Logger;

		private void Awake()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			Harmony val = new Harmony("com.turtledsr.peakversionbypass");
			val.PatchAll();
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "com.turtledsr.peakversionbypass";

		public const string PLUGIN_NAME = "PeakVersionBypass";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}