From 94b6bc22f0ca1a8856fc29a611866feace7cbf0e Mon Sep 17 00:00:00 2001 From: Crsky Date: Tue, 17 Mar 2026 16:35:26 +0800 Subject: [PATCH] fix: Fix XP3 RIFF detection --- ArcFormats/KiriKiri/CryptAlgorithms.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ArcFormats/KiriKiri/CryptAlgorithms.cs b/ArcFormats/KiriKiri/CryptAlgorithms.cs index a3b06383..ad473cc7 100644 --- a/ArcFormats/KiriKiri/CryptAlgorithms.cs +++ b/ArcFormats/KiriKiri/CryptAlgorithms.cs @@ -104,6 +104,22 @@ namespace GameRes.Formats.KiriKiri input.Read (header, 0, 5); uint signature = header.ToUInt32 (0); GuessEntryTypeBySignature (entry, signature); + if (0x46464952 == signature) // 'RIFF' + { + if (entry.UnpackedSize >= 12) + { + var header_ext = new byte[12]; + Array.Copy (header, header_ext, header.Length); + input.Read (header_ext, header.Length, header_ext.Length-header.Length); + header = header_ext; + if (header.AsciiEqual (8, "WAVE")) + entry.Type = "audio"; + else if (header.AsciiEqual (8, "WEBP")) + entry.Type = "image"; + else if (header.AsciiEqual (8, "AVI ")) + entry.Type = "video"; + } + } if (0x184D2204 == signature) // LZ4 magic { // assume no scripts are compressed using LZ4, return decompressed stream right away