示例#1
0
        public void ScanButtonClicked(object sender, EventArgs e)
        {
            Process[] processes = Process.GetProcesses();

            foreach (Process process in processes)
            {
                if (process.ProcessName.Contains("Wreckfest") && !process.ProcessName.Contains("64"))
                {
                    wfstProcess = process;
                }
            }

            if (wfstProcess == null)  //no processes, better stop
            {
                scanDialog.StatusLabel.Text = "32 bit Wreckfest not running!";
                return;
            }

            scanDialog.StatusLabel.Text    = "Please Wait";
            scanDialog.ExecutableText.Text = "Found process " + wfstProcess.ProcessName + ".exe";
            scanDialog.progressBar1.Value  = 0;
            scanDialog.ScanButton.Enabled  = false;

            scan = new RegularMemoryScan(wfstProcess, 0, 2147483647);
            scan.ScanProgressChanged += new RegularMemoryScan.ScanProgressedEventHandler(scan_ScanProgressChanged);
            scan.ScanCompleted       += new RegularMemoryScan.ScanCompletedEventHandler(scan_ScanCompleted);
            scan.ScanCanceled        += new RegularMemoryScan.ScanCanceledEventHandler(scan_ScanCanceled);

            scan.StartScanForString("carRootNode" + scanDialog.playerComboBox.Text);
        }
示例#2
0
        public void ScanButtonClicked(object sender, EventArgs e)
        {
            Process[] processes = Process.GetProcesses();

            foreach (Process process in processes)
            {
                if (process.ProcessName.Contains("DIRT5"))
                {
                    mainProcess = process;
                }
            }

            if (mainProcess == null) //no processes, better stop
            {
                statusLabel.Text = "DIRT5 exe not running!";
                return;
            }



            initializeButton.Enabled = false;
            statusLabel.Text         = "Please Wait";
            progressBar1.Value       = 0;


            RegularMemoryScan scan = new RegularMemoryScan(mainProcess, 0, 34359720776);// 140737488355327); //32gig

            scan.ScanProgressChanged += new RegularMemoryScan.ScanProgressedEventHandler(scan_ScanProgressChanged);
            scan.ScanCompleted       += new RegularMemoryScan.ScanCompletedEventHandler(scan_ScanCompleted);
            scan.ScanCanceled        += new RegularMemoryScan.ScanCanceledEventHandler(scan_ScanCanceled);

            string vehicleString = vehicleSelector.Text;

//            string scanString = "(\0\0\0\0skoda_fabia_r5";
            string scanString = "(\0\0\0\0" + vehicleString;

            scan.StartScanForString(scanString);
        }