1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Merge pull request #289 from McSpazzy/bcsv-hash

Hash support for BCSV headers
This commit is contained in:
KillzXGaming 2020-10-02 18:05:35 -04:00 committed by GitHub
commit 604f7b3d36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 38793 additions and 38991 deletions

View File

@ -1,9 +1,12 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Toolbox.Library;
using Toolbox.Library.IO;
using Toolbox.Library.Security.Cryptography;
namespace FirstPlugin
{
@ -27,8 +30,8 @@ namespace FirstPlugin
{
get
{
// if (hashes.Count == 0)
//CalculateHashes();
if (hashes.Count == 0)
CalculateHashes();
return hashes;
}
}
@ -137,7 +140,27 @@ namespace FirstPlugin
private static void CalculateHashes()
{
string dir = Path.Combine(Runtime.ExecutableDir, "Hashes");
if (!Directory.Exists(dir))
return;
foreach (var file in Directory.GetFiles(dir))
{
if (Utils.GetExtension(file) != ".txt")
continue;
foreach (string hashStr in File.ReadAllLines(file))
{
CheckHash(hashStr);
}
}
}
private static void CheckHash(string hashStr)
{
uint hash = Crc32.Compute(hashStr);
if (!hashes.ContainsKey(hash))
hashes.Add(hash, hashStr);
}
}
}

File diff suppressed because one or more lines are too long

2917
Toolbox/Hashes/ACNHBYML.txt Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

34335
Toolbox/Hashes/ACNHValues.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -397,7 +397,13 @@
<Content Include="Gl_EditorFramework.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Hashes\ACNH.txt">
<Content Include="Hashes\ACNHBYML.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Hashes\ACNHHeaders.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Hashes\ACNHValues.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Lib\aamp_hashed_names.txt">