S
Skidz Tweak
Hi all...
This is a weird one.. Top points to anyone that gets it...
I have a function that hashes a file (Byte[]) I just opened... I
already know what the hash should be, because I stored that info
before I saved the file... But when I run a function to check if they
match.. sometimes they don't... but.. if I break in... and rehash in
the immediate window.. they match correctly...
This is the function that check the file I just opened.. to see if the
hash matches...
Parameter info:
string hashCode is what the hash code should be...
byte[] results is the file I just loaded (yes the stream is closed by
the time I reach here)
public void FileCheck(string hashCode, Byte[] results)
{
string hashCheck =
Convert.ToBase64String(SHA256HashGenerator.ComputeHash(results)) +
results.Length;
if (hashCode != hashCheck)
MainConsole.Instance.Error("[AssetDataPlugin]:
Resulting files didn't match hash."); // <<<<< THIS IS WHERE I BREAK
IN
else if (waserror)
MainConsole.Instance.Error("[AssetDataPlugin]: Asset
does match... ");
}
you can see commented above in the function.. where I break in.. (it
says "THIS IS WHERE I BREAK IN") then I do the following in the
immediate window..
? hashCheck
"1VGnTd7l7tzZJD2vROE8ORxX+h8IltoZ6nHqBEDKRz0=23338"
? hashCode
"VPeLSIp0TJZlqRAgfr75SJo2HA01QA6vgkClEqMxNOQ=23338"
? Convert.ToBase64String(SHA256HashGenerator.ComputeHash(results)) +
results.Length;
"VPeLSIp0TJZlqRAgfr75SJo2HA01QA6vgkClEqMxNOQ=23338"
So.. the 1 thousand point question... why is hashCheck different? it
should be the same.. right???
This is a weird one.. Top points to anyone that gets it...
I have a function that hashes a file (Byte[]) I just opened... I
already know what the hash should be, because I stored that info
before I saved the file... But when I run a function to check if they
match.. sometimes they don't... but.. if I break in... and rehash in
the immediate window.. they match correctly...
This is the function that check the file I just opened.. to see if the
hash matches...
Parameter info:
string hashCode is what the hash code should be...
byte[] results is the file I just loaded (yes the stream is closed by
the time I reach here)
public void FileCheck(string hashCode, Byte[] results)
{
string hashCheck =
Convert.ToBase64String(SHA256HashGenerator.ComputeHash(results)) +
results.Length;
if (hashCode != hashCheck)
MainConsole.Instance.Error("[AssetDataPlugin]:
Resulting files didn't match hash."); // <<<<< THIS IS WHERE I BREAK
IN
else if (waserror)
MainConsole.Instance.Error("[AssetDataPlugin]: Asset
does match... ");
}
you can see commented above in the function.. where I break in.. (it
says "THIS IS WHERE I BREAK IN") then I do the following in the
immediate window..
? hashCheck
"1VGnTd7l7tzZJD2vROE8ORxX+h8IltoZ6nHqBEDKRz0=23338"
? hashCode
"VPeLSIp0TJZlqRAgfr75SJo2HA01QA6vgkClEqMxNOQ=23338"
? Convert.ToBase64String(SHA256HashGenerator.ComputeHash(results)) +
results.Length;
"VPeLSIp0TJZlqRAgfr75SJo2HA01QA6vgkClEqMxNOQ=23338"
So.. the 1 thousand point question... why is hashCheck different? it
should be the same.. right???