mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-25 04:14:13 +08:00
(KiriKiri.KissCrypt): new decryptor.
This commit is contained in:
parent
1d849c37d6
commit
77cb9a853f
@ -954,4 +954,26 @@ namespace GameRes.Formats.KiriKiri
|
|||||||
[NonSerialized]
|
[NonSerialized]
|
||||||
Dictionary<string, string> KnownNames = null;
|
Dictionary<string, string> KnownNames = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Serializable]
|
||||||
|
public class KissCrypt : ICrypt
|
||||||
|
{
|
||||||
|
public override void Decrypt (Xp3Entry entry, long offset, byte[] data, int pos, int count)
|
||||||
|
{
|
||||||
|
uint key = entry.Hash ^ (entry.Hash >> 19) ^ 0x4A9EEFF0u;
|
||||||
|
int i = 0;
|
||||||
|
while (0 != ((offset + i) & 0xF))
|
||||||
|
++i;
|
||||||
|
while (i < count)
|
||||||
|
{
|
||||||
|
data[pos+i] ^= (byte)(key ^ (offset + i));
|
||||||
|
i += 0x10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Encrypt (Xp3Entry entry, long offset, byte[] data, int pos, int count)
|
||||||
|
{
|
||||||
|
Decrypt (entry, offset, data, pos, count);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user