Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Tales of Zestiria Checksum
- * Reversed by Vulnavia
- * Implemented by kill_seth
- * Checksum stored at 0x514
- * Checksum covers 0x6D8 -> Size(0x9BA00)
- */
- public class SHA1_TOZ
- {
- public static byte[] Compute(byte[] data)
- {
- string key = "TO12";
- string[] keys = { "SRA", "ROS", "MIC", "LAI", "EDN", "DEZ", "ZAB", "ALI" };
- byte[] hash = Compute(data, Encoding.ASCII.GetBytes(key));
- int x = 0;
- for (int i = 0; i < 100; i++)
- {
- hash = Compute(hash, Encoding.ASCII.GetBytes(keys[x++]));
- if (x > 7) x = 0;
- }
- return hash;
- }
- private static byte[] Compute(byte[] data, byte[] key)
- {
- SHA1CryptoServiceProvider sha = new SHA1CryptoServiceProvider();
- sha.TransformBlock(data, 0, data.Length, data, 0);
- sha.TransformFinalBlock(key, 0, key.Length);
- return sha.Hash;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment