From 74844e0bcc974b4f63517c18bcb85051def40be6 Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 1 Feb 2017 16:26:10 +0400 Subject: [PATCH] WSM3 archives seem to be almost identical to WSM2. --- ArcFormats/Tanaka/ArcWSM.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ArcFormats/Tanaka/ArcWSM.cs b/ArcFormats/Tanaka/ArcWSM.cs index dbac1284..4b904893 100644 --- a/ArcFormats/Tanaka/ArcWSM.cs +++ b/ArcFormats/Tanaka/ArcWSM.cs @@ -42,6 +42,7 @@ namespace GameRes.Formats.Will public Wsm2Opener () { Extensions = new string[] { "wsm" }; + Signatures = new uint[] { 0x324D5357, 0x334D5357 }; } public override ArcFile TryOpen (ArcView file) @@ -50,6 +51,7 @@ namespace GameRes.Formats.Will int count = file.View.ReadInt32 (0xC); if (!IsSaneCount (count) || index_size >= file.MaxOffset - 0x40) return null; + int version = file.View.ReadByte (3) - '0'; int table_offset = file.View.ReadInt32 (0x10); int table_count = file.View.ReadInt32 (0x14); if (table_offset >= index_size || !IsSaneCount (table_count)) @@ -61,6 +63,8 @@ namespace GameRes.Formats.Will var entry = new Entry { Type = "audio" }; entry.Offset = index.ToUInt32 (table_offset) - 0x14; entry.Size = index.ToUInt32 (table_offset+8) + 0x14; + if (3 == version) + entry.Size += index.ToUInt32 (table_offset+4); if (!entry.CheckPlacement (file.MaxOffset)) return null; table_offset += 0x20;