Created
October 2, 2017 21:16
-
-
Save JKamsker/0e163e0d07764254a886dbd25d3af17c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static byte[] Decrypt(byte[] Data, int Offset) | |
{ | |
MemoryStream memoryStream = new MemoryStream(); | |
int num = 0; | |
byte b = 0; | |
for (;;) | |
{ | |
byte b2 = Data[num + Offset]; | |
if (b2 == 0) | |
{ | |
break; | |
} | |
if (num % 8 == 0) | |
{ | |
b = b2; | |
} | |
else if (((int)b & 1 << num % 8) == 0) | |
{ | |
memoryStream.WriteByte((byte)(b2 - (byte)1)); | |
} | |
else | |
{ | |
memoryStream.WriteByte(b2); | |
} | |
num++; | |
} | |
return memoryStream.ToArray(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment