From 066177e9445da41abe4b3f8ac255503fedbbdc29 Mon Sep 17 00:00:00 2001 From: Ryan Stecker Date: Sun, 27 Jan 2013 14:22:28 -0600 Subject: [PATCH] DepotDownloader: Correct build issue. --- DepotDownloader/ContentDownloader.cs | 2 +- DepotDownloader/Util.cs | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/DepotDownloader/ContentDownloader.cs b/DepotDownloader/ContentDownloader.cs index 37bbdaab..59004e7c 100644 --- a/DepotDownloader/ContentDownloader.cs +++ b/DepotDownloader/ContentDownloader.cs @@ -383,7 +383,7 @@ namespace DepotDownloader Config.BetaPassword = password = Console.ReadLine(); } - byte[] input = Utils.DecodeHexString(node_encrypted["encrypted_gid"].Value); + byte[] input = Util.DecodeHexString(node_encrypted["encrypted_gid"].Value); byte[] manifest_bytes = CryptoHelper.VerifyAndDecryptPassword(input, password); if (manifest_bytes == null) diff --git a/DepotDownloader/Util.cs b/DepotDownloader/Util.cs index 8e3d0710..b09d3e75 100644 --- a/DepotDownloader/Util.cs +++ b/DepotDownloader/Util.cs @@ -167,5 +167,19 @@ namespace DepotDownloader return output; } + + public static byte[] DecodeHexString( string hex ) + { + if ( hex == null ) + return null; + + int chars = hex.Length; + byte[] bytes = new byte[ chars / 2 ]; + + for ( int i = 0 ; i < chars ; i += 2 ) + bytes[ i / 2 ] = Convert.ToByte( hex.Substring( i, 2 ), 16 ); + + return bytes; + } } }