public void CheatCountAndFinalStateTest()
        {
            GameNumber theNumber = new GameNumber();
            Cheat cheat = new Cheat();

            cheat.GetCheat(theNumber);
            Assert.AreEqual(1, cheat.Count);

            cheat.GetCheat(theNumber);
            Assert.AreEqual(2, cheat.Count);

            cheat.GetCheat(theNumber);
            Assert.AreEqual(3, cheat.Count);

            cheat.GetCheat(theNumber);
            Assert.AreEqual(4, cheat.Count);

            cheat.GetCheat(theNumber);
            Assert.AreEqual(4, cheat.Count);

            for (int i = 0; i < cheat.CheatNumber.Length; i++)
            {
                Assert.AreNotEqual('X', cheat.CheatNumber[i]);
            }
        }
Example #2
0
        /// <summary>
        /// Defines the entry point of the application.
        /// </summary>
        private static void Main()
        {
            Console.WriteLine("[*] Setting up the cleaner...");

            var Detector = new Cheats();
            var Cheats   = Detector.Detect();

            foreach (var Cheat in Cheats)
            {
                Console.WriteLine("[*] Detected " + Cheat.Name);
            }

            if (Program.Clean)
            {
                foreach (var Cheat in Cheats)
                {
                    Cheat.Clean();
                }
            }

            if (Cheats.Count == 0)
            {
                Console.WriteLine("[*] Not a single cheat has been detected, GJ.");
            }

            Console.ReadKey(false);
        }
Example #3
0
        protected override void AfterSetup()
        {
            base.AfterSetup();

            Cheat.SetServices(Container.GetInstance <ICheatImpl>());
            CalculatedGameSettings.RaiseEvent   = Cheat.PublishEvent;
            CalculatedGameSettings.NotifyEnMass = async(message) => {
                await Cheat.PublishDomainEvent((dynamic)message).ConfigureAwait(false);

                Cheat.PublishEvent(message);
            };

            SetupSettings();
            DomainEvilGlobal.SelectedGame = Container.GetInstance <EvilGlobalSelectedGame>();

            var authProviderStorage = Container.GetInstance <IAuthProviderStorage>();
            var authProvider        = Container.GetInstance <IAuthProvider>();

            PwsUriHandler.GetAuthInfoFromUri = authProvider.GetAuthInfoFromUri;
            PwsUriHandler.SetAuthInfo        = authProviderStorage.SetAuthInfo;

            var gameContext   = Container.GetInstance <IGameContext>();
            var recentGameSet = DomainEvilGlobal.Settings.GameOptions.RecentGameSet;

            DomainEvilGlobal.SelectedGame.ActiveGame = recentGameSet == null
                ? FindFirstInstalledGameOrDefault(gameContext)
                : gameContext.Games.Find(recentGameSet.Id) ??
                                                       FindFirstInstalledGameOrDefault(gameContext);
        }
Example #4
0
 private void setDPI(string[] param)
 {
     Cheat.Msg(string.Concat(new object[]
     {
         "Screen: ",
         Screen.width,
         " ",
         Screen.height,
         " ",
         Screen.currentResolution.refreshRate
     }));
     if (param.Length > 3)
     {
         Screen.SetResolution(int.Parse(param[1]), int.Parse(param[2]), true, int.Parse(param[3]));
     }
     else
     {
         Screen.SetResolution(int.Parse(param[1]), int.Parse(param[2]), true);
     }
     Cheat.Msg(string.Concat(new object[]
     {
         "To: ",
         Screen.width,
         " ",
         Screen.height,
         " ",
         Screen.height,
         " ",
         Screen.currentResolution.refreshRate
     }));
 }
        public void CheatCountAndFinalStateTest()
        {
            GameNumber theNumber = new GameNumber();
            Cheat      cheat     = new Cheat();

            cheat.GetCheat(theNumber);
            Assert.AreEqual(1, cheat.Count);

            cheat.GetCheat(theNumber);
            Assert.AreEqual(2, cheat.Count);

            cheat.GetCheat(theNumber);
            Assert.AreEqual(3, cheat.Count);

            cheat.GetCheat(theNumber);
            Assert.AreEqual(4, cheat.Count);

            cheat.GetCheat(theNumber);
            Assert.AreEqual(4, cheat.Count);

            for (int i = 0; i < cheat.CheatNumber.Length; i++)
            {
                Assert.AreNotEqual('X', cheat.CheatNumber[i]);
            }
        }
