mirror of
https://github.com/lifegpc/GARbro.git
synced 2026-06-06 05:28:49 +08:00
(NephriteCrypt): another KiriKiri encryption scheme.
This commit is contained in:
@@ -578,6 +578,34 @@ namespace GameRes.Formats.KiriKiri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class NephriteCrypt : ICrypt
|
||||||
|
{
|
||||||
|
public override byte Decrypt (Xp3Entry entry, long offset, byte value)
|
||||||
|
{
|
||||||
|
if (0 != (offset & 1))
|
||||||
|
return (byte)(value ^ offset);
|
||||||
|
else
|
||||||
|
return (byte)(value ^ entry.Hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Decrypt (Xp3Entry entry, long offset, byte[] values, int pos, int count)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < count; ++i, ++offset)
|
||||||
|
{
|
||||||
|
if (0 != (offset & 1))
|
||||||
|
values[pos+i] ^= (byte)offset;
|
||||||
|
else
|
||||||
|
values[pos+i] ^= (byte)entry.Hash;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Encrypt (Xp3Entry entry, long offset, byte[] values, int pos, int count)
|
||||||
|
{
|
||||||
|
Decrypt (entry, offset, values, pos, count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class GakuenButouCrypt : ICrypt
|
public class GakuenButouCrypt : ICrypt
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user