Exemple #1
0
 private void ClassifyArchive(FileInfo fileInfo)
 {
     // look inside archives for files we like.
     try
     {
         IArchive archive = ArchiveFactory.Open(fileInfo.FullName);
         foreach (IArchiveEntry entry in archive.Entries)
         {
             if (!entry.IsDirectory)
             {
                 try
                 {
                     FileScanner.ScanFile(entry.Key);
                 }
                 catch (Exception e)
                 {
                     Mq.Trace(e.ToString());
                 }
             }
         }
     }
     catch (CryptographicException)
     {
         Mq.FileResult(new FileResult(fileInfo)
         {
             MatchedRule = new ClassifierRule()
             {
                 Triage = Triage.Black, RuleName = "EncryptedArchive"
             }
         });
     }
     catch (Exception e)
     {
         Mq.Trace(e.ToString());
     }
 }