Example #6
0
    private void gs(string[] param)
    {
        BindingFlags bindingAttr = BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
        FieldInfo    field       = typeof(GlobalSettings).GetField(param[1], bindingAttr);

        if (field != null)
        {
            this._setFieldValue(field, GlobalSettings.Instance, param[2]);
            return;
        }
        FieldInfo[] fields = typeof(GlobalSettings).GetFields(bindingAttr);
        FieldInfo[] array  = fields;
        for (int i = 0; i < array.Length; i++)
        {
            FieldInfo fieldInfo = array[i];
            Type      fieldType = fieldInfo.FieldType;
            if (fieldType.IsClass)
            {
                FieldInfo field2 = fieldType.GetField(param[1], bindingAttr);
                if (field2 != null)
                {
                    object value = fieldInfo.GetValue(GlobalSettings.Instance);
                    this._setFieldValue(field2, value, param[2]);
                    Cheat.Msg(new object[]
                    {
                        "GlobalSettings.SetField: ",
                        param[1],
                        " = ",
                        param[2]
                    });
                    return;
                }
            }
        }
    }
Example #7
0
        /// <summary>
        /// Attempts to unlock the provided cheat.
        /// </summary>
        /// <param name="cheat">The cheat to unlock</param>
        private void UnlockCheat(Cheat cheat)
        {
            if (!this.LockedCheatList.Contains(cheat))
            {
                throw new Exception("Cheat must be a locked cheat");
            }

            AccessTokens accessTokens = SettingsViewModel.GetInstance().AccessTokens;

            // We need the unlocked cheat, since the locked one does not include the payload
            try
            {
                UnlockedCheat unlockedCheat = SqualrApi.UnlockCheat(accessTokens.AccessToken, cheat.CheatId);

                BrowseViewModel.GetInstance().SetCoinAmount(unlockedCheat.RemainingCoins);

                this.LockedCheatList.Remove(cheat);
                this.UnlockedCheatList.Insert(0, unlockedCheat.Cheat);
                LibraryViewModel.GetInstance().OnUnlock(unlockedCheat.Cheat);
            }
            catch (Exception ex)
            {
                OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Error, "Error unlocking cheat", ex);
            }
        }
Example #8
0
 private void gon(string[] param)
 {
     if (param.Length > 1)
     {
         Cheat.MakeActive(param[1], true);
     }
 }
Example #9
0
    void Update()
    {
        // Update timer
        if (cheat_delay > 0f)
        {
            cheat_delay -= Time.unscaledDeltaTime;
            if (cheat_delay <= 0)  // Time is up, reset progress
            {
                progress = new int[progress.Length];
            }
        }

        // Update Cheats
        for (int i = 0; i < progress.Length; i++)
        {
            Cheat cheat = cheats[i];
            if (Input.GetKeyDown(cheat.code[progress[i]]))
            {
                progress[i]++;
                if (progress[i] >= cheat.code.Length)  // Cheat used
                {
                    cheat.action.Invoke();
                    hasCheated  = true;
                    progress[i] = 0;
                    PlaySoundFromGroup(sound_cheat_toggle, 1.0f);
                }
                cheat_delay = 1f;
            }
        }
    }
Example #10
0
        /// <summary>
        /// Adds the cheat to the selected library.
        /// </summary>
        /// <param name="cheat">The cheat to add.</param>
        private void AddCheatToLibrary(Cheat cheat)
        {
            if (!this.CheatsAvailable.Contains(cheat))
            {
                OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Error, "Unable to add cheat to library");
                return;
            }

            AccessTokens accessTokens = SettingsViewModel.GetInstance().AccessTokens;

            try
            {
                SqualrApi.AddCheatToLibrary(accessTokens.AccessToken, this.ActiveLibrary.LibraryId, cheat.CheatId);

                cheat.LoadDefaultStreamSettings();

                this.cheatsAvailable.Remove(cheat);
                this.cheatsInLibrary.Insert(0, cheat);
                this.RaisePropertyChanged(nameof(this.CheatsAvailable));
                this.RaisePropertyChanged(nameof(this.CheatsInLibrary));
            }
            catch (Exception ex)
            {
                OutputViewModel.GetInstance().Log(OutputViewModel.LogLevel.Error, "Error adding cheat to library", ex);
            }
        }
Example #11
0
 private void goff(string[] param)
 {
     if (param.Length > 1)
     {
         Cheat.MakeActive(param[1], false);
     }
 }
