using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;
using UnityEngine.Networking;
using Zorro.Core;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("PeakVersionBypass")]
[assembly: AssemblyDescription("Make Peak running even if the game got an update")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Kirigiri")]
[assembly: AssemblyProduct("PeakVersionBypass")]
[assembly: AssemblyCopyright("Kirigiri © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("be8d4052-15e4-4cc0-8481-034b8dd0e20d")]
[assembly: AssemblyFileVersion("1.0.0.1")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.1")]
namespace NekogiriMod;
[BepInPlugin("kirigiri.peak.peakversionbypass", "Peak Version Bypass", "1.0.0.1")]
public class NekogiriMod : BaseUnityPlugin
{
[HarmonyPatch(typeof(CloudAPI), "CheckVersion")]
public class CloudAPICheckVersionPatch
{
private static readonly DateTime startDate = new DateTime(2025, 6, 14);
[HarmonyPrefix]
public static bool Prefix(Action<LoginResponse> response)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
GameHandler.AddStatus<QueryingGameTimeStatus>((GameStatus)new QueryingGameTimeStatus());
BuildVersion val = default(BuildVersion);
((BuildVersion)(ref val))..ctor(Application.version);
string text = "https://peaklogin-beta.azurewebsites.net/api/VersionCheck?version=" + ((BuildVersion)(ref val)).ToMatchmaking();
if (val.BuildName == "beta")
{
text = "https://peaklogin-beta.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_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Invalid comparison between Unknown and I4
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Invalid comparison between Unknown and I4
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Expected O, but got Unknown
GameHandler.ClearStatus<QueryingGameTimeStatus>();
if ((int)request.result != 1)
{
Debug.Log((object)("Got error: " + request.error));
if ((int)request.result != 2)
{
response?.Invoke(new LoginResponse
{
VersionOkay = false
});
}
}
else
{
string text2 = request.downloadHandler.text;
LoginResponse val2 = JsonUtility.FromJson<LoginResponse>(text2);
val2.VersionOkay = true;
Debug.Log((object)("Got message: " + text2));
response?.Invoke(val2);
}
};
return false;
}
}
private void Awake()
{
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
((BaseUnityPlugin)this).Logger.LogInfo((object)"\r\n ██ ▄█▀ ██▓ ██▀███ ██▓ ▄████ ██▓ ██▀███ ██▓\r\n ██▄█▒ ▓██▒▓██ ▒ ██▒▓██▒ ██▒ ▀█▒▓██▒▓██ ▒ ██▒▓██▒\r\n▓███▄░ ▒██▒▓██ ░▄█ ▒▒██▒▒██░▄▄▄░▒██▒▓██ ░▄█ ▒▒██▒\r\n▓██ █▄ ░██░▒██▀▀█▄ ░██░░▓█ ██▓░██░▒██▀▀█▄ ░██░\r\n▒██▒ █▄░██░░██▓ ▒██▒░██░░▒▓███▀▒░██░░██▓ ▒██▒░██░\r\n▒ ▒▒ ▓▒░▓ ░ ▒▓ ░▒▓░░▓ ░▒ ▒ ░▓ ░ ▒▓ ░▒▓░░▓ \r\n░ ░▒ ▒░ ▒ ░ ░▒ ░ ▒░ ▒ ░ ░ ░ ▒ ░ ░▒ ░ ▒░ ▒ ░\r\n░ ░░ ░ ▒ ░ ░░ ░ ▒ ░░ ░ ░ ▒ ░ ░░ ░ ▒ ░\r\n░ ░ ░ ░ ░ ░ ░ ░ ░ \r\n \r\n");
((BaseUnityPlugin)this).Logger.LogInfo((object)"Peak Version Bypass has loaded!");
new Harmony("kirigiri.peak.peakversionbypass").PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"Made with <3 By Kirigiri \nhttps://discord.gg/TBs8Te5nwn");
}
}