From dca410a2604ef5b208091b6ebfe7757bc2d5d845 Mon Sep 17 00:00:00 2001 From: morkt Date: Sun, 7 Feb 2016 09:32:55 +0400 Subject: [PATCH] (SaiminCrypt): switched hex constants to decimals. --- ArcFormats/KiriKiri/CryptAlgorithms.cs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ArcFormats/KiriKiri/CryptAlgorithms.cs b/ArcFormats/KiriKiri/CryptAlgorithms.cs index c84089fd..aeaa861c 100644 --- a/ArcFormats/KiriKiri/CryptAlgorithms.cs +++ b/ArcFormats/KiriKiri/CryptAlgorithms.cs @@ -341,11 +341,11 @@ namespace GameRes.Formats.KiriKiri public override byte Decrypt (Xp3Entry entry, long offset, byte value) { byte key = (byte)entry.Hash; - if (offset < 0x7B) + if (offset < 123) value ^= (byte)(21 * key); - else if (offset < 0xF6) + else if (offset < 246) value += (byte)(-32 * key); - else if (offset < 0x171) + else if (offset < 369) value ^= (byte)(43 * key); else if (offset <= 0xffffffffL) value += (byte)(-54 * key); @@ -357,14 +357,14 @@ namespace GameRes.Formats.KiriKiri byte key = (byte)entry.Hash; for (int i = 0; i < count && offset <= 0xffffffffL; ++i, ++offset) { - if (offset < 0x7B) + if (offset < 123) values[pos+i] ^= (byte)(21 * key); - else if (offset < 0xF6) + else if (offset < 246) values[pos+i] += (byte)(-32 * key); - else if (offset >= 0x171) - values[pos+i] += (byte)(-54 * key); - else + else if (offset < 369) values[pos+i] ^= (byte)(43 * key); + else + values[pos+i] += (byte)(-54 * key); } } @@ -373,14 +373,14 @@ namespace GameRes.Formats.KiriKiri byte key = (byte)entry.Hash; for (int i = 0; i < count && offset <= 0xffffffffL; ++i, ++offset) { - if (offset < 0x7B) + if (offset < 123) values[pos+i] ^= (byte)(21 * key); - else if (offset < 0xF6) + else if (offset < 246) values[pos+i] -= (byte)(-32 * key); - else if (offset >= 0x171) - values[pos+i] -= (byte)(-54 * key); - else + else if (offset < 369) values[pos+i] ^= (byte)(43 * key); + else + values[pos+i] -= (byte)(-54 * key); } } }