Showing
1 changed file
with
11 additions
and
15 deletions
... | @@ -72,7 +72,16 @@ namespace VulnCrawler | ... | @@ -72,7 +72,16 @@ namespace VulnCrawler |
72 | /// <param name="methodName">찾을 메서드 이름</param> | 72 | /// <param name="methodName">찾을 메서드 이름</param> |
73 | /// <returns>함수 문자열</returns> | 73 | /// <returns>함수 문자열</returns> |
74 | protected abstract string GetOriginalFunc(Stream oldStream, string methodName); | 74 | protected abstract string GetOriginalFunc(Stream oldStream, string methodName); |
75 | - public abstract (string originalFunc, string hash) GetPatchResult(Stream oldStream, string methodName); | 75 | + public virtual (string originalFunc, string hash) GetPatchResult(Stream oldStream, string methodName) { |
76 | + // 패치 전 원본 함수 구하고 | ||
77 | + string func = GetOriginalFunc(oldStream, methodName); | ||
78 | + // 주석 제거하고 | ||
79 | + func = RemoveComment(func); | ||
80 | + Console.WriteLine(func); | ||
81 | + // 해쉬하고 | ||
82 | + string md5 = MD5HashFunc(func); | ||
83 | + return (func, md5); | ||
84 | + } | ||
76 | /// <summary> | 85 | /// <summary> |
77 | /// 주석 제거 함수 | 86 | /// 주석 제거 함수 |
78 | /// </summary> | 87 | /// </summary> |
... | @@ -132,10 +141,6 @@ namespace VulnCrawler | ... | @@ -132,10 +141,6 @@ namespace VulnCrawler |
132 | throw new NotImplementedException(); | 141 | throw new NotImplementedException(); |
133 | } | 142 | } |
134 | 143 | ||
135 | - public override (string originalFunc, string hash) GetPatchResult(Stream oldStream, string methodName) { | ||
136 | - throw new NotImplementedException(); | ||
137 | - } | ||
138 | - | ||
139 | public override string RemoveComment(string original) { | 144 | public override string RemoveComment(string original) { |
140 | throw new NotImplementedException(); | 145 | throw new NotImplementedException(); |
141 | } | 146 | } |
... | @@ -215,15 +220,6 @@ namespace VulnCrawler | ... | @@ -215,15 +220,6 @@ namespace VulnCrawler |
215 | return replace; | 220 | return replace; |
216 | } | 221 | } |
217 | 222 | ||
218 | - public override (string originalFunc, string hash) GetPatchResult(Stream stream, string methodName) { | 223 | + |
219 | - // 패치 전 원본 함수 구하고 | ||
220 | - string func = GetOriginalFunc(stream, methodName); | ||
221 | - // 주석 제거하고 | ||
222 | - func = RemoveComment(func); | ||
223 | - Console.WriteLine(func); | ||
224 | - // 해쉬하고 | ||
225 | - string md5 = MD5HashFunc(func); | ||
226 | - return (func, md5); | ||
227 | - } | ||
228 | } | 224 | } |
229 | } | 225 | } | ... | ... |
-
Please register or login to post a comment