Decompiled source of PermaGTFO v1.0.0

PermaGTFOState.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("PermaGTFO")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PermaGTFO")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("67204228-46c1-4fd6-8d77-e3a255621942")]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace PermaGTFOState;

[BepInPlugin("NastyPabloDLL.PermaGTFO", "PermaGTFO", "1.0.0")]
[BepInProcess("REPO.exe")]
public class PermaGTFOState : BaseUnityPlugin
{
	[HarmonyPatch(typeof(LevelGenerator), "PlayerSpawn")]
	private class LevelGTFO
	{
		[HarmonyPostfix]
		private static void PlayerSpawn()
		{
			if (SemiFunc.RunIsLevel() && isEnabled.Value)
			{
				int value = Traverse.Create((object)RoundDirector.instance).Field("extractionPoints").GetValue<int>();
				Traverse.Create((object)RoundDirector.instance).Field("extractionPointsCompleted").SetValue((object)value);
				RoundDirector.instance.ExtractionCompletedAllCheck();
				Traverse.Create((object)RoundDirector.instance).Field("extractionPointsCompleted").SetValue((object)0);
			}
		}
	}

	private const string modGUID = "NastyPabloDLL.PermaGTFO";

	private const string modName = "PermaGTFO";

	private const string modVersion = "1.0.0";

	private readonly Harmony harmony = new Harmony("NastyPabloDLL.PermaGTFO");

	private static readonly ManualLogSource logger = Logger.CreateLogSource("PermaGTFO");

	private static ConfigEntry<bool> isEnabled;

	private void Awake()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Expected O, but got Unknown
		isEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "GTFO", true, new ConfigDescription("Enable", (AcceptableValueBase)null, Array.Empty<object>()));
		harmony.PatchAll();
	}
}