Example #12
0
 public Module(Cheat cheat, VirtualKeyShort bind, string name)
 {
     Cheat     = cheat;
     Bind      = bind;
     Name      = name;
     IsToggled = false;
 }
Example #13
0
        // All shared initialization
        public static void Init()
        {
            SimpleConfigurator.ConfigureForConsoleLogging(LogLevel.Info); // Doesnt seem to work anymore?!
            SetupNlog.Initialize("Test Runner");
            CommonBase.AssemblyLoader = GetAssemblyLoader();
            // Use to Reset the various common instances
            // Normally the EA instance is created in the AppBootStrapper, and Dependency injected into ShellViewModel
            Common.App   = new Common.AppCommon();
            Common.Paths = new PathConfiguration();
            // Must set AppPath to curdir, otherwise we end up somewhere in test heaven
            // Also keep the test configuration and temp data separate from production
            Common.App.InitLocalWithCleanup("Test Runner");
            var ea = new EventAggregator();

            Cheat.SetServices(new CheatImpl(ea, new Mediator(null, null)));
            DomainEvilGlobal.Settings = new UserSettings();

            /*
             * Tools.RegisterServices(new ToolsServices(new ProcessManager(),
             *  new Lazy<IWCFClient>(() => new WCFClient()),
             *  new Lazy<IGeoIpService>(() => new GeoIpService()), new CompressionUtil()));
             */
            ReSetupTools();

            if (!SingleSetup)
            {
                new AssemblyHandler().Register();
                SingleSetup = true;
            }
        }
Example #14
0
 private void showDPI(string[] param)
 {
     Cheat.Msg(new object[]
     {
         "curDPI: ",
         Screen.dpi
     });
 }
Example #15
0
 void ApplyCheat(Cheat cheat)
 {
     if (cheat.method != null)
     {
         cheat.method();
     }
     AddMessage("Cheat " + cheat.title + " Activated");
 }
Example #16
0
        static async Task CheckForNewVersion()
        {
            var newVersion = await new PlaySquirrel().GetNewVersion().ConfigureAwait(false);

            if (newVersion != null)
            {
                Cheat.PublishDomainEvent(new NewVersionAvailable(newVersion));
            }
        }
Example #17
0
 /// <summary>
 /// ローカルコマンドの実行
 /// </summary>
 void ExecLocalCommand(Cheat cheat)
 {
     switch (cheat.Command)
     {
     case "DeleteAccessToken":
         Network.Auth.DeleteAccessToken();
         break;
     }
 }
Example #18
0
    private void ShowFPS(string[] param)
    {
        GoldViewFps goldViewFps = UnityEngine.Object.FindObjectOfType <GoldViewFps>();

        if (goldViewFps != null)
        {
            Cheat.AddWatch(goldViewFps, "fps", null);
        }
    }
Example #19
0
 private void SetMoveDelay(string[] param)
 {
     if (param.Length > 2)
     {
         float speed = (param.Length <= 3) ? 0f : float.Parse(param[3]);
         FrameSyncManager.Instance.setDelayTime(float.Parse(param[1]), float.Parse(param[2]), speed);
         Cheat.Msg(this.mCheatCode);
     }
 }
Example #20
0
 private void testAddwatch(string[] param)
 {
     Units[] array = UnityEngine.Object.FindObjectsOfType <Units>();
     for (int i = 0; i < array.Length; i++)
     {
         if (array[i].moveController != null && array[i].DebugDLog)
         {
             Cheat.AddWatch(array[i].moveController, "moveState", array[i].npc_id);
         }
     }
 }
Example #21
0
 ///<inheritdoc/>
 public void ToggleCheat(Cheat cheat)
 {
     if (_enabledCheats.Contains(cheat))
     {
         _enabledCheats.Remove(cheat);
     }
     else
     {
         _enabledCheats.Add(cheat);
     }
 }
Example #22
0
 //sets the cheat to be executed on click
 public void setCheat(string cheat)
 {
     if (cheat == "UnlockAll")
     {
         activeCheat = Cheat.UnlockAll;
     }
     else if (cheat == "Reset")
     {
         activeCheat = Cheat.Reset;
     }
 }
Example #23
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(gameObject);
 }
