mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-23 19:34:15 +08:00
use XoredStream instead of CryptoStream with XorTransform.
This commit is contained in:
parent
544b4cb067
commit
a303a66501
@ -140,7 +140,7 @@ namespace GameRes.Formats.Aoi
|
||||
var barc = arc as BoxArchive;
|
||||
if (null == barc)
|
||||
return input;
|
||||
return new CryptoStream (input, new XorTransform (barc.Key), CryptoStreamMode.Read);
|
||||
return new XoredStream (input, barc.Key);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ namespace GameRes.Formats.X
|
||||
{
|
||||
byte key = KnownKeys.First().Value;
|
||||
var input = arc.File.CreateStream (entry.Offset, entry.Size);
|
||||
return new CryptoStream (input, new XorTransform (key), CryptoStreamMode.Read);
|
||||
return new XoredStream (input, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ namespace GameRes.Formats.KScript
|
||||
y = header.ToInt32 (0x18);
|
||||
}
|
||||
using (var input = new StreamRegion (stream.AsStream, data_offset, true))
|
||||
using (var crypto = new CryptoStream (input, new XorTransform (key), CryptoStreamMode.Read))
|
||||
using (var crypto = new XoredStream (input, key))
|
||||
using (var png = new BinaryStream (crypto, stream.Name))
|
||||
{
|
||||
var info = Png.ReadMetaData (png);
|
||||
@ -82,7 +82,7 @@ namespace GameRes.Formats.KScript
|
||||
{
|
||||
var meta = (KgpMetaData)info;
|
||||
using (var input = new StreamRegion (stream.AsStream, meta.DataOffset, true))
|
||||
using (var crypto = new CryptoStream (input, new XorTransform (meta.Key), CryptoStreamMode.Read))
|
||||
using (var crypto = new XoredStream (input, meta.Key))
|
||||
using (var png = new BinaryStream (crypto, stream.Name))
|
||||
return Png.Read (png, info);
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ namespace GameRes.Formats.Slg
|
||||
public override Stream OpenEntry (ArcFile arc, Entry entry)
|
||||
{
|
||||
var input = arc.File.CreateStream (entry.Offset, entry.Size);
|
||||
return new CryptoStream (input, new XorTransform (0x90), CryptoStreamMode.Read);
|
||||
return new XoredStream (input, 0x90);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user