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.Unity.IL2CPP; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.Injection; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using ModSettingsMenu.Api; using TMPro; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("CheatsForeverSAM")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("CheatsForeverSAM")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("1849becd-dcc2-4971-a32c-6b05f349b2e3")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("direct.sam.cheatsforever", "CheatsForever", "1.0.0")] public class Plugin : BasePlugin { public static ConfigEntry OpenMenuKey; public override void Load() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown ((BasePlugin)this).Log.LogInfo((object)"CheatsForever V. 1.0.0 Got Loaded :)"); OpenMenuKey = ((BasePlugin)this).Config.Bind("Controls", "OpenMenuKey", (Key)30, "Key used to open the CheatsForeverMenu"); ModSettingsRegistry.Register("direct.sam.cheatsforever", new ModSettingsModOptions { Name = "CheatsForever", Description = "CheatsForever! A Full Mod Menu To Spawn Customers, Add Money, Decrease Money, And Alot More!", Author = "Direct", Version = "1.0.0" }); ClassInjector.RegisterTypeInIl2Cpp(); GameObject val = new GameObject("CheatsForeverManager"); val.AddComponent(); Object.DontDestroyOnLoad((Object)(object)val); } } public class CheatManager : MonoBehaviour { private bool cheatsOpen = false; private TextMeshProUGUI menuText; private GameObject cheatsMenu; private GameObject menuTextObject; private PlayerManager playerManager; private Transform cameraTransform; private Quaternion lockedCameraRotation; private bool cameraLocked; public CheatManager(IntPtr ptr) : base(ptr) { } public void Update() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (Keyboard.current != null && ((ButtonControl)Keyboard.current[Plugin.OpenMenuKey.Value]).wasPressedThisFrame) { ToggleMenu(); } if (cameraLocked && (Object)(object)cameraTransform != (Object)null) { cameraTransform.localRotation = lockedCameraRotation; } } private void ToggleMenu() { //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) FindMenuObjects(); if ((Object)(object)cheatsMenu == (Object)null) { Debug.Log(Object.op_Implicit("[CheatsForever] Cheats menu not found!")); return; } cheatsOpen = !cheatsOpen; cheatsMenu.SetActive(cheatsOpen); if ((Object)(object)menuTextObject != (Object)null) { menuTextObject.SetActive(cheatsOpen); if ((Object)(object)menuText == (Object)null) { menuText = menuTextObject.GetComponent(); } if ((Object)(object)menuText != (Object)null) { ((TMP_Text)menuText).text = "CheatsForever | 1.0.0\nPress P To Open The Menu"; } } SetCursorPermission(cheatsOpen); SetupCamera(); if ((Object)(object)cameraTransform != (Object)null) { if (cheatsOpen) { lockedCameraRotation = cameraTransform.localRotation; cameraLocked = true; } else { cameraLocked = false; } } if (cheatsOpen) { Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; Debug.Log(Object.op_Implicit("[CheatsForever] Menu Opened")); } else { Cursor.lockState = (CursorLockMode)1; Cursor.visible = false; Debug.Log(Object.op_Implicit("[CheatsForever] Menu Closed")); } } private void FindMenuObjects() { if ((Object)(object)cheatsMenu != (Object)null) { return; } GameObject val = GameObject.Find("CheatsMenuHolder (1)"); if ((Object)(object)val == (Object)null) { Debug.Log(Object.op_Implicit("[CheatsForever] CheatsMenuHolder GO not found!")); return; } Transform val2 = val.transform.Find("CheatsMenu/Canvas/Cheats Menu"); Transform val3 = val.transform.Find("CheatsMenu/Canvas/Text (TMP) (1)"); if ((Object)(object)val2 != (Object)null) { cheatsMenu = ((Component)val2).gameObject; } if ((Object)(object)val3 != (Object)null) { menuTextObject = ((Component)val3).gameObject; } } private void SetupCamera() { if ((Object)(object)cameraTransform != (Object)null) { return; } Il2CppReferenceArray val = Object.FindObjectsOfType(Il2CppType.Of()); foreach (Object item in (Il2CppArrayBase)(object)val) { PlayerManager val2 = ((Il2CppObjectBase)item).Cast(); if ((Object)(object)val2 != (Object)null) { playerManager = val2; if ((Object)(object)val2.cameraHolder != (Object)null) { cameraTransform = val2.cameraHolder.transform; Debug.Log(Object.op_Implicit("[CheatsForever] CameraHolder found!")); return; } } } Debug.Log(Object.op_Implicit("[CheatsForever] CameraHolder not found!")); } private void SetCursorPermission(bool menuOpen) { if ((Object)(object)playerManager == (Object)null) { Il2CppReferenceArray val = Object.FindObjectsOfType(Il2CppType.Of()); foreach (Object item in (Il2CppArrayBase)(object)val) { playerManager = ((Il2CppObjectBase)item).Cast(); if ((Object)(object)playerManager != (Object)null) { break; } } } if ((Object)(object)playerManager != (Object)null) { playerManager.dontAllowLockCursor = menuOpen; Debug.Log(Object.op_Implicit("[CheatsForever] dontAllowLockCursor = " + playerManager.dontAllowLockCursor)); } else { Debug.Log(Object.op_Implicit("[CheatsForever] PlayerManager not found!")); } } }