Exemplo n.º 1
0
        public bool SetMemoryProtection(ProcessExtensions.MemoryProtection memoryProtection)
        {
            var result = ProcessExtensions.VirtualProtectEx(p, baseAddr, (IntPtr)Size, memoryProtection, out var _mp);

            if (result)
            {
                mp = _mp;
            }
            return(result);
        }
        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.MemoryProtection a = ProcessExtensions.MemoryProtection.ZeroAccess;
            foreach (CheckBox cb in tablePanel.Controls.Cast <CheckBox>().Where(item => item.Checked))
            {
                a = a | (ProcessExtensions.MemoryProtection)Enum.Parse(typeof(ProcessExtensions.MemoryProtection), cb.Text);
            }

            ProcessWatch.ProtectMode = a;
            Params.SetParam("PROTECTIONMODE", ((uint)a).ToString());
            ProcessWatch.UpdateDomains();
        }
Exemplo n.º 3
0
        public static void Start()
        {
            RTCV.Common.Logging.StartLogging(VanguardCore.logPath);
            AutoHookTimer          = new System.Timers.Timer();
            AutoHookTimer.Interval = 5000;
            AutoHookTimer.Elapsed += AutoHookTimer_Elapsed;

            AutoCorruptTimer           = new System.Timers.Timer();
            AutoCorruptTimer.Interval  = 16;
            AutoCorruptTimer.AutoReset = false;
            AutoCorruptTimer.Elapsed  += CorruptTimer_Elapsed;
            AutoCorruptTimer.Start();

            if (VanguardCore.vanguardConnected)
            {
                UpdateDomains();
            }

            //ProcessWatch.currentFileInfo = new ProcessStubFileInfo();

            DisableInterface();
            RtcCore.EmuDirOverride = true; //allows the use of this value before vanguard is connected

            string paramsPath = Path.Combine(ProcessWatch.currentDir, "PARAMS");

            if (!Directory.Exists(paramsPath))
            {
                Directory.CreateDirectory(paramsPath);
            }

            if (!Params.IsParamSet("DISCLAIMERREAD"))
            {
                var disclaimer = $@"Welcome to ProcessStub
Version {ProcessWatch.ProcessStubVersion}

Disclaimer:
This program comes with absolutely ZERO warranty.
You may use it at your own risk.
Be EXTREMELY careful with what you choose to corrupt.
Be aware there is always the chance of damage.

This program inserts random data in hooked processes. There is no way to accurately predict what can happen out of this.
The developers of this software will not be held responsible for any damage caused
as the result of use of this software.

By clicking 'Yes' you agree that you have read this warning in full and are aware of any potential consequences of use of the program. If you do not agree, click 'No' to exit this software.";
                if (MessageBox.Show(disclaimer, "Process Stub", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) != DialogResult.Yes)
                {
                    Environment.Exit(0);
                }

                Params.SetParam("DISCLAIMERREAD");
            }

            var protectionMode = Params.ReadParam("PROTECTIONMODE");

            try
            {
                if (protectionMode != null)
                {
                    ProtectMode = (ProcessExtensions.MemoryProtection)Enum.Parse(typeof(ProcessExtensions.MemoryProtection), protectionMode);
                }
            }
            catch (Exception)
            {
                Params.RemoveParam("PROTECTIONMODE");
                ProtectMode = ProcessExtensions.MemoryProtection.ReadWrite;
            }

            UseExceptionHandler = Params.ReadParam("USEEXCEPTIONHANDLER") == "True";
            UseBlacklist        = Params.ReadParam("USEBLACKLIST") != "False";
            SuspendProcess      = Params.ReadParam("SUSPENDPROCESS") == "True";
            UseFiltering        = Params.ReadParam("USEFILTERING") != "False";
        }