Esempio n. 1
0
        public object ScanHS(string filename)
        {
            FileInfo fi = new FileInfo(filename);

            try
            {
                if (fi.Length < MaximumSize)
                {
                    using (KCompress.KCompressExtractor extr = new KCompressExtractor(filename))
                    {
                        extr.ExtractArchive(AVEngine.TempDir + Path.GetFileNameWithoutExtension(filename) + @"\");
                    }

                    object svir = null;
                    foreach (string file in FileHelper.GetFilesRecursive(AVEngine.TempDir + Path.GetFileNameWithoutExtension(filename) + @"\"))
                    {
                        if (file.EndsWith(".text"))
                        {
                            svir = VDB.GetPEMD5(Security.GetMD5HashFromFile(file));
                            if (svir != null)
                            {
                                return(svir);
                            }
                        }
                        else if (file.EndsWith(".data"))
                        {
                            svir = VDB.GetPEMD5(Security.GetMD5HashFromFile(file));
                            if (svir != null)
                            {
                                return(svir);
                            }
                        }
                        else if (file.EndsWith(".idata"))
                        {
                            svir = VDB.GetPEMD5(Security.GetMD5HashFromFile(file));
                            if (svir != null)
                            {
                                return(svir);
                            }
                        }
                        File.Delete(file);
                    }
                    svir = VDB.GetMD5(Security.GetMD5HashFromFile(filename));
                    if (svir != null)
                    {
                        return(svir);
                    }
                }
                else
                {
                    return(null);
                }
            }
            catch
            {
                return(null);
            }
            finally
            {
            }
            return(null);
        }