bool CompareMD5(string path, string MD5Hash) {
if (BitConverter.ToString(MD5.Create().ComputeHash(File.ReadAllBytes(path))).Replace("-", "") == MD5Hash)//IS will pick up on the references
return true;
return false;
}
if (!CompareMD5(Environment.CurrentDirectory + "\\File Here.dll", "MD5HASH HERE"))
Application.Exit();
string CalculateMD5(string path) {
return BitConverter.ToString(MD5.Create().ComputeHash(File.ReadAllBytes(path))).Replace("-", "");
}
bool CompareMD5(string path, string MD5Hash) {
if (BitConverter.ToString(MD5.Create().ComputeHash(File.ReadAllBytes(path))).Replace("-", "") == MD5Hash)//IS will pick up on the references
return true;
return false;
}
if (!CompareMD5(Environment.CurrentDirectory + "\\File Here.dll", "MD5HASH HERE"))
Application.Exit();
string CalculateMD5(string path) {
return BitConverter.ToString(MD5.Create().ComputeHash(File.ReadAllBytes(path))).Replace("-", "");
}
bool CompareMD5(string path, string MD5Hash) {
if (BitConverter.ToString(MD5.Create().ComputeHash(File.ReadAllBytes(path))).Replace("-", "") == MD5Hash)//IS will pick up on the references
return true;
return false;
}
if (!CompareMD5(Environment.CurrentDirectory + "\\File Here.dll", "MD5HASH HERE"))
Application.Exit();
string CalculateMD5(string path) {
return BitConverter.ToString(MD5.Create().ComputeHash(File.ReadAllBytes(path))).Replace("-", "");
}
4.2:
PS3Lib.dll: FA1CCFC1DBDAF7A802F1D34B700D40AD
CCAPI.dll: 354B2756F5A2A377296EFFF0353059B1
4.3:
PS3Lib.dll: 7BE3DB9B7608CB05CCF56C5C606EBD60
4.4:
PS3Lib.dll: F0E04EFE7B2AA47711535915E2B1A1AB
// cleaner version of your code
public string CalculateMD5(string path)
{
return BitConverter.ToString(MD5.Create().ComputeHash(File.ReadAllBytes(path))).Replace("-", "");
}
public bool CompareMD5(string path, string MD5Hash)
{
return CalculateMD5(path) == MD5Hash;
}
// more practical code
public byte[] calc_md5hash(byte[] data){
return MD5.Create().ComputeHash(data);
}
public bool compare_md5hash(byte[] data, byte[] hash) {
return calc_md5hash(data).SequenceEqual(hash);
}
Copyright © 2024, NextGenUpdate.
All Rights Reserved.