From c1788901e874298cf9190df10c15259c5e042674 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Lipert?= Date: Sun, 6 Nov 2016 19:20:24 +0100 Subject: [PATCH] Small fix in PCrypt for payloads > 256 (by turnt) --- PokemonGoAPI/Helpers/Crypt/PCrypt.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/PokemonGoAPI/Helpers/Crypt/PCrypt.cs b/PokemonGoAPI/Helpers/Crypt/PCrypt.cs index 3958aa8e7..14d4023b3 100644 --- a/PokemonGoAPI/Helpers/Crypt/PCrypt.cs +++ b/PokemonGoAPI/Helpers/Crypt/PCrypt.cs @@ -121,7 +121,9 @@ public static byte[] decrypt(byte[] input, out int length) for (int i = 0; i < outputcontent.Count; i++) { uint[] temp2 = new uint[0x100 / 4]; + uint[] temp3 = new uint[0x100 / 4]; Buffer.BlockCopy(outputcontent[i], 0, temp2, 0, 0x100); + Buffer.BlockCopy(temp2, 0, temp3, 0, 0x100); if (version == 1) Shuffles.Unshuffle(temp2); else Shuffles.Unshuffle2(temp2); Buffer.BlockCopy(temp2, 0, outputcontent[i], 0, 0x100); @@ -129,6 +131,7 @@ public static byte[] decrypt(byte[] input, out int length) { outputcontent[i][j] ^= cipher8[j]; } + Buffer.BlockCopy(temp3, 0, cipher8, 0, 0x100); } byte[] ret = new byte[output_len];