Esempio n. 1
0
        static string CheckVRPS(string filename)
        {
            string result = "safe";

            try
            {
                if (SettingsManager.VRPS)
                {
                    if (FileFormat.GetVRPS(Path.GetExtension(filename)) != "false")
                    {
                        // only VT
                        if (FileFormat.GetVRPS(Path.GetExtension(filename)) == "1")
                        {
                            string vn       = null;
                            bool   ssresult = VT.Check(Security.GetMD5HashFromFile(filename), out vn);
                            if (ssresult)
                            {
                                Alert.InfectedByMany(vn, filename);
                                result = vn;
                            }
                        }
                        else if (FileFormat.GetVRPS(Path.GetExtension(filename)) == "2")
                        {
                            string vn       = null;
                            bool   ssresult = VT.Check(Security.GetMD5HashFromFile(filename), out vn);
                            if (ssresult)
                            {
                                Alert.InfectedByMany(vn, filename);
                                result = vn;
                            }
                            else
                            {
                                string infec     = null;
                                bool   sysresult = ThreadExpert.Check(Security.GetMD5HashFromFile(filename), out infec);
                                if (sysresult)
                                {
                                    if (Regex.Match(infec, @"[A-Z]", RegexOptions.IgnoreCase).Success)
                                    {
                                        result = infec;
                                        Alert.InfectedByMany(infec, filename);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                AntiCrash.LogException(ex);
            }
            finally
            {
            }
            return(result);
        }
Esempio n. 2
0
 internal static void CheckVRPS(string filename)
 {
     try
     {
         if (SettingsManager.VRPS)
         {
             if (FileFormat.GetVRPS(Path.GetExtension(filename)) != "false")
             {
                 // only VT
                 if (FileFormat.GetVRPS(Path.GetExtension(filename)) == "1")
                 {
                     string vn       = null;
                     bool   ssresult = VT.Check(Security.GetMD5HashFromFile(filename), out vn);
                     if (ssresult)
                     {
                         Alert.InfectedByMany(vn, filename);
                     }
                 }
                 else if (FileFormat.GetVRPS(Path.GetExtension(filename)) == "2")
                 {
                     string vn       = null;
                     bool   ssresult = VT.Check(Security.GetMD5HashFromFile(filename), out vn);
                     if (ssresult)
                     {
                         Alert.InfectedByMany(vn, filename);
                     }
                     else
                     {
                         string infec     = null;
                         bool   sysresult = ThreadExpert.Check(Security.GetMD5HashFromFile(filename), out infec);
                         if (sysresult)
                         {
                             if (infec != "ThreatExpert Submission Report")
                             {
                                 if (Regex.Match(infec, @"[A-Z]", RegexOptions.IgnoreCase).Success)
                                 {
                                     Alert.InfectedByMany(infec, filename);
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     catch
     {
     }
     finally
     {
     }
 }
Esempio n. 3
0
 internal static bool CheckReputation(string filename)
 {
     try
     {
         if (FileFormat.GetVRPS(Path.GetExtension(filename)) != "false")
         {
             // only VT
             if (FileFormat.GetVRPS(Path.GetExtension(filename)) == "1")
             {
                 string vn       = null;
                 bool   ssresult = VT.Check(Security.GetMD5HashFromFile(filename), out vn);
                 if (ssresult)
                 {
                     return(true);
                 }
             }
             else if (FileFormat.GetVRPS(Path.GetExtension(filename)) == "2")
             {
                 string vn       = null;
                 bool   ssresult = VT.Check(Security.GetMD5HashFromFile(filename), out vn);
                 if (ssresult)
                 {
                     return(true);
                 }
                 else
                 {
                     string infec     = null;
                     bool   sysresult = ThreadExpert.Check(Security.GetMD5HashFromFile(filename), out infec);
                     if (sysresult)
                     {
                         if (infec != "ThreatExpert Submission Report")
                         {
                             if (Regex.Match(infec, @"[A-Z]", RegexOptions.IgnoreCase).Success)
                             {
                                 return(true);
                             }
                         }
                     }
                 }
             }
         }
         return(false);
     }
     catch
     {
     }
     finally
     {
     }
     return(false);
 }