|
|
|
@ -5,6 +5,8 @@ using System.Text;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using SteamKit2;
|
|
|
|
|
using System.Net;
|
|
|
|
|
using System.Security.Cryptography;
|
|
|
|
|
using SteamKit2.Blob;
|
|
|
|
|
|
|
|
|
|
namespace DepotDownloader
|
|
|
|
|
{
|
|
|
|
@ -190,7 +192,7 @@ namespace DepotDownloader
|
|
|
|
|
if ( ver.VersionID == version )
|
|
|
|
|
{
|
|
|
|
|
if ( ver.IsEncryptionKeyAvailable )
|
|
|
|
|
return Utils.DecodeHexString( ver.DepotEncryptionKey );
|
|
|
|
|
return DecodeHexString( ver.DepotEncryptionKey );
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -198,6 +200,20 @@ namespace DepotDownloader
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static List<int> GetDepotIDsForApp( int appId, bool allPlatforms )
|
|
|
|
|
{
|
|
|
|
|
List<int> depotIDs = new List<int>();
|
|
|
|
@ -403,12 +419,22 @@ namespace DepotDownloader
|
|
|
|
|
if ( cdr == null )
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
return CryptoHelper.SHAHash( cdr );
|
|
|
|
|
return SHAHash( cdr );
|
|
|
|
|
}
|
|
|
|
|
catch
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static byte[] SHAHash( byte[] data )
|
|
|
|
|
{
|
|
|
|
|
using ( SHA1Managed sha = new SHA1Managed() )
|
|
|
|
|
{
|
|
|
|
|
byte[] output = sha.ComputeHash( data );
|
|
|
|
|
|
|
|
|
|
return output;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|