Showing
1 changed file
with
15 additions
and
14 deletions
... | @@ -712,18 +712,20 @@ namespace VulnCrawler | ... | @@ -712,18 +712,20 @@ namespace VulnCrawler |
712 | { | 712 | { |
713 | string obStr = oldBuilder.ToString(); | 713 | string obStr = oldBuilder.ToString(); |
714 | obStr = Abstract(obStr, new Dictionary<string, string>(), new Dictionary<string, string>()); | 714 | obStr = Abstract(obStr, new Dictionary<string, string>(), new Dictionary<string, string>()); |
715 | - if (!dict.ContainsKey(obStr.Length)) | 715 | + byte[] obStrBytes = Encoding.Unicode.GetBytes(obStr); |
716 | + string absObStrBase64 = Convert.ToBase64String(obStrBytes); | ||
717 | + | ||
718 | + if (!dict.ContainsKey(absObStrBase64.Length)) | ||
716 | { | 719 | { |
717 | - dict[obStr.Length] = new HashSet<UserBlock>(); | 720 | + dict[absObStrBase64.Length] = new HashSet<UserBlock>(); |
718 | } | 721 | } |
719 | - byte[] obStrBytes = Encoding.Unicode.GetBytes(obStr); | ||
720 | 722 | ||
721 | string funcName = new string(oldBuilder.ToString().TakeWhile(c => c != '{').ToArray()); | 723 | string funcName = new string(oldBuilder.ToString().TakeWhile(c => c != '{').ToArray()); |
722 | 724 | ||
723 | - (dict[obStr.Length] as HashSet<UserBlock>).Add(new UserBlock | 725 | + (dict[absObStrBase64.Length] as HashSet<UserBlock>).Add(new UserBlock |
724 | { | 726 | { |
725 | - Hash = MD5HashFunc(Convert.ToBase64String(obStrBytes)), | 727 | + Hash = MD5HashFunc(absObStrBase64), |
726 | - Len = obStr.Length, | 728 | + Len = absObStrBase64.Length, |
727 | FuncName = funcName, | 729 | FuncName = funcName, |
728 | }); | 730 | }); |
729 | oldBuilder.Clear(); | 731 | oldBuilder.Clear(); |
... | @@ -856,23 +858,22 @@ namespace VulnCrawler | ... | @@ -856,23 +858,22 @@ namespace VulnCrawler |
856 | { | 858 | { |
857 | string obStr = oldBuilder.ToString(); | 859 | string obStr = oldBuilder.ToString(); |
858 | obStr = Abstract(obStr, new Dictionary<string, string>(), new Dictionary<string, string>()); | 860 | obStr = Abstract(obStr, new Dictionary<string, string>(), new Dictionary<string, string>()); |
861 | + byte[] obStrBytes = Encoding.Unicode.GetBytes(obStr); | ||
862 | + string absObStrBase64 = Convert.ToBase64String(obStrBytes); | ||
859 | 863 | ||
860 | - if (!dict.ContainsKey(obStr.Length)) | 864 | + if (!dict.ContainsKey(absObStrBase64.Length)) |
861 | { | 865 | { |
862 | - dict[obStr.Length] = new HashSet<UserBlock>(); | 866 | + dict[absObStrBase64.Length] = new HashSet<UserBlock>(); |
863 | } | 867 | } |
864 | - byte[] obStrBytes = Encoding.Unicode.GetBytes(obStr); | ||
865 | 868 | ||
866 | string funcName = new string(oldBuilder.ToString().TakeWhile(c => c != '{').ToArray()); | 869 | string funcName = new string(oldBuilder.ToString().TakeWhile(c => c != '{').ToArray()); |
867 | 870 | ||
868 | 871 | ||
869 | - (dict[obStr.Length] as HashSet<UserBlock>).Add(new UserBlock | 872 | + (dict[absObStrBase64.Length] as HashSet<UserBlock>).Add(new UserBlock |
870 | { | 873 | { |
871 | - Hash = MD5HashFunc(Convert.ToBase64String(obStrBytes)), | 874 | + Hash = MD5HashFunc(absObStrBase64), |
872 | - Len = obStr.Length, | 875 | + Len = absObStrBase64.Length, |
873 | FuncName = funcName, | 876 | FuncName = funcName, |
874 | - | ||
875 | - | ||
876 | }); | 877 | }); |
877 | oldBuilder.Clear(); | 878 | oldBuilder.Clear(); |
878 | found = false; | 879 | found = false; | ... | ... |
-
Please register or login to post a comment