Example #24
0
 public override void CommitEntry(IStateOwner pOwner, string sCurrentEntry)
 {
     pOwner.CurrentState = _PreviousState;
     if (Cheat.ProcessCheat(sCurrentEntry, pOwner))
     {
         TetrisGame.Soundman.PlaySound("right", pOwner.Settings.std.EffectVolume);
     }
     else
     {
         TetrisGame.Soundman.PlaySound("wrong", pOwner.Settings.std.EffectVolume);
     }
 }
Example #25
0
 private void Awake()
 {
     if (instance == null)
     {
         //DontDestroyOnLoad(this.gameObject);
         instance = this;
     }
     else
     {
         Destroy(this.gameObject);
     }
 }
Example #26
0
        public OverlayForm()
        {
            InitializeComponent();

            Cheat         = new Cheat();
            Cheat.Closed += Cheat_Closed;

            cheatTask = new Task(() => { Cheat.Start(); });

            debugFont  = new Font("Consolas", 10, FontStyle.Bold);
            debugBrush = Brushes.Yellow;
        }
Example #27
0
 public void RegisterCheat(string name, string key, Cheat.Do what)
 {
     if (!m_takenKeys.Contains(key))
     {
         m_takenKeys.Add(key);
         var cheat = new Cheat(name, key, what);
         m_cheats.Add(cheat);
     }
     else
     {
         throw new KeyAlreadyAssignedException();
     }
 }
Example #28
0
    private void CommandKeys()
    {
        if (Input.GetKeyDown(KeyCode.L))
        {
            SceneManager.LoadScene(1);
        }

        // Disables collisions
        else if (Input.GetKeyDown(KeyCode.C))
        {
            cheat = Cheat.Cheat;
        }
    }
Example #29
0
 public void SetCheat(Cheat cheat)
 {
     _editmode = true;
     _cheat    = cheat;
     if (cheat.IsSeparator)
     {
         SetFormToDefault();
     }
     else
     {
         SetFormToCheat();
     }
 }
Example #30
0
        public void Update()
        {
            Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;

            if (unixTimestamp < stopShowTextOn)
            {
                textManager.ShowText(textToShow);
                textShown = true;
            }
            else if (textShown)
            {
                textShown = false;
                textManager.HideDisplayTexts();
            }
            if (GameManager.GameMode != GameMode.None)
            {
                if (Input.GetKeyDown(KeyCode.B))
                {
                    GameManager.UseCheats = !GameManager.UseCheats;
                    stopShowTextOn        = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds + 5;
                    if (GameManager.UseCheats)
                    {
                        textToShow = "Cheatmode enabled";
                    }
                    else
                    {
                        textToShow = "Cheatmode disabled";
                    }

                    GameManager gm    = FindObjectOfType <GameManager>();
                    Cheat       cheat = gm.GetPrivateField <Cheat>("cheat");

                    if (!cheatsInited)
                    {
                        cheat.Initialize();
                        cheatsInited = true;
                    }

                    //if(cheatsActivated)
                    //{
                    //    GameManager.UseCheats = true;
                    //    cheatsActivated = false;
                    //}
                    //else
                    //{
                    //    GameManager.UseCheats = true;
                    //    cheatsActivated = true;
                    //}
                }
            }
        }
Example #31
0
        public static void UpdateCheatStreamMeta(String accessToken, Cheat cheat)
        {
            Dictionary <String, String> parameters = new Dictionary <String, String>();

            parameters.Add("access_token", accessToken);
            parameters.Add("cheat_id", cheat?.CheatId.ToString());

            parameters.Add("is_stream_disabled", ((cheat?.IsStreamDisabled ?? false) ? 1 : 0).ToString());
            parameters.Add("cooldown", cheat?.CooldownMax.ToString());
            parameters.Add("duration", cheat?.DurationMax.ToString());
            parameters.Add("icon", cheat?.IconName?.ToString());

            SqualrApi.ExecuteRequest(Method.PUT, SqualrApi.UpdateCheatStreamMetaEndpoint + "/" + cheat?.CheatId.ToString(), parameters);
        }
	//sets the cheat to be executed on click
	public void setCheat (string cheat) {
		if (cheat == "UnlockAll") {
			activeCheat = Cheat.UnlockAll;
		} else if (cheat == "Reset") {
			activeCheat = Cheat.Reset;
		}
	}
	//cancels the cheat to be executed
	public void cancelCheat () {
		activeCheat = Cheat.None;
	}
 public void CheatInitialStateTest()
 {
     Cheat cheat = new Cheat();
     Assert.AreEqual("XXXX", new string(cheat.CheatNumber));
 }