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; + } } }