示例#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);
        }
示例#2
0
 public static void Initialize()
 {
     detected = new Dictionary <string, string>();
     VT.Init();
 }