Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Type: Class291
- // Assembly: mototrbocps, Version=7.6.384.0, Culture=neutral, PublicKeyToken=null
- // Assembly location: C:\7.6\mototrbocps.exe
- using custom_exception;
- using System;
- using System.Globalization;
- using System.IO;
- using System.IO.Compression;
- using System.Security.Cryptography;
- using System.Security.Cryptography.X509Certificates;
- using System.Text;
- internal class Class291
- {
- private static string[] string_12 = new string[2]
- {
- "mototrbocps",
- "predefined"
- };
- private static string[] string_13 = new string[2]
- {
- "enE3biVqPUx8KnA5M3lvUQ",
- "KlIkejNiMl8tJSN0RGtjMQ"
- };
- private static string[] string_14 = new string[2]
- {
- "<RSAKeyValue><Modulus>5AaKT6Hvh9+QrPWr5wugcqFjZWe54yW4/2sn6KAHKIrvvpD7J2x+elfDTry9DEx0U5dplG0SAtMNlXNV4PXU72Ze/yoeD/gfsGBGlmhpVCxkd0WvfSnSl5xe/WcCVJnyrjIQjRI47Aok7H3tjtshvq/LLKUtWxpxy4iGupbtv20=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>",
- "<RSAKeyValue><Modulus>qZzUh3GihbzdI7wJxcIzvLX7X/7sTUSgjnmByopoISoAyFz+5rWpat+vGXswVaUAWK6htcWW2iGdDlyERK/U5jme2IB91CFjk9bSsmVx5RF3oTzNmxAh/cQ7qAwEi/3ffu+SzFSaZlZJ+1kKSwoM/qvVPXQjaYmu1F4YYD1k430=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"
- };
- private string[] string_10 = new string[3]
- {
- "RmFAUjxmbWpLNmkqUUVWfUhoQ1Usd1BOP0ZpLVg7USQ",
- "P1Ixd3swKE54MzUwOXhwWHtEVjM0biNLY1lNKzNRdnI",
- "MntwRDhWSDxHM0Eod0YlWz5ddTxZemlVUz4zbmprOGY"
- };
- private string[] string_11 = new string[3]
- {
- "czp8KVtQfVU/bj9BbVBnIw",
- "Qlg3VSxAJW5dOjM5cHJIMw",
- "QTlhOFZ9cnY1JTE1a1Y2RQ"
- };
- private const int int_0 = 0;
- public const int int_1 = 3;
- private const int int_2 = 2;
- private const int int_3 = 1024;
- public const byte byte_0 = (byte) 239;
- public const byte byte_1 = (byte) 187;
- public const byte byte_2 = (byte) 191;
- private const byte byte_3 = (byte) 254;
- private const byte byte_4 = (byte) 255;
- private const byte byte_5 = (byte) 255;
- private const byte byte_6 = (byte) 254;
- private const string string_0 = "|";
- private const string string_1 = "Secure";
- private const string string_2 = ", ";
- private const char char_0 = '\0';
- private const string string_3 = "<SIGNATURE>";
- private const string string_4 = "</SIGNATURE>";
- private const string string_5 = "<VERSION>";
- private const string string_6 = "</VERSION>";
- private const string string_7 = "1.0";
- private const string string_8 = "<DIGEST>";
- private const string string_9 = "</DIGEST>";
- static Class291()
- {
- }
- public static void smethod_0(string string_15, Class291.Enum44 enum44_0, ref string string_16)
- {
- try
- {
- if (string_16.IndexOf("<SIGNATURE>") != -1 && string_16.IndexOf("</SIGNATURE>") != -1)
- throw new CCustomException(1840U, "Secure", "ApplySignature", ((object) Environment.StackTrace).ToString());
- string str1 = Class291.string_12[(IntPtr) (uint) enum44_0];
- string @string = Encoding.ASCII.GetString(Convert.FromBase64String(Class291.string_13[(IntPtr) (uint) enum44_0] + "=="));
- byte[] hash = new SHA1Managed().ComputeHash(new UnicodeEncoding().GetBytes(string_16));
- byte[] numArray;
- string str2;
- using (RSACryptoServiceProvider cryptoServiceProvider = (RSACryptoServiceProvider) new X509Certificate2(string_15 + str1, @string, X509KeyStorageFlags.MachineKeySet).PrivateKey)
- {
- numArray = cryptoServiceProvider.SignHash(hash, CryptoConfig.MapNameToOID("SHA1"));
- str2 = cryptoServiceProvider.ToXmlString(false);
- }
- string str3 = BitConverter.ToString(numArray);
- string str4 = "<VERSION>1.0</VERSION>";
- string str5 = "<DIGEST>" + str3.Replace("-", "") + "</DIGEST>";
- // ISSUE: explicit reference operation
- // ISSUE: variable of a reference type
- string& local = @string_16;
- // ISSUE: explicit reference operation
- string str6 = ^local + "<SIGNATURE>" + str4 + str5 + str2 + "</SIGNATURE>";
- // ISSUE: explicit reference operation
- ^local = str6;
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 1839U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- public static Class291.Enum45 smethod_1(Class291.Enum44 enum44_0, ref string string_15)
- {
- Class291.Enum45 enum45 = Class291.Enum45.const_1;
- try
- {
- int startIndex1 = string_15.IndexOf("<SIGNATURE>");
- int num1 = string_15.IndexOf("</SIGNATURE>");
- if (startIndex1 != -1)
- {
- if (num1 != -1)
- {
- int num2 = string_15.IndexOf("<DIGEST>");
- int num3 = string_15.IndexOf("</DIGEST>");
- int startIndex2 = num2 + "<DIGEST>".Length;
- int length1 = num3 - startIndex2;
- string str = string_15.Substring(startIndex2, length1);
- int startIndex3 = num3 + "</DIGEST>".Length;
- int length2 = num1 - startIndex3;
- string xmlString = string_15.Substring(startIndex3, length2);
- if (xmlString != Class291.string_14[(IntPtr) (uint) enum44_0])
- throw new CCustomException(1838U, "Secure", "VerifySignature", ((object) Environment.StackTrace).ToString());
- string_15 = string_15.Remove(startIndex1);
- byte[] hash = new SHA1Managed().ComputeHash(new UnicodeEncoding().GetBytes(string_15));
- byte[] rgbSignature = new byte[str.Length / 2];
- for (int index = 0; index < rgbSignature.Length; ++index)
- rgbSignature[index] = Convert.ToByte(str.Substring(index * 2, 2), 16);
- using (RSACryptoServiceProvider cryptoServiceProvider = new RSACryptoServiceProvider())
- {
- cryptoServiceProvider.FromXmlString(xmlString);
- enum45 = !cryptoServiceProvider.VerifyHash(hash, CryptoConfig.MapNameToOID("SHA1"), rgbSignature) ? Class291.Enum45.const_0 : Class291.Enum45.const_2;
- }
- }
- }
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 1839U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- return enum45;
- }
- public void method_0(string string_15, string string_16, bool bool_0, Class291.Enum43 enum43_0)
- {
- try
- {
- if (string.IsNullOrEmpty(string_15) || string.IsNullOrEmpty(string_16))
- throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", EncryptFile", ((object) Environment.StackTrace).ToString());
- if (!File.Exists(Path.GetFullPath(string_15)))
- throw new CCustomException(2392U, "Secure", this.GetType().ToString() + ", EncryptFile", ((object) Environment.StackTrace).ToString());
- string string_15_1;
- string string_16_1;
- this.method_12(enum43_0, out string_15_1, out string_16_1);
- RijndaelManaged rijndaelManaged = new RijndaelManaged();
- rijndaelManaged.Key = Convert.FromBase64String(string_15_1 + "=");
- rijndaelManaged.IV = Convert.FromBase64String(string_16_1 + "==");
- byte[] numArray = (byte[]) null;
- byte[] byte_8 = (byte[]) null;
- using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
- {
- numArray = new byte[fileStream.Length];
- fileStream.Read(numArray, 0, numArray.Length);
- }
- this.method_10(numArray, ref byte_8, bool_0, rijndaelManaged.CreateEncryptor());
- using (FileStream fileStream = new FileStream(string_16, FileMode.Create, FileAccess.Write))
- fileStream.Write(byte_8, 0, byte_8.Length);
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2393U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- public void method_1(byte[] byte_7, ref byte[] byte_8, bool bool_0, Class291.Enum43 enum43_0)
- {
- try
- {
- string string_15;
- string string_16;
- this.method_12(enum43_0, out string_15, out string_16);
- RijndaelManaged rijndaelManaged = new RijndaelManaged();
- rijndaelManaged.Key = Convert.FromBase64String(string_15 + "=");
- rijndaelManaged.IV = Convert.FromBase64String(string_16 + "==");
- byte[] byte_7_1 = new byte[byte_7.Length + 3];
- byte_7_1[0] = (byte) 239;
- byte_7_1[1] = (byte) 187;
- byte_7_1[2] = (byte) 191;
- Array.Copy((Array) byte_7, 0, (Array) byte_7_1, 3, byte_7.Length);
- this.method_10(byte_7_1, ref byte_8, bool_0, rijndaelManaged.CreateEncryptor());
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2393U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- public void method_2(string string_15, ref string string_16, bool bool_0, Class291.Enum43 enum43_0)
- {
- try
- {
- if (string.IsNullOrEmpty(string_15))
- throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", EncryptFile", ((object) Environment.StackTrace).ToString());
- if (!File.Exists(Path.GetFullPath(string_15)))
- throw new CCustomException(2392U, "Secure", this.GetType().ToString() + ", EncryptFile", ((object) Environment.StackTrace).ToString());
- string string_15_1;
- string string_16_1;
- this.method_12(enum43_0, out string_15_1, out string_16_1);
- RijndaelManaged rijndaelManaged = new RijndaelManaged();
- rijndaelManaged.Key = Convert.FromBase64String(string_15_1 + "=");
- rijndaelManaged.IV = Convert.FromBase64String(string_16_1 + "==");
- byte[] numArray = (byte[]) null;
- byte[] byte_8 = (byte[]) null;
- using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
- {
- numArray = new byte[fileStream.Length + 3L];
- numArray[0] = (byte) 239;
- numArray[1] = (byte) 187;
- numArray[2] = (byte) 191;
- fileStream.Read(numArray, 3, (int) fileStream.Length);
- }
- this.method_10(numArray, ref byte_8, bool_0, rijndaelManaged.CreateEncryptor());
- string_16 = Encoding.UTF8.GetString(byte_8);
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2393U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- public void method_3(string string_15, string string_16, bool bool_0)
- {
- try
- {
- TripleDESCryptoServiceProvider cryptoServiceProvider = new TripleDESCryptoServiceProvider();
- cryptoServiceProvider.Key = Encoding.ASCII.GetBytes("HAVNCPSLTDTUNERAIRTRACER");
- cryptoServiceProvider.IV = Encoding.ASCII.GetBytes("VEDKDJSP");
- byte[] numArray = (byte[]) null;
- byte[] byte_8 = (byte[]) null;
- using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
- {
- numArray = new byte[fileStream.Length];
- fileStream.Read(numArray, 0, numArray.Length);
- }
- this.method_10(numArray, ref byte_8, bool_0, cryptoServiceProvider.CreateEncryptor());
- using (FileStream fileStream = new FileStream(string_16, FileMode.Create, FileAccess.Write))
- fileStream.Write(byte_8, 0, byte_8.Length);
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2393U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- public void method_4(string string_15, string string_16, bool bool_0, Class291.Enum43 enum43_0)
- {
- try
- {
- if (string.IsNullOrEmpty(string_15) || string.IsNullOrEmpty(string_16))
- throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
- if (!File.Exists(Path.GetFullPath(string_15)))
- throw new CCustomException(2392U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
- string string_15_1;
- string string_16_1;
- this.method_12(enum43_0, out string_15_1, out string_16_1);
- RijndaelManaged rijndaelManaged = new RijndaelManaged();
- rijndaelManaged.Key = Convert.FromBase64String(string_15_1 + "=");
- rijndaelManaged.IV = Convert.FromBase64String(string_16_1 + "==");
- byte[] numArray = (byte[]) null;
- byte[] byte_8 = (byte[]) null;
- using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
- {
- numArray = new byte[fileStream.Length];
- fileStream.Read(numArray, 0, numArray.Length);
- }
- this.method_11(numArray, ref byte_8, bool_0, enum43_0, rijndaelManaged.CreateDecryptor());
- using (FileStream fileStream = new FileStream(string_16, FileMode.OpenOrCreate, FileAccess.Write))
- fileStream.Write(byte_8, 0, byte_8.Length);
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- public void method_5(byte[] byte_7, ref byte[] byte_8, bool bool_0, Class291.Enum43 enum43_0)
- {
- try
- {
- string string_15;
- string string_16;
- this.method_12(enum43_0, out string_15, out string_16);
- RijndaelManaged rijndaelManaged = new RijndaelManaged();
- rijndaelManaged.Key = Convert.FromBase64String(string_15 + "=");
- rijndaelManaged.IV = Convert.FromBase64String(string_16 + "==");
- this.method_11(byte_7, ref byte_8, bool_0, enum43_0, rijndaelManaged.CreateDecryptor());
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- public void method_6(string string_15, ref string string_16, bool bool_0, Class291.Enum43 enum43_0)
- {
- try
- {
- if (string.IsNullOrEmpty(string_15))
- throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
- if (!File.Exists(Path.GetFullPath(string_15)))
- throw new CCustomException(2392U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
- string string_15_1;
- string string_16_1;
- this.method_12(enum43_0, out string_15_1, out string_16_1);
- RijndaelManaged rijndaelManaged = new RijndaelManaged();
- rijndaelManaged.Key = Convert.FromBase64String(string_15_1 + "=");
- rijndaelManaged.IV = Convert.FromBase64String(string_16_1 + "==");
- byte[] numArray = (byte[]) null;
- byte[] byte_8 = (byte[]) null;
- using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
- {
- numArray = new byte[fileStream.Length];
- fileStream.Read(numArray, 0, numArray.Length);
- }
- Encoding encoding = this.method_11(numArray, ref byte_8, bool_0, enum43_0, rijndaelManaged.CreateDecryptor());
- string_16 = encoding.GetString(byte_8);
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- public void method_7(string string_15, string string_16, bool bool_0)
- {
- try
- {
- if (string.IsNullOrEmpty(string_15) || string.IsNullOrEmpty(string_16))
- throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
- if (!File.Exists(Path.GetFullPath(string_15)))
- throw new CCustomException(2392U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
- TripleDESCryptoServiceProvider cryptoServiceProvider = new TripleDESCryptoServiceProvider();
- cryptoServiceProvider.Key = Encoding.ASCII.GetBytes("HAVNCPSLTDTUNERAIRTRACER");
- cryptoServiceProvider.IV = Encoding.ASCII.GetBytes("VEDKDJSP");
- byte[] numArray = (byte[]) null;
- byte[] byte_8 = (byte[]) null;
- using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
- {
- numArray = new byte[fileStream.Length];
- fileStream.Read(numArray, 0, numArray.Length);
- }
- this.method_11(numArray, ref byte_8, bool_0, Class291.Enum43.const_0, cryptoServiceProvider.CreateDecryptor());
- using (FileStream fileStream = new FileStream(string_16, FileMode.OpenOrCreate, FileAccess.Write))
- fileStream.Write(byte_8, 0, byte_8.Length);
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- public void method_8(byte[] byte_7, ref byte[] byte_8, bool bool_0)
- {
- try
- {
- TripleDESCryptoServiceProvider cryptoServiceProvider = new TripleDESCryptoServiceProvider();
- cryptoServiceProvider.Key = Encoding.ASCII.GetBytes("HAVNCPSLTDTUNERAIRTRACER");
- cryptoServiceProvider.IV = Encoding.ASCII.GetBytes("VEDKDJSP");
- this.method_11(byte_7, ref byte_8, bool_0, Class291.Enum43.const_0, cryptoServiceProvider.CreateDecryptor());
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- public void method_9(string string_15, ref string string_16, bool bool_0)
- {
- try
- {
- TripleDESCryptoServiceProvider cryptoServiceProvider = new TripleDESCryptoServiceProvider();
- cryptoServiceProvider.Key = Encoding.ASCII.GetBytes("HAVNCPSLTDTUNERAIRTRACER");
- cryptoServiceProvider.IV = Encoding.ASCII.GetBytes("VEDKDJSP");
- byte[] numArray = (byte[]) null;
- byte[] byte_8 = (byte[]) null;
- using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
- {
- numArray = new byte[fileStream.Length];
- fileStream.Read(numArray, 0, numArray.Length);
- }
- Encoding encoding = this.method_11(numArray, ref byte_8, bool_0, Class291.Enum43.const_0, cryptoServiceProvider.CreateDecryptor());
- string_16 = encoding.GetString(byte_8);
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- private void method_10(byte[] byte_7, ref byte[] byte_8, bool bool_0, ICryptoTransform icryptoTransform_0)
- {
- try
- {
- if (byte_7 == null || byte_7.Length <= 0)
- throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", EncryptFile", ((object) Environment.StackTrace).ToString());
- if (bool_0)
- {
- using (MemoryStream memoryStream = new MemoryStream())
- {
- using (GZipStream gzipStream = new GZipStream((Stream) memoryStream, CompressionMode.Compress, true))
- gzipStream.Write(byte_7, 0, byte_7.Length);
- byte_7 = memoryStream.ToArray();
- }
- }
- using (MemoryStream memoryStream = new MemoryStream())
- {
- using (CryptoStream cryptoStream = new CryptoStream((Stream) memoryStream, icryptoTransform_0, CryptoStreamMode.Write))
- {
- cryptoStream.Write(byte_7, 0, byte_7.Length);
- cryptoStream.FlushFinalBlock();
- }
- byte_8 = memoryStream.ToArray();
- }
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2393U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- private Encoding method_11(byte[] byte_7, ref byte[] byte_8, bool bool_0, Class291.Enum43 enum43_0, ICryptoTransform icryptoTransform_0)
- {
- Encoding encoding_0 = (Encoding) null;
- try
- {
- if (byte_7 == null)
- throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
- byte[] buffer1 = new byte[byte_7.Length];
- using (CryptoStream cryptoStream = new CryptoStream((Stream) new MemoryStream(byte_7), icryptoTransform_0, CryptoStreamMode.Read))
- cryptoStream.Read(buffer1, 0, buffer1.Length);
- if (bool_0)
- {
- using (GZipStream gzipStream = new GZipStream((Stream) new MemoryStream(buffer1), CompressionMode.Decompress, false))
- {
- byte[] buffer2 = new byte[4096];
- using (MemoryStream memoryStream = new MemoryStream())
- {
- int count;
- while ((count = gzipStream.Read(buffer2, 0, buffer2.Length)) > 0)
- memoryStream.Write(buffer2, 0, count);
- buffer1 = memoryStream.ToArray();
- }
- }
- }
- switch (buffer1[0])
- {
- case (byte) 239:
- if (!buffer1[1].Equals((byte) 187) || !buffer1[2].Equals((byte) 191))
- throw new CCustomException(2391U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
- byte_8 = new byte[buffer1.Length - 3];
- Array.Copy((Array) buffer1, 3, (Array) byte_8, 0, buffer1.Length - 3);
- encoding_0 = (Encoding) new UTF8Encoding();
- Class291.smethod_2(ref byte_8, encoding_0);
- break;
- case (byte) 254:
- if (!buffer1[1].Equals(byte.MaxValue))
- throw new CCustomException(2391U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
- byte_8 = new byte[buffer1.Length - 2];
- Array.Copy((Array) buffer1, 2, (Array) byte_8, 0, buffer1.Length - 2);
- encoding_0 = (Encoding) new UnicodeEncoding();
- Class291.smethod_2(ref byte_8, encoding_0);
- break;
- case byte.MaxValue:
- if (!buffer1[1].Equals((byte) 254))
- throw new CCustomException(2391U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
- byte_8 = new byte[buffer1.Length - 2];
- Array.Copy((Array) buffer1, 2, (Array) byte_8, 0, buffer1.Length - 2);
- encoding_0 = (Encoding) new UnicodeEncoding();
- Class291.smethod_2(ref byte_8, encoding_0);
- break;
- default:
- byte_8 = new byte[buffer1.Length];
- Array.Copy((Array) buffer1, 0, (Array) byte_8, 0, buffer1.Length);
- encoding_0 = enum43_0 != Class291.Enum43.const_4 ? (Encoding) new UTF8Encoding() : Encoding.GetEncoding(1252);
- Class291.smethod_2(ref byte_8, encoding_0);
- break;
- }
- }
- catch (CCustomException ex)
- {
- throw ex;
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- return encoding_0;
- }
- private static void smethod_2(ref byte[] byte_7, Encoding encoding_0)
- {
- try
- {
- string s = encoding_0.GetString(byte_7).TrimEnd(new char[1]);
- byte_7 = encoding_0.GetBytes(s);
- }
- catch (Exception ex)
- {
- if (!CCustomException.CheckErrorIDExsists(ex))
- ex.Source = 2390U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
- CCustomException.Rethrow(ex);
- }
- }
- private void method_12(Class291.Enum43 enum43_0, out string string_15, out string string_16)
- {
- if (enum43_0 == Class291.Enum43.const_4)
- {
- string_15 = this.string_10[IntPtr(1)];
- string_16 = this.string_11[IntPtr(1)];
- }
- else
- {
- string_15 = this.string_10[(IntPtr) (uint) enum43_0];
- string_16 = this.string_11[(IntPtr) (uint) enum43_0];
- }
- }
- public enum Enum43
- {
- const_0 = -1,
- const_1 = 0,
- const_2 = 1,
- const_3 = 2,
- const_4 = 25,
- }
- public enum Enum44
- {
- const_0,
- const_1,
- }
- public enum Enum45
- {
- const_0,
- const_1,
- const_2,
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement