From 47f7486efce9d860cfc23235f2a4395aaed6ead3 Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 22 Sep 2018 02:51:08 +0400 Subject: [PATCH] (YSK): scripts not always encrypted. --- Legacy/GPlay/ArcYSK.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Legacy/GPlay/ArcYSK.cs b/Legacy/GPlay/ArcYSK.cs index 8a92d54a..d6a29063 100644 --- a/Legacy/GPlay/ArcYSK.cs +++ b/Legacy/GPlay/ArcYSK.cs @@ -44,8 +44,8 @@ namespace GameRes.Formats.GPlay public YskOpener () { - // "AA1640124080", "AA7790743350" - Signatures = new uint[] { 0x36314141, 0x39324141, 0x37374141, 0 }; + // "AA1640124080", "AA7790743350", "AA1825646340" + Signatures = new uint[] { 0x36314141, 0x39324141, 0x37374141, 0x38314141, 0 }; } const ulong DefaultKey = 0x1234567812345678ul; @@ -83,7 +83,10 @@ namespace GameRes.Formats.GPlay { if (entry.Name.HasAnyOfExtensions ("TXT", "DAT")) { - var input = arc.File.CreateStream (entry.Offset, entry.Size); + var input = arc.File.CreateStream (entry.Offset, entry.Size, entry.Name); + int first_byte = (int)input.Signature & 0xFF; + if (first_byte == '#' || first_byte == '*') + return input; var dec = new DesTransform (DefaultKey); return new InputCryptoStream (input, dec); }