Program.cs
1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using VulnCrawler;
namespace VulnUserCodeAnalyzer
{
class Program
{
static void Main(string[] args)
{
DirectoryInfo dirInfo = new DirectoryInfo(@"c:\code");
var codeFiles = dirInfo.EnumerateFiles("*.c", SearchOption.AllDirectories);
var crawler = new VulnC();
foreach (var codeFile in codeFiles)
{
Console.WriteLine(codeFile.FullName);
using (var reader = codeFile.OpenText())
{
var dict = crawler.CrawlUserCode(reader);
foreach (var item in dict)
{
Console.WriteLine($"----{item.Key}->");
foreach (var hash in item.Value)
{
Console.WriteLine(hash);
}
}
}
}
}
}
}