(EncryptionV3): in case of empty key use v2 decryption.

This commit is contained in:
morkt 2018-10-15 23:25:07 +04:00
parent 1ffca62364
commit 260cf8c6d9

View File

@ -179,7 +179,9 @@ namespace GameRes.Formats.Qlie
/// Internal game data used to decrypt encrypted entries. /// Internal game data used to decrypt encrypted entries.
/// null if not used. /// null if not used.
/// </summary> /// </summary>
public byte[] GameKeyData; internal byte[] GameKeyData;
internal bool GameKeyIsEmpty { get { return GameKeyData != null && GameKeyData.Length == 0; } }
public EncryptionV3 (ArcView file, byte[] game_key) public EncryptionV3 (ArcView file, byte[] game_key)
{ {
@ -213,7 +215,7 @@ namespace GameRes.Formats.Qlie
public override void DecryptEntry (byte[] data, int offset, int length, QlieEntry entry) public override void DecryptEntry (byte[] data, int offset, int length, QlieEntry entry)
{ {
var key_file = entry.KeyFile; var key_file = entry.KeyFile;
if (null == key_file) if (null == key_file || GameKeyIsEmpty)
{ {
base.DecryptEntry (data, offset, length, entry); base.DecryptEntry (data, offset, length, entry);
return; return;