public static bool CheckXEXChecksum(byte[] xexchecksum) { byte[] numArray = File.ReadAllBytes(XEXHelper.ReadConfString("LatestXEXName")); SHA1 sHA1 = SHA1.Create(); sHA1.Initialize(); sHA1.TransformFinalBlock(numArray, 0, (int)numArray.Length); return(sHA1.Hash.SequenceEqual <byte>(xexchecksum)); }
private static void WriteConfInt(string entry, int value) { XEXHelper.WriteConfString(entry, value.ToString()); }
public static void UpdateXEX(byte xexversion, string xexname) { XEXHelper.WriteConfInt("LatestXEXVersion", (int)xexversion); XEXHelper.WriteConfString("LatestXEXName", xexname); }
private static int ReadConfInt(string entry) { return(int.Parse(XEXHelper.ReadConfString(entry))); }
public static int GetXEXVersion() { return(XEXHelper.ReadConfInt("LatestXEXVersion")); }
public static string GetXEXName() { return(XEXHelper.ReadConfString("LatestXEXName")); }
public static bool CheckXEXVersion(byte xexversion) { return(xexversion >= (byte)XEXHelper.ReadConfInt("LatestXEXVersion")); }