Beispiel #1
0
        private void CalmAnimalsCheckBox_CheckedChanged(object sender, EventArgs e)
        {
            if (!gameOpen)
            {
                return;
            }

            if (CalmAnimalsCheckBox.CheckState == CheckState.Checked)
            {
                int index = listOfInjections.FindIndex(x => x.GetType() == typeof(CalmAnimals));
                if (index == -1)
                {
                    listOfInjections.Add(new CalmAnimals(mem, gameProcess.MainModule, hProcess));
                    index = listOfInjections.Count - 1;
                }
                listOfInjections[index].enable(mem.findAvilMemArea(baseaddress));
            }
            else
            {
                int index = listOfInjections.FindIndex(x => x.GetType() == typeof(CalmAnimals));
                if (index != -1)
                {
                    listOfInjections[index].disable();
                }
            }
        }
Beispiel #2
0
 private void tryLoadingProcess()
 {
     if (InvokeRequired)
     {
         BeginInvoke(new MethodInvoker(tryLoadingProcess));
     }
     else
     {
         gameProcess = Process.GetProcessesByName("theHunterCotW_F").FirstOrDefault();
         if (gameProcess == null)
         {
             MessageBox.Show("Error: The game isn't open");
             TabControls.TabPages[0].Enabled = false;
             TabControls.TabPages[1].Enabled = false;
             foreach (IInjection i in listOfInjections)
             {
                 i.reset();
             }
             foreach (Control ctl in TabControls.TabPages[1].Controls)
             {
                 CheckBox temp = ctl as CheckBox;
                 temp.Checked = false;
             }
             foreach (Control ctl in TabControls.TabPages[0].Controls)
             {
                 if (ctl.GetType() == typeof(TextBox))
                 {
                     TextBox temp = ctl as TextBox;
                     temp.Text = "";
                 }
             }
             gameOpen = false;
             return;
         }
         baseaddress = gameProcess.MainModule.BaseAddress;
         hProcess    = Win32.OpenProcess(2035711U, false, (uint)gameProcess.Id);
         mem         = new MemoryClass(hProcess);
         foreach (IInjection i in listOfInjections)
         {
             i.restart(mem, gameProcess.MainModule, hProcess, mem.findAvilMemArea(baseaddress));
         }
         TabControls.TabPages[0].Enabled = true;
         TabControls.TabPages[1].Enabled = true;
         statScanner();
         gameOpen = true;
         statRefreshTimer.Tick          += StatRefreshTimer_Tick;
         gameProcess.EnableRaisingEvents = true;
         gameProcess.Exited += GameProcess_Exited;
         return;
     }
 }