노현종

CVE metadata 크롤링 모듈 완성

...@@ -891,15 +891,10 @@ namespace VulnCrawler ...@@ -891,15 +891,10 @@ namespace VulnCrawler
891 var regex2 = new Regex(stringPattern, RegexOptions.Compiled); 891 var regex2 = new Regex(stringPattern, RegexOptions.Compiled);
892 var regex3 = new Regex(commentPattern2, RegexOptions.Compiled); 892 var regex3 = new Regex(commentPattern2, RegexOptions.Compiled);
893 var regex4 = new Regex(commentPattern, RegexOptions.Compiled); 893 var regex4 = new Regex(commentPattern, RegexOptions.Compiled);
894 -
895 bool found3 = false; 894 bool found3 = false;
896 -
897 bool com = false; 895 bool com = false;
898 -
899 -
900 while (!reader.EndOfStream) 896 while (!reader.EndOfStream)
901 { 897 {
902 -
903 string line = reader.ReadLine(); 898 string line = reader.ReadLine();
904 string trim = line.Trim(); 899 string trim = line.Trim();
905 if (commentLine) 900 if (commentLine)
...@@ -915,7 +910,6 @@ namespace VulnCrawler ...@@ -915,7 +910,6 @@ namespace VulnCrawler
915 continue; 910 continue;
916 } 911 }
917 } 912 }
918 -
919 // /* ~ 패턴 913 // /* ~ 패턴
920 if (regex3.IsMatch(trim)) 914 if (regex3.IsMatch(trim))
921 { 915 {
...@@ -941,20 +935,18 @@ namespace VulnCrawler ...@@ -941,20 +935,18 @@ namespace VulnCrawler
941 if (found3) 935 if (found3)
942 { 936 {
943 string obStr = oldBuilder.ToString(); 937 string obStr = oldBuilder.ToString();
944 - Console.WriteLine(obStr); 938 + //Console.WriteLine(obStr);
945 -
946 obStr = Abstract(obStr, new Dictionary<string, string>(), new Dictionary<string, string>()); 939 obStr = Abstract(obStr, new Dictionary<string, string>(), new Dictionary<string, string>());
947 byte[] obStrBytes = Encoding.Unicode.GetBytes(obStr); 940 byte[] obStrBytes = Encoding.Unicode.GetBytes(obStr);
948 string absObStrBase64 = Convert.ToBase64String(obStrBytes); 941 string absObStrBase64 = Convert.ToBase64String(obStrBytes);
949 - 942 + // Console.WriteLine(obStr);
950 - Console.WriteLine(obStr); 943 + //Console.WriteLine("HASH: " + MD5HashFunc(obStr));
944 + //Console.WriteLine(absObStrBase64);
951 if (!dict.ContainsKey(absObStrBase64.Length)) 945 if (!dict.ContainsKey(absObStrBase64.Length))
952 { 946 {
953 dict[absObStrBase64.Length] = new HashSet<UserBlock>(); 947 dict[absObStrBase64.Length] = new HashSet<UserBlock>();
954 } 948 }
955 -
956 string funcName = new string(oldBuilder.ToString().TakeWhile(c => c != '{').ToArray()); 949 string funcName = new string(oldBuilder.ToString().TakeWhile(c => c != '{').ToArray());
957 -
958 (dict[absObStrBase64.Length] as HashSet<UserBlock>).Add(new UserBlock 950 (dict[absObStrBase64.Length] as HashSet<UserBlock>).Add(new UserBlock
959 { 951 {
960 Hash = MD5HashFunc(absObStrBase64), 952 Hash = MD5HashFunc(absObStrBase64),
...@@ -1090,11 +1082,11 @@ namespace VulnCrawler ...@@ -1090,11 +1082,11 @@ namespace VulnCrawler
1090 if (found3) 1082 if (found3)
1091 { 1083 {
1092 string obStr = oldBuilder.ToString(); 1084 string obStr = oldBuilder.ToString();
1093 - Console.WriteLine(obStr); 1085 + // Console.WriteLine(obStr);
1094 obStr = Abstract(obStr, new Dictionary<string, string>(), new Dictionary<string, string>()); 1086 obStr = Abstract(obStr, new Dictionary<string, string>(), new Dictionary<string, string>());
1095 byte[] obStrBytes = Encoding.Unicode.GetBytes(obStr); 1087 byte[] obStrBytes = Encoding.Unicode.GetBytes(obStr);
1096 string absObStrBase64 = Convert.ToBase64String(obStrBytes); 1088 string absObStrBase64 = Convert.ToBase64String(obStrBytes);
1097 - Console.WriteLine(obStr); 1089 + // Console.WriteLine(obStr);
1098 if (!dict.ContainsKey(absObStrBase64.Length)) 1090 if (!dict.ContainsKey(absObStrBase64.Length))
1099 { 1091 {
1100 dict[absObStrBase64.Length] = new HashSet<UserBlock>(); 1092 dict[absObStrBase64.Length] = new HashSet<UserBlock>();
......
This diff could not be displayed because it is too large.