private void pictureBox1_Click(object sender, EventArgs e) { this.Hide(); Home H4 = new Home(); H4.ShowDialog(); this.Close(); }
private void button9_Click(object sender, EventArgs e) { this.Hide(); Home H7 = new Home(); H7.ShowDialog(); this.Close(); }
void run_cmd() { ProcessStartInfo dynamicClient = new ProcessStartInfo(); dynamicClient.FileName = @"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\ImmunityScans\venv\Scripts\pythonw.exe"; //cmd is full path to python.exe dynamicClient.Arguments = @"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\ImmunityScans\dynamic_client.pyw" + " " + fullFileName; //args is path to .py file and any cmd line args dynamicClient.UseShellExecute = false; dynamicClient.RedirectStandardOutput = true; using (Process process = Process.Start(dynamicClient)) { using (StreamReader reader = process.StandardOutput) { string result = reader.ReadToEnd(); Console.Write(result); //ranStatLevel = Convert.ToSingle(result); } } StreamReader f3 = new StreamReader(@"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\common\dynErrorHandle.txt"); string ehD = ""; ehD = f3.ReadLine(); f3.Close(); if (ehD == "0000") { MessageBox.Show("Looks like it needs more Time! Please Try again later.."); Home h = new Home(); this.Hide(); h.ShowDialog(); this.Close(); } else { ProcessStartInfo ranDyn = new ProcessStartInfo(); ranDyn.FileName = @"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\ImmunityScans\venv\Scripts\pythonw.exe"; //cmd is full path to python.exe ranDyn.Arguments = @"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\ImmunityScans\ransomwareDynamic.pyw"; //args is path to .py file and any cmd line args ranDyn.UseShellExecute = false; ranDyn.RedirectStandardOutput = true; using (Process process = Process.Start(ranDyn)) { using (StreamReader reader = process.StandardOutput) { string result = reader.ReadToEnd(); Console.Write(result); //ranDynLevel = Convert.ToSingle(result); } } StreamReader f2 = new StreamReader(@"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\common\ranDynLevel.txt"); string ranD = ""; ranD = f2.ReadLine(); f2.Close(); StreamWriter truncFile = File.CreateText(@"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\common\ranDynLevel.txt"); truncFile.Flush(); truncFile.Close(); StreamWriter truncFile1 = File.CreateText(@"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\ImmunityScans\received_file.json"); truncFile1.Flush(); truncFile1.Close(); if (ranD == "0000") { MessageBox.Show("Something went wrong...try again."); Home H = new Home(); this.Hide(); H.ShowDialog(); this.Close(); } else { ranDynLevel = float.Parse(ranD); Console.WriteLine("ranDynlevel:"); Console.WriteLine(ranD); dynresults(); } } }
void run_cmd() { //@"..\ImmunityScans\venv\Scripts\python.exe" //@"..\Python37\python.exe" //checkUPX(); ProcessStartInfo ranStat = new ProcessStartInfo(); ranStat.FileName = @"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\ImmunityScans\venv\Scripts\pythonw.exe"; //cmd is full path to python.exe ranStat.Arguments = @"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\ImmunityScans\ransomwareStatic.pyw" + " " + fullFileName; //args is path to .py file and any cmd line args ranStat.UseShellExecute = false; ranStat.RedirectStandardOutput = true; using (Process process = Process.Start(ranStat)) { using (StreamReader reader = process.StandardOutput) { string result = reader.ReadToEnd(); Console.Write(result); } } StreamReader f1 = new StreamReader(@"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\common\ranStatLevel.txt"); string ranS = ""; ranS = f1.ReadLine(); f1.Close(); StreamWriter truncFile = File.CreateText(@"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\common\ranStatLevel.txt"); truncFile.Flush(); truncFile.Close(); if (ranS == "0000" || ranS == "5555") { Console.WriteLine("ERROR"); } else if (ranS == "1111") { MessageBox.Show("File not Supported"); this.Hide(); Home H3 = new Home(); H3.ShowDialog(); this.Close(); this.Dispose(); } ranStatLevel = float.Parse(ranS); Console.WriteLine("ranStatLevel:"); Console.WriteLine(ranS); ProcessStartInfo spyStat = new ProcessStartInfo(); spyStat.FileName = @"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\ImmunityScans\venv\Scripts\pythonw.exe"; //cmd is full path to python.exe spyStat.Arguments = @"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\ImmunityScans\spywareStatic.pyw" + " " + fullFileName; //args is path to .py file and any cmd line args spyStat.UseShellExecute = false; spyStat.RedirectStandardOutput = true; using (Process process = Process.Start(spyStat)) { using (StreamReader reader = process.StandardOutput) { string result = reader.ReadToEnd(); Console.Write(result); } } StreamReader f2 = new StreamReader(@"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\common\spyStatLevel.txt"); string spyS = ""; spyS = f2.ReadLine(); f2.Close(); StreamWriter truncFile2 = File.CreateText(@"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\common\spyStatLevel.txt"); truncFile2.Flush(); truncFile2.Close(); if (spyS == "0000" || spyS == "5555") { MessageBox.Show("error from spyware ML"); } if (spyS == "1111") { MessageBox.Show("File not Supported"); this.Hide(); Home H3 = new Home(); H3.ShowDialog(); this.Close(); } spyStatLevel = float.Parse(spyS); Console.WriteLine("spystatlevel:"); Console.WriteLine(spyS); mlresults(); }