mirror of
https://github.com/crskycode/GARbro.git
synced 2026-06-17 06:24:24 +08:00
fix: DxLib.EncryptedStream.ReadByte implementation
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user