private void pictureBox1_Click_1(object sender, EventArgs e) { ProcessManagement.TriggerTaskmanager(false); ProcessManagement.TaskManagerIsRunning(); if (label4.Text.Equals("Scanning")) { ErrorForm ef = new ErrorForm(); ef.label2.Text = "Game is running!"; ef.Show(); return; } if (label4.Text.Equals("Uploading")) { ErrorForm ef = new ErrorForm(); ef.label2.Text = "Please wait until uploading ends!"; ef.Show(); return; } ProcessManagement.TriggerTaskmanager(true); notifyIcon1.Visible = false; if (Directory.Exists(Core.AppPath + "acscreens\\") == true) { DirectoryInfo di = new DirectoryInfo(Core.AppPath + "acscreens\\"); di.Delete(true); } Environment.Exit(0); }
private void exitToolStripMenuItem_Click(object sender, EventArgs e) { ProcessManagement.TriggerTaskmanager(false); ProcessManagement.TaskManagerIsRunning(); if (label4.Text.Equals("Scanning")) { ErrorForm ef = new ErrorForm(); ef.label2.Text = "Game is running!"; ef.Show(); return; } if (label4.Text.Equals("Uploading")) { ErrorForm ef = new ErrorForm(); ef.label2.Text = "Please wait until uploading ends!"; ef.Show(); return; } ProcessManagement.TriggerTaskmanager(true); notifyIcon1.Visible = false; Environment.Exit(0); }
private void pictureBox2_Click(object sender, EventArgs e) { ProcessManagement.TriggerTaskmanager(false); ProcessManagement.TaskManagerIsRunning(); if (label4.Text.Equals("Scanning")) { ErrorForm ef = new ErrorForm(); ef.label2.Text = "Game is running!"; ef.Show(); return; } if (label4.Text.Equals("Uploading")) { ErrorForm ef = new ErrorForm(); ef.label2.Text = "Please wait until uploading ends!"; ef.Show(); return; } ProcessManagement.TriggerTaskmanager(true); pictureBox2.Image = ESA_AC.Properties.Resources.ac_button_back_active; if (File.Exists(Core.AppPath + "mypassword.txt")) { File.Delete(Core.AppPath + "mypassword.txt"); } notifyIcon1.Visible = false; if (Directory.Exists(Core.AppPath + "acscreens\\") == true) { DirectoryInfo di = new DirectoryInfo(Core.AppPath + "acscreens\\"); di.Delete(true); } Core.DisplayLoginForm(); this.Hide(); }
private void checker_OnStopped() { CheckForIllegalCrossThreadCalls = false; this.Show(); this.WindowState = FormWindowState.Normal; button5.Image = ESA_AC.Properties.Resources.startscan_normal; ProcessManagement.TriggerTaskmanager(false); ProcessManagement.TaskManagerIsRunning(); label4.Text = "Uploading"; try { if (File.Exists(Core.AppPath + "acscreens\\log_" + getID + "_" + selectedGame + "_" + RuntimeChecker.getTimeZip + ".zip")) { using (FileStream fsread = new FileStream(Core.AppPath + "acscreens\\log_" + getID + "_" + selectedGame + "_" + RuntimeChecker.getTimeZip + ".zip", FileMode.Open, FileAccess.Read, FileShare.Read)) { if (File.Exists(Core.AppPath + "acscreens\\log_" + getID + "_" + selectedGame + "_" + RuntimeChecker.getTimeZip + ".zip")) { FileManagement fm = new FileManagement(); fm.postFile(username, selectedGame, getID.ToString(), Core.AppPath + "acscreens\\log_" + getID + "_" + selectedGame + "_" + RuntimeChecker.getTimeZip + ".zip"); fsread.Close(); File.Delete(Core.AppPath + "acscreens\\log_" + getID + "_" + selectedGame + "_" + RuntimeChecker.getTimeZip + ".zip"); } else { File.WriteAllText(Core.AppPath + "acscreens\\warning.txt", "Anticheat zip log has been deleted."); FileManagement fm = new FileManagement(); fm.postFile(username, selectedGame, getID.ToString(), Core.AppPath + "acscreens\\warning.txt"); File.Delete(Core.AppPath + "acscreens\\warning.txt"); } } } else { File.WriteAllText(Core.AppPath + "acscreens\\warning.txt", "Anticheat zip log has been deleted."); FileManagement fm = new FileManagement(); fm.postFile(username, selectedGame, getID.ToString(), Core.AppPath + "acscreens\\warning.txt"); File.Delete(Core.AppPath + "acscreens\\warning.txt"); } } catch (Exception) { ReportForm ef = new ReportForm(); ef.label2.Text = "Upload failed."; ef.Show(); } ProcessManagement.TriggerTaskmanager(true); noGameSelectedToolStripMenuItem.Text = "No game currently selected"; selectedGame = ""; label4.Text = "Idle"; }
private void startRoutine(DialogResult getdr) { if (label4.Text.Equals("Scanning")) { ErrorForm ef = new ErrorForm(); ef.label2.Text = "Routine is already running!"; ef.Show(); return; } if (label4.Text.Equals("Uploading")) { ErrorForm ef = new ErrorForm(); ef.label2.Text = "Please wait until uploading ends!"; ef.Show(); return; } else { try { getID = int.Parse(TextBox1.Text); if (getID == 0) { ErrorForm ef = new ErrorForm(); ef.label2.Text = "Match ID cannot be 0."; ef.Show(); return; } File.WriteAllText(Core.AppPath + "matchid.txt", TextBox1.Text); } catch (Exception) { ErrorForm ef = new ErrorForm(); ef.label2.Text = "Invalid Match ID."; ef.Show(); return; } DialogResult dr = getdr; if (dr == DialogResult.Cancel) { //we continue } else if (dr == DialogResult.OK) { noGameSelectedToolStripMenuItem.Text = "Scanning game: " + selectedGame; label4.Text = "Scanning"; this.Hide(); this.WindowState = FormWindowState.Minimized; string grabName; grabName = File.ReadAllText(Core.AppPath + "chosengameexec.txt"); if (grabName.Equals("steam://run/730")) { grabName = "csgo.exe"; } else if (grabName.Equals("steam://run/440")) { grabName = "hl2.exe"; } else if (grabName.Equals("steam://run/570")) { grabName = "dota.exe"; } else if (grabName.Equals("Shootmania")) { string read = string.Empty; try { read = File.ReadAllText(Core.AppPath + "chosengamefullexec.txt"); } catch (Exception) { } if (!read.Contains("ManiaPlanet")) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Filter = "maniaplanet.exe|maniaplanet.exe| Exe Files (.exe)|*.exe"; if (ofd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string fullPath = ofd.InitialDirectory + ofd.FileName; string execName = ofd.SafeFileName; File.WriteAllText(Core.AppPath + "chosengamefullexec.txt", fullPath); File.WriteAllText(Core.AppPath + "chosengameexec.txt", execName); } else { label4.Text = "Idle"; this.Show(); this.WindowState = FormWindowState.Normal; this.Activate(); return; } } File.WriteAllText(Core.AppPath + "chosengameexec.txt", "ManiaPlanet.exe"); } if (ProcessManagement.ProcessIsRunning(grabName)) { grabName = grabName.Substring(0, grabName.Length - 4); RuntimeChecker.IsGameRunning(grabName); //kills old process and opens new one with anticheat ProcessManagement.TriggerTaskmanager(true); Thread.Sleep(1000); } bool primaryFail = false; try { RuntimeChecker checker = new RuntimeChecker(ServerType.PrimaryServer, username); checker.OnStopped += new CheckerStoppedEvent(checker_OnStopped); } catch (Exception) { primaryFail = true; } if (primaryFail == true) { this.Show(); this.WindowState = FormWindowState.Normal; ReportForm ef = new ReportForm(); ef.label2.Text = "A error has occurred!"; ef.Show(); checker_OnStopped(); ProcessManagement.TriggerTaskmanager(false); ProcessManagement.TaskManagerIsRunning(); button5.Image = ESA_AC.Properties.Resources.startscan_normal; label4.Text = "Uploading"; try { if (File.Exists(Core.AppPath + "acscreens\\log_" + getID + "_" + selectedGame + "_" + RuntimeChecker.getTimeZip + ".zip")) { using (FileStream fsread = new FileStream(Core.AppPath + "acscreens\\log_" + getID + "_" + selectedGame + "_" + RuntimeChecker.getTimeZip + ".zip", FileMode.Open, FileAccess.Read, FileShare.Read)) { if (File.Exists(Core.AppPath + "acscreens\\log_" + getID + "_" + selectedGame + "_" + RuntimeChecker.getTimeZip + ".zip")) { FileManagement fm = new FileManagement(); fm.postFile(username, selectedGame, getID.ToString(), Core.AppPath + "acscreens\\log_" + getID + "_" + selectedGame + "_" + RuntimeChecker.getTimeZip + ".zip"); fsread.Close(); File.Delete(Core.AppPath + "acscreens\\log_" + getID + "_" + selectedGame + "_" + RuntimeChecker.getTimeZip + ".zip"); } else { File.WriteAllText(Core.AppPath + "acscreens\\warning.txt", "Anticheat zip log has been deleted."); FileManagement fm = new FileManagement(); fm.postFile(username, selectedGame, getID.ToString(), Core.AppPath + "acscreens\\warning.txt"); File.Delete(Core.AppPath + "acscreens\\warning.txt"); } } } else { File.WriteAllText(Core.AppPath + "acscreens\\warning.txt", "Anticheat zip log has been deleted."); FileManagement fm = new FileManagement(); fm.postFile(username, selectedGame, getID.ToString(), Core.AppPath + "acscreens\\warning.txt"); File.Delete(Core.AppPath + "acscreens\\warning.txt"); } } catch (Exception) { ReportForm ef2 = new ReportForm(); ef2.label2.Text = "Upload failed."; ef2.Show(); } ProcessManagement.TriggerTaskmanager(true); noGameSelectedToolStripMenuItem.Text = "No game currently selected"; selectedGame = ""; label4.Text = "Idle"; } } } }