|
|
|
@ -12,8 +12,8 @@ namespace apphost_extract_v2
|
|
|
|
|
public static class FileChecker
|
|
|
|
|
{
|
|
|
|
|
private const string HASHFILE = "apphost-hashes.txt";
|
|
|
|
|
private static SHA256Managed sha = new SHA256Managed();
|
|
|
|
|
private static string[] Hashes;
|
|
|
|
|
private static SHA256Managed sha = new SHA256Managed();
|
|
|
|
|
|
|
|
|
|
public static void Load()
|
|
|
|
|
{
|
|
|
|
@ -30,7 +30,11 @@ namespace apphost_extract_v2
|
|
|
|
|
|
|
|
|
|
public static bool IsKnownFile(byte[] buffer)
|
|
|
|
|
{
|
|
|
|
|
var hash = BitConverter.ToString(sha.ComputeHash(buffer)).Replace("-", "");
|
|
|
|
|
string hash = "";
|
|
|
|
|
lock (sha)
|
|
|
|
|
{
|
|
|
|
|
hash = BitConverter.ToString(sha.ComputeHash(buffer)).Replace("-", "");
|
|
|
|
|
}
|
|
|
|
|
return Hashes.Contains(hash) || SignedByMS(buffer);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|