public void upxresults() { StreamReader ofileread = new StreamReader(@"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\upx\upxresults.txt"); string upx = ""; while (!ofileread.EndOfStream) { upx = ofileread.ReadLine(); } Console.WriteLine("upx result1: " + upx); ofileread.Close(); StreamWriter truncFile = File.CreateText(@"C:\Users\niluf\Desktop\Immunity\ImmunityApp\ImmunityFormApp1\bin\upx\upxresults.txt"); truncFile.Flush(); truncFile.Close(); if (upx == "Tested 1 file.") { flag2 = 1; RunningDynamic D1 = new RunningDynamic(); D1.getLabel5text(fileName, fullFileName); this.Hide(); D1.ShowDialog(); this.Close(); } }
// ML RESULTS-------------------------------------------------------------------------- public void mlresults() { if (ranStatLevel < 30.0 && spyStatLevel < 45) // is benign { Safe_file F1 = new Safe_file(); F1.getLabel5text(fileName, fullFileName); this.Hide(); F1.ShowDialog(); this.Close(); recordStatScanSafe(fileName, fullFileName); goto finish; } if (ranStatLevel >= 60.0) // is a ransomware { ThreadStart threadStart10 = new ThreadStart(quarantineFile); Thread thread10 = new Thread(threadStart10); thread10.SetApartmentState(ApartmentState.STA); thread10.Start(); Malware_detected M1 = new Malware_detected(); M1.getLabel5text(fileName, fullFileName); M1.enablePictureBox6(); this.Hide(); M1.ShowDialog(); this.Close(); recordStatScanMalware(fileName, fullFileName, 1); //ransomare is type "1" goto finish; } if (spyStatLevel >= 80.0) // is a spyware { ThreadStart threadStart11 = new ThreadStart(quarantineFile); Thread thread11 = new Thread(threadStart11); thread11.SetApartmentState(ApartmentState.STA); thread11.Start(); Malware_detected M2 = new Malware_detected(); M2.getLabel5text(fileName, fullFileName); M2.enablePictureBox7(); this.Hide(); M2.ShowDialog(); this.Close(); recordStatScanMalware(fileName, fullFileName, 2); //spyware is type "2" goto finish; } if (ranStatLevel >= 30.0 && ranStatLevel < 60.0 || spyStatLevel >= 45.0 && spyStatLevel < 80.0) // run dynamic for both { RunningDynamic D1 = new RunningDynamic(); D1.getLabel5text(fileName, fullFileName); this.Hide(); D1.ShowDialog(); this.Close(); goto finish; } finish :; }