internal static byte[] smethod_2(Stream stream_0) { byte[] result; lock (Class23.object_0) { result = Class23.smethod_4(97L, stream_0); } return(result); }
internal static byte[] smethod_3(long long_0, Stream stream_0) { byte[] result; try { result = Class23.smethod_2(stream_0); } catch (HostProtectionException) { result = Class23.smethod_4(97L, stream_0); } return(result); }
internal static byte[] smethod_4(long long_0, Stream stream_0) { Stream stream = stream_0; MemoryStream memoryStream = null; ushort num = (ushort)stream_0.ReadByte(); num = ~num; for (int i = 1; i < 3; i++) { stream_0.ReadByte(); } if ((num & 2) != 0) { DESCryptoServiceProvider dESCryptoServiceProvider = new DESCryptoServiceProvider(); byte[] array = new byte[8]; stream_0.Read(array, 0, 8); dESCryptoServiceProvider.IV = array; byte[] array2 = new byte[8]; stream_0.Read(array2, 0, 8); bool flag = true; byte[] array3 = array2; for (int j = 0; j < array3.Length; j++) { if (array3[j] != 0) { flag = false; IL_8B: if (flag) { array2 = Class23.smethod_1(Assembly.GetExecutingAssembly()); } dESCryptoServiceProvider.Key = array2; if (Class23.memoryStream_0 == null) { if (Class23.int_0 == 2147483647) { Class23.memoryStream_0.Capacity = (int)stream_0.Length; } else { Class23.memoryStream_0.Capacity = Class23.int_0; } } Class23.memoryStream_0.Position = 0L; ICryptoTransform cryptoTransform = dESCryptoServiceProvider.CreateDecryptor(); int inputBlockSize = cryptoTransform.InputBlockSize; int arg_105_0 = cryptoTransform.OutputBlockSize; byte[] array4 = new byte[cryptoTransform.OutputBlockSize]; byte[] array5 = new byte[cryptoTransform.InputBlockSize]; int num2 = (int)stream_0.Position; while ((long)(num2 + inputBlockSize) < stream_0.Length) { stream_0.Read(array5, 0, inputBlockSize); int count = cryptoTransform.TransformBlock(array5, 0, inputBlockSize, array4, 0); Class23.memoryStream_0.Write(array4, 0, count); num2 += inputBlockSize; } stream_0.Read(array5, 0, (int)(stream_0.Length - (long)num2)); byte[] array6 = cryptoTransform.TransformFinalBlock(array5, 0, (int)(stream_0.Length - (long)num2)); Class23.memoryStream_0.Write(array6, 0, array6.Length); stream = Class23.memoryStream_0; stream.Position = 0L; memoryStream = Class23.memoryStream_0; goto IL_1C6; } } goto IL_8B; } IL_1C6: if ((num & 8) != 0) { try { if (Class23.memoryStream_1 == null) { if (Class23.int_1 == -2147483648) { Class23.memoryStream_1.Capacity = (int)stream.Length * 2; } else { Class23.memoryStream_1.Capacity = Class23.int_1; } } Class23.memoryStream_1.Position = 0L; DeflateStream deflateStream = new DeflateStream(stream, CompressionMode.Decompress); int num3 = 1000; byte[] buffer = new byte[1000]; int num4; do { num4 = deflateStream.Read(buffer, 0, num3); if (num4 > 0) { Class23.memoryStream_1.Write(buffer, 0, num4); } }while (num4 >= num3); memoryStream = Class23.memoryStream_1; } catch (Exception) { } } if (memoryStream != null) { return(memoryStream.ToArray()); } byte[] array7 = new byte[stream_0.Length - stream_0.Position]; stream_0.Read(array7, 0, array7.Length); return(array7); }