Skip to content
This repository has been archived by the owner on Aug 17, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1780 from WallyCZ/master
Browse files Browse the repository at this point in the history
Small fix in PCrypt decryption for payloads > 256 (by turnt)
  • Loading branch information
ST-Apps authored Nov 6, 2016
2 parents 3ea072e + c178890 commit a4aa971
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions PokemonGoAPI/Helpers/Crypt/PCrypt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,17 @@ 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);
for (int j = 0; j < 256; j++)
{
outputcontent[i][j] ^= cipher8[j];
}
Buffer.BlockCopy(temp3, 0, cipher8, 0, 0x100);
}

byte[] ret = new byte[output_len];
Expand Down

0 comments on commit a4aa971

Please sign in to comment.