mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 21:55:34 +08:00
(XP3): another encryption.
This commit is contained in:
parent
b02b95cbf1
commit
87086bb3fe
@ -850,6 +850,27 @@ namespace GameRes.Formats.KiriKiri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// reminder:
|
||||||
|
// locate virtual table, then find constructor where it's referenced.
|
||||||
|
[Serializable]
|
||||||
|
public class YuzuCrypt : ICrypt
|
||||||
|
{
|
||||||
|
public override void Decrypt (Xp3Entry entry, long offset, byte[] data, int pos, int count)
|
||||||
|
{
|
||||||
|
uint hash = entry.Hash ^ 0x1DDB6E7A;
|
||||||
|
byte key = (byte)(hash ^ (hash >> 8) ^ (hash >> 16) ^ (hash >> 24));
|
||||||
|
if (0 == key)
|
||||||
|
key = 0xD0;
|
||||||
|
for (int i = 0; i < count; ++i)
|
||||||
|
data[pos+i] ^= key;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Encrypt (Xp3Entry entry, long offset, byte[] data, int pos, int count)
|
||||||
|
{
|
||||||
|
Decrypt (entry, offset, data, pos, count);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
public class HighRunningCrypt : ICrypt
|
public class HighRunningCrypt : ICrypt
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user