private void BtnRefreshDomains_Click(object sender, EventArgs e)
 {
     if (VanguardCore.vanguardConnected)
     {
         ProcessWatch.UpdateDomains();
     }
 }
        private void BtnTargetSettings_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                Control c      = (Control)sender;
                Point   locate = new Point(c.Location.X + e.Location.X, ((Control)sender).Location.Y + e.Location.Y);

                ContextMenuStrip columnsMenu = new ContextMenuStrip();

                ((ToolStripMenuItem)columnsMenu.Items.Add("Use AutoHook", null, (ob, ev) =>
                {
                    ProcessWatch.AutoHookTimer.Enabled = !ProcessWatch.AutoHookTimer.Enabled;
                    tbAutoAttach.Enabled = ProcessWatch.AutoHookTimer.Enabled;
                })).Checked = ProcessWatch.AutoHookTimer.Enabled;

                ((ToolStripMenuItem)columnsMenu.Items.Add("Use Filtering", null, (ob, ev) =>
                {
                    ProcessWatch.UseFiltering = !ProcessWatch.UseFiltering;
                    Params.SetParam("USEFILTERING", ProcessWatch.UseFiltering.ToString());

                    if (VanguardCore.vanguardConnected)
                    {
                        ProcessWatch.UpdateDomains();
                    }
                })).Checked = ProcessWatch.UseFiltering;

                /*
                 * ((ToolStripMenuItem)columnsMenu.Items.Add("Use Exception Handler Override", null, (ob, ev) =>
                 * {
                 *
                 *  ProcessWatch.UseExceptionHandler = !ProcessWatch.UseExceptionHandler;
                 *  Params.SetParam("USEEXCEPTIONHANDLER", ProcessWatch.UseExceptionHandler.ToString());
                 *
                 *
                 * })).Checked = ProcessWatch.UseExceptionHandler;
                 */
                ((ToolStripMenuItem)columnsMenu.Items.Add("Use Blacklist", null, (ob, ev) =>
                {
                    ProcessWatch.UseBlacklist = !ProcessWatch.UseBlacklist;
                    Params.SetParam("USEBLACKLIST", ProcessWatch.UseBlacklist.ToString());
                })).Checked = ProcessWatch.UseBlacklist;
                ((ToolStripMenuItem)columnsMenu.Items.Add("Suspend Process on Corrupt", null, (ob, ev) =>
                {
                    ProcessWatch.SuspendProcess = !ProcessWatch.SuspendProcess;
                    Params.SetParam("SUSPENDPROCESS", ProcessWatch.SuspendProcess.ToString());
                })).Checked = ProcessWatch.SuspendProcess;

                columnsMenu.Items.Add(new ToolStripSeparator());
                columnsMenu.Items.Add("Select Memory Protection Modes to Corrupt", null, (ob, ev) =>
                {
                    S.GET <MemoryProtectionSelector>().ShowDialog();
                });

                columnsMenu.Show(this, locate);
            }
        }
Beispiel #3
0
        private void MemoryProtectionSelector_Closing(object sender, FormClosingEventArgs e)
        {
            if (!tablePanel.Controls.Cast <CheckBox>().Any(item => item.Checked))
            {
                e.Cancel = true;
                MessageBox.Show("Select at least one type of memory protection");
                return;
            }

            ProcessExtensions.MemProtection a = ProcessExtensions.MemProtection.Memory_ZeroAccess;
            foreach (CheckBox cb in tablePanel.Controls.Cast <CheckBox>().Where(item => item.Checked))
            {
                a = a | (ProcessExtensions.MemProtection)Enum.Parse(typeof(ProcessExtensions.MemProtection), cb.Text);
            }

            ProcessWatch.ProtectMode = a;
            Params.SetParam("PROTECTIONMODE", ((uint)a).ToString());
            ProcessWatch.UpdateDomains();
        }