From caa46020a302b41603e7be1ac388d8b45429fe76 Mon Sep 17 00:00:00 2001 From: Crsky Date: Thu, 11 Jun 2026 20:02:25 +0800 Subject: [PATCH] fix: DxLib.EncryptedStream.ReadByte implementation --- ArcFormats/DxLib/ArcDX.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ArcFormats/DxLib/ArcDX.cs b/ArcFormats/DxLib/ArcDX.cs index 8f25ae26..3980b304 100644 --- a/ArcFormats/DxLib/ArcDX.cs +++ b/ArcFormats/DxLib/ArcDX.cs @@ -563,10 +563,11 @@ namespace GameRes.Formats.DxLib public override int ReadByte () { + long pos = Position; int b = BaseStream.ReadByte(); if (m_key.Length !=0) { - int key_pos = (int)((m_base_pos + Position) % m_key.Length); + int key_pos = (int)((m_base_pos + pos) % m_key.Length); if (-1 != b) { b ^= m_key[key_pos];