mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(CzDecryptInt): don't modify source buffer.
This commit is contained in:
@@ -81,11 +81,11 @@ namespace GameRes.Formats.KiriKiri
|
|||||||
|
|
||||||
static int CzDecryptInt (byte[] data, int offset, byte key)
|
static int CzDecryptInt (byte[] data, int offset, byte key)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 4; ++i)
|
int v = data[offset] ^ key ^ CzHeaderKey[0];
|
||||||
{
|
v |= (data[offset+1] ^ key ^ CzHeaderKey[1]) << 8;
|
||||||
data[offset+i] ^= (byte)(key ^ CzHeaderKey[i]);
|
v |= (data[offset+2] ^ key ^ CzHeaderKey[2]) << 16;
|
||||||
}
|
v |= (data[offset+3] ^ key ^ CzHeaderKey[3]) << 24;
|
||||||
return data.ToInt32 (offset);
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
static byte[] CzDecryptData (byte[] data)
|
static byte[] CzDecryptData (byte[] data)
|
||||||
|
|||||||
Reference in New Issue
Block a user