From d49a2cf5a46572d2097cfa67fa6e85bcc1c27a99 Mon Sep 17 00:00:00 2001 From: scientificworld Date: Sat, 29 Nov 2025 13:35:58 +0800 Subject: [PATCH] Fix previous commit --- ArcFormats/Sas5/ArcSec5.cs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/ArcFormats/Sas5/ArcSec5.cs b/ArcFormats/Sas5/ArcSec5.cs index c29a1b09..011abf5f 100644 --- a/ArcFormats/Sas5/ArcSec5.cs +++ b/ArcFormats/Sas5/ArcSec5.cs @@ -266,10 +266,15 @@ namespace GameRes.Formats.Sas5 size = section_size - 1; break; case 2: - var tmp = new byte[0x1D]; - file.View.Read (offset + 1, tmp, 0, 0x1D); - DecryptCodeSection (tmp); - size = BitConverter.ToUInt32 (tmp, 0x19); + if ("CODE" == name) + { + var tmp = new byte[0x1D]; + file.View.Read (offset + 1, tmp, 0, 0x1D); + DecryptCodeSection (tmp); + size = BitConverter.ToUInt32 (tmp, 0x19); + } + else + size = file.View.ReadUInt32 (offset + 0x1A); break; default: return null;