public void it_should_scan_files()
        {
            var results = QuickScan.File(testPath, rulesPath);

            Assert.AreEqual(1, results.Count);
            Assert.AreEqual(1, results[0].Matches.Count);
            Assert.AreEqual(2, results[0].Matches["$hw"].Count);
            Assert.AreEqual(0x1eUL, results[0].Matches["$hw"][0].Offset);
        }
        public static string ScanFile(string filePath, string rulesPath)
        {
            string result = null;

            try
            {
                List <ScanResult> scanResults = QuickScan.File(filePath, rulesPath);
                result = FormatResults(scanResults);
            }
            catch
            { }

            return(result);
        }
Exemple #3
0
        public static List <string> ScanFile(string filePath, string rulesPath)
        {
            List <string> result = new List <string>();

            try
            {
                List <ScanResult> scanResults = QuickScan.File(filePath, rulesPath);
                if (scanResults.Any())
                {
                    result = scanResults.Select(res => res.MatchingRule.Identifier).ToList();
                }
            }
            catch
            {
            }

            return(result);
        }