From 4b381f4b1658edb74695da103d7b3ec40b8f5ab6 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Fri, 2 Aug 2013 16:52:08 -0400 Subject: [PATCH] Removed more Steam2 crud. --- DepotDownloader/Util.cs | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/DepotDownloader/Util.cs b/DepotDownloader/Util.cs index b09d3e75..e61ee127 100644 --- a/DepotDownloader/Util.cs +++ b/DepotDownloader/Util.cs @@ -112,40 +112,6 @@ namespace DepotDownloader return neededChunks.ToArray(); } - const int STEAM2_CHUCK_SIZE = 0x8000; - - // Validate a file against Steam2 Checksums - public static bool ValidateSteam2FileChecksums( FileInfo file, int [] checksums ) - { - byte[] chunk = new byte[STEAM2_CHUCK_SIZE]; // checksums are for 32KB at a time - - FileStream fs = file.OpenRead(); - int read, cnt=0; - while ((read = fs.Read(chunk, 0, STEAM2_CHUCK_SIZE)) > 0) - { - byte[] tempchunk; - if (read < STEAM2_CHUCK_SIZE) - { - tempchunk = new byte[read]; - Array.Copy(chunk, 0, tempchunk, 0, read); - } - else - { - tempchunk = chunk; - } - int adler = BitConverter.ToInt32(AdlerHash(tempchunk), 0); - int crc32 = BitConverter.ToInt32(CryptoHelper.CRCHash(tempchunk), 0); - if((adler ^ crc32) != checksums[cnt]) - { - fs.Close(); - return false; - } - ++cnt; - } - fs.Close(); - return (cnt == checksums.Length); - } - public static byte[] AdlerHash(byte[] input) { uint a = 0, b = 0;