mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
fix: DxLib.EncryptedStream.ReadByte implementation
This commit is contained in:
@@ -563,10 +563,11 @@ namespace GameRes.Formats.DxLib
|
|||||||
|
|
||||||
public override int ReadByte ()
|
public override int ReadByte ()
|
||||||
{
|
{
|
||||||
|
long pos = Position;
|
||||||
int b = BaseStream.ReadByte();
|
int b = BaseStream.ReadByte();
|
||||||
if (m_key.Length !=0)
|
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)
|
if (-1 != b)
|
||||||
{
|
{
|
||||||
b ^= m_key[key_pos];
|
b ^= m_key[key_pos];
|
||||||
|
|||||||
Reference in New Issue
Block a user