Advertisement
Guest User

Untitled

a guest
Jan 1st, 2013
964
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 25.16 KB | None | 0 0
  1. // Type: Class291
  2. // Assembly: mototrbocps, Version=7.6.384.0, Culture=neutral, PublicKeyToken=null
  3. // Assembly location: C:\7.6\mototrbocps.exe
  4.  
  5. using custom_exception;
  6. using System;
  7. using System.Globalization;
  8. using System.IO;
  9. using System.IO.Compression;
  10. using System.Security.Cryptography;
  11. using System.Security.Cryptography.X509Certificates;
  12. using System.Text;
  13.  
  14. internal class Class291
  15. {
  16.   private static string[] string_12 = new string[2]
  17.   {
  18.     "mototrbocps",
  19.     "predefined"
  20.   };
  21.   private static string[] string_13 = new string[2]
  22.   {
  23.     "enE3biVqPUx8KnA5M3lvUQ",
  24.     "KlIkejNiMl8tJSN0RGtjMQ"
  25.   };
  26.   private static string[] string_14 = new string[2]
  27.   {
  28.     "<RSAKeyValue><Modulus>5AaKT6Hvh9+QrPWr5wugcqFjZWe54yW4/2sn6KAHKIrvvpD7J2x+elfDTry9DEx0U5dplG0SAtMNlXNV4PXU72Ze/yoeD/gfsGBGlmhpVCxkd0WvfSnSl5xe/WcCVJnyrjIQjRI47Aok7H3tjtshvq/LLKUtWxpxy4iGupbtv20=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>",
  29.     "<RSAKeyValue><Modulus>qZzUh3GihbzdI7wJxcIzvLX7X/7sTUSgjnmByopoISoAyFz+5rWpat+vGXswVaUAWK6htcWW2iGdDlyERK/U5jme2IB91CFjk9bSsmVx5RF3oTzNmxAh/cQ7qAwEi/3ffu+SzFSaZlZJ+1kKSwoM/qvVPXQjaYmu1F4YYD1k430=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>"
  30.   };
  31.   private string[] string_10 = new string[3]
  32.   {
  33.     "RmFAUjxmbWpLNmkqUUVWfUhoQ1Usd1BOP0ZpLVg7USQ",
  34.     "P1Ixd3swKE54MzUwOXhwWHtEVjM0biNLY1lNKzNRdnI",
  35.     "MntwRDhWSDxHM0Eod0YlWz5ddTxZemlVUz4zbmprOGY"
  36.   };
  37.   private string[] string_11 = new string[3]
  38.   {
  39.     "czp8KVtQfVU/bj9BbVBnIw",
  40.     "Qlg3VSxAJW5dOjM5cHJIMw",
  41.     "QTlhOFZ9cnY1JTE1a1Y2RQ"
  42.   };
  43.   private const int int_0 = 0;
  44.   public const int int_1 = 3;
  45.   private const int int_2 = 2;
  46.   private const int int_3 = 1024;
  47.   public const byte byte_0 = (byte) 239;
  48.   public const byte byte_1 = (byte) 187;
  49.   public const byte byte_2 = (byte) 191;
  50.   private const byte byte_3 = (byte) 254;
  51.   private const byte byte_4 = (byte) 255;
  52.   private const byte byte_5 = (byte) 255;
  53.   private const byte byte_6 = (byte) 254;
  54.   private const string string_0 = "|";
  55.   private const string string_1 = "Secure";
  56.   private const string string_2 = ", ";
  57.   private const char char_0 = '\0';
  58.   private const string string_3 = "<SIGNATURE>";
  59.   private const string string_4 = "</SIGNATURE>";
  60.   private const string string_5 = "<VERSION>";
  61.   private const string string_6 = "</VERSION>";
  62.   private const string string_7 = "1.0";
  63.   private const string string_8 = "<DIGEST>";
  64.   private const string string_9 = "</DIGEST>";
  65.  
  66.   static Class291()
  67.   {
  68.   }
  69.  
  70.   public static void smethod_0(string string_15, Class291.Enum44 enum44_0, ref string string_16)
  71.   {
  72.     try
  73.     {
  74.       if (string_16.IndexOf("<SIGNATURE>") != -1 && string_16.IndexOf("</SIGNATURE>") != -1)
  75.         throw new CCustomException(1840U, "Secure", "ApplySignature", ((object) Environment.StackTrace).ToString());
  76.       string str1 = Class291.string_12[(IntPtr) (uint) enum44_0];
  77.       string @string = Encoding.ASCII.GetString(Convert.FromBase64String(Class291.string_13[(IntPtr) (uint) enum44_0] + "=="));
  78.       byte[] hash = new SHA1Managed().ComputeHash(new UnicodeEncoding().GetBytes(string_16));
  79.       byte[] numArray;
  80.       string str2;
  81.       using (RSACryptoServiceProvider cryptoServiceProvider = (RSACryptoServiceProvider) new X509Certificate2(string_15 + str1, @string, X509KeyStorageFlags.MachineKeySet).PrivateKey)
  82.       {
  83.         numArray = cryptoServiceProvider.SignHash(hash, CryptoConfig.MapNameToOID("SHA1"));
  84.         str2 = cryptoServiceProvider.ToXmlString(false);
  85.       }
  86.       string str3 = BitConverter.ToString(numArray);
  87.       string str4 = "<VERSION>1.0</VERSION>";
  88.       string str5 = "<DIGEST>" + str3.Replace("-", "") + "</DIGEST>";
  89.       // ISSUE: explicit reference operation
  90.       // ISSUE: variable of a reference type
  91.       string& local = @string_16;
  92.       // ISSUE: explicit reference operation
  93.       string str6 = ^local + "<SIGNATURE>" + str4 + str5 + str2 + "</SIGNATURE>";
  94.       // ISSUE: explicit reference operation
  95.       ^local = str6;
  96.     }
  97.     catch (CCustomException ex)
  98.     {
  99.       throw ex;
  100.     }
  101.     catch (Exception ex)
  102.     {
  103.       if (!CCustomException.CheckErrorIDExsists(ex))
  104.         ex.Source = 1839U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  105.       CCustomException.Rethrow(ex);
  106.     }
  107.   }
  108.  
  109.   public static Class291.Enum45 smethod_1(Class291.Enum44 enum44_0, ref string string_15)
  110.   {
  111.     Class291.Enum45 enum45 = Class291.Enum45.const_1;
  112.     try
  113.     {
  114.       int startIndex1 = string_15.IndexOf("<SIGNATURE>");
  115.       int num1 = string_15.IndexOf("</SIGNATURE>");
  116.       if (startIndex1 != -1)
  117.       {
  118.         if (num1 != -1)
  119.         {
  120.           int num2 = string_15.IndexOf("<DIGEST>");
  121.           int num3 = string_15.IndexOf("</DIGEST>");
  122.           int startIndex2 = num2 + "<DIGEST>".Length;
  123.           int length1 = num3 - startIndex2;
  124.           string str = string_15.Substring(startIndex2, length1);
  125.           int startIndex3 = num3 + "</DIGEST>".Length;
  126.           int length2 = num1 - startIndex3;
  127.           string xmlString = string_15.Substring(startIndex3, length2);
  128.           if (xmlString != Class291.string_14[(IntPtr) (uint) enum44_0])
  129.             throw new CCustomException(1838U, "Secure", "VerifySignature", ((object) Environment.StackTrace).ToString());
  130.           string_15 = string_15.Remove(startIndex1);
  131.           byte[] hash = new SHA1Managed().ComputeHash(new UnicodeEncoding().GetBytes(string_15));
  132.           byte[] rgbSignature = new byte[str.Length / 2];
  133.           for (int index = 0; index < rgbSignature.Length; ++index)
  134.             rgbSignature[index] = Convert.ToByte(str.Substring(index * 2, 2), 16);
  135.           using (RSACryptoServiceProvider cryptoServiceProvider = new RSACryptoServiceProvider())
  136.           {
  137.             cryptoServiceProvider.FromXmlString(xmlString);
  138.             enum45 = !cryptoServiceProvider.VerifyHash(hash, CryptoConfig.MapNameToOID("SHA1"), rgbSignature) ? Class291.Enum45.const_0 : Class291.Enum45.const_2;
  139.           }
  140.         }
  141.       }
  142.     }
  143.     catch (CCustomException ex)
  144.     {
  145.       throw ex;
  146.     }
  147.     catch (Exception ex)
  148.     {
  149.       if (!CCustomException.CheckErrorIDExsists(ex))
  150.         ex.Source = 1839U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  151.       CCustomException.Rethrow(ex);
  152.     }
  153.     return enum45;
  154.   }
  155.  
  156.   public void method_0(string string_15, string string_16, bool bool_0, Class291.Enum43 enum43_0)
  157.   {
  158.     try
  159.     {
  160.       if (string.IsNullOrEmpty(string_15) || string.IsNullOrEmpty(string_16))
  161.         throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", EncryptFile", ((object) Environment.StackTrace).ToString());
  162.       if (!File.Exists(Path.GetFullPath(string_15)))
  163.         throw new CCustomException(2392U, "Secure", this.GetType().ToString() + ", EncryptFile", ((object) Environment.StackTrace).ToString());
  164.       string string_15_1;
  165.       string string_16_1;
  166.       this.method_12(enum43_0, out string_15_1, out string_16_1);
  167.       RijndaelManaged rijndaelManaged = new RijndaelManaged();
  168.       rijndaelManaged.Key = Convert.FromBase64String(string_15_1 + "=");
  169.       rijndaelManaged.IV = Convert.FromBase64String(string_16_1 + "==");
  170.       byte[] numArray = (byte[]) null;
  171.       byte[] byte_8 = (byte[]) null;
  172.       using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
  173.       {
  174.         numArray = new byte[fileStream.Length];
  175.         fileStream.Read(numArray, 0, numArray.Length);
  176.       }
  177.       this.method_10(numArray, ref byte_8, bool_0, rijndaelManaged.CreateEncryptor());
  178.       using (FileStream fileStream = new FileStream(string_16, FileMode.Create, FileAccess.Write))
  179.         fileStream.Write(byte_8, 0, byte_8.Length);
  180.     }
  181.     catch (CCustomException ex)
  182.     {
  183.       throw ex;
  184.     }
  185.     catch (Exception ex)
  186.     {
  187.       if (!CCustomException.CheckErrorIDExsists(ex))
  188.         ex.Source = 2393U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  189.       CCustomException.Rethrow(ex);
  190.     }
  191.   }
  192.  
  193.   public void method_1(byte[] byte_7, ref byte[] byte_8, bool bool_0, Class291.Enum43 enum43_0)
  194.   {
  195.     try
  196.     {
  197.       string string_15;
  198.       string string_16;
  199.       this.method_12(enum43_0, out string_15, out string_16);
  200.       RijndaelManaged rijndaelManaged = new RijndaelManaged();
  201.       rijndaelManaged.Key = Convert.FromBase64String(string_15 + "=");
  202.       rijndaelManaged.IV = Convert.FromBase64String(string_16 + "==");
  203.       byte[] byte_7_1 = new byte[byte_7.Length + 3];
  204.       byte_7_1[0] = (byte) 239;
  205.       byte_7_1[1] = (byte) 187;
  206.       byte_7_1[2] = (byte) 191;
  207.       Array.Copy((Array) byte_7, 0, (Array) byte_7_1, 3, byte_7.Length);
  208.       this.method_10(byte_7_1, ref byte_8, bool_0, rijndaelManaged.CreateEncryptor());
  209.     }
  210.     catch (CCustomException ex)
  211.     {
  212.       throw ex;
  213.     }
  214.     catch (Exception ex)
  215.     {
  216.       if (!CCustomException.CheckErrorIDExsists(ex))
  217.         ex.Source = 2393U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  218.       CCustomException.Rethrow(ex);
  219.     }
  220.   }
  221.  
  222.   public void method_2(string string_15, ref string string_16, bool bool_0, Class291.Enum43 enum43_0)
  223.   {
  224.     try
  225.     {
  226.       if (string.IsNullOrEmpty(string_15))
  227.         throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", EncryptFile", ((object) Environment.StackTrace).ToString());
  228.       if (!File.Exists(Path.GetFullPath(string_15)))
  229.         throw new CCustomException(2392U, "Secure", this.GetType().ToString() + ", EncryptFile", ((object) Environment.StackTrace).ToString());
  230.       string string_15_1;
  231.       string string_16_1;
  232.       this.method_12(enum43_0, out string_15_1, out string_16_1);
  233.       RijndaelManaged rijndaelManaged = new RijndaelManaged();
  234.       rijndaelManaged.Key = Convert.FromBase64String(string_15_1 + "=");
  235.       rijndaelManaged.IV = Convert.FromBase64String(string_16_1 + "==");
  236.       byte[] numArray = (byte[]) null;
  237.       byte[] byte_8 = (byte[]) null;
  238.       using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
  239.       {
  240.         numArray = new byte[fileStream.Length + 3L];
  241.         numArray[0] = (byte) 239;
  242.         numArray[1] = (byte) 187;
  243.         numArray[2] = (byte) 191;
  244.         fileStream.Read(numArray, 3, (int) fileStream.Length);
  245.       }
  246.       this.method_10(numArray, ref byte_8, bool_0, rijndaelManaged.CreateEncryptor());
  247.       string_16 = Encoding.UTF8.GetString(byte_8);
  248.     }
  249.     catch (CCustomException ex)
  250.     {
  251.       throw ex;
  252.     }
  253.     catch (Exception ex)
  254.     {
  255.       if (!CCustomException.CheckErrorIDExsists(ex))
  256.         ex.Source = 2393U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  257.       CCustomException.Rethrow(ex);
  258.     }
  259.   }
  260.  
  261.   public void method_3(string string_15, string string_16, bool bool_0)
  262.   {
  263.     try
  264.     {
  265.       TripleDESCryptoServiceProvider cryptoServiceProvider = new TripleDESCryptoServiceProvider();
  266.       cryptoServiceProvider.Key = Encoding.ASCII.GetBytes("HAVNCPSLTDTUNERAIRTRACER");
  267.       cryptoServiceProvider.IV = Encoding.ASCII.GetBytes("VEDKDJSP");
  268.       byte[] numArray = (byte[]) null;
  269.       byte[] byte_8 = (byte[]) null;
  270.       using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
  271.       {
  272.         numArray = new byte[fileStream.Length];
  273.         fileStream.Read(numArray, 0, numArray.Length);
  274.       }
  275.       this.method_10(numArray, ref byte_8, bool_0, cryptoServiceProvider.CreateEncryptor());
  276.       using (FileStream fileStream = new FileStream(string_16, FileMode.Create, FileAccess.Write))
  277.         fileStream.Write(byte_8, 0, byte_8.Length);
  278.     }
  279.     catch (CCustomException ex)
  280.     {
  281.       throw ex;
  282.     }
  283.     catch (Exception ex)
  284.     {
  285.       if (!CCustomException.CheckErrorIDExsists(ex))
  286.         ex.Source = 2393U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  287.       CCustomException.Rethrow(ex);
  288.     }
  289.   }
  290.  
  291.   public void method_4(string string_15, string string_16, bool bool_0, Class291.Enum43 enum43_0)
  292.   {
  293.     try
  294.     {
  295.       if (string.IsNullOrEmpty(string_15) || string.IsNullOrEmpty(string_16))
  296.         throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
  297.       if (!File.Exists(Path.GetFullPath(string_15)))
  298.         throw new CCustomException(2392U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
  299.       string string_15_1;
  300.       string string_16_1;
  301.       this.method_12(enum43_0, out string_15_1, out string_16_1);
  302.       RijndaelManaged rijndaelManaged = new RijndaelManaged();
  303.       rijndaelManaged.Key = Convert.FromBase64String(string_15_1 + "=");
  304.       rijndaelManaged.IV = Convert.FromBase64String(string_16_1 + "==");
  305.       byte[] numArray = (byte[]) null;
  306.       byte[] byte_8 = (byte[]) null;
  307.       using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
  308.       {
  309.         numArray = new byte[fileStream.Length];
  310.         fileStream.Read(numArray, 0, numArray.Length);
  311.       }
  312.       this.method_11(numArray, ref byte_8, bool_0, enum43_0, rijndaelManaged.CreateDecryptor());
  313.       using (FileStream fileStream = new FileStream(string_16, FileMode.OpenOrCreate, FileAccess.Write))
  314.         fileStream.Write(byte_8, 0, byte_8.Length);
  315.     }
  316.     catch (CCustomException ex)
  317.     {
  318.       throw ex;
  319.     }
  320.     catch (Exception ex)
  321.     {
  322.       if (!CCustomException.CheckErrorIDExsists(ex))
  323.         ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  324.       CCustomException.Rethrow(ex);
  325.     }
  326.   }
  327.  
  328.   public void method_5(byte[] byte_7, ref byte[] byte_8, bool bool_0, Class291.Enum43 enum43_0)
  329.   {
  330.     try
  331.     {
  332.       string string_15;
  333.       string string_16;
  334.       this.method_12(enum43_0, out string_15, out string_16);
  335.       RijndaelManaged rijndaelManaged = new RijndaelManaged();
  336.       rijndaelManaged.Key = Convert.FromBase64String(string_15 + "=");
  337.       rijndaelManaged.IV = Convert.FromBase64String(string_16 + "==");
  338.       this.method_11(byte_7, ref byte_8, bool_0, enum43_0, rijndaelManaged.CreateDecryptor());
  339.     }
  340.     catch (CCustomException ex)
  341.     {
  342.       throw ex;
  343.     }
  344.     catch (Exception ex)
  345.     {
  346.       if (!CCustomException.CheckErrorIDExsists(ex))
  347.         ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  348.       CCustomException.Rethrow(ex);
  349.     }
  350.   }
  351.  
  352.   public void method_6(string string_15, ref string string_16, bool bool_0, Class291.Enum43 enum43_0)
  353.   {
  354.     try
  355.     {
  356.       if (string.IsNullOrEmpty(string_15))
  357.         throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
  358.       if (!File.Exists(Path.GetFullPath(string_15)))
  359.         throw new CCustomException(2392U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
  360.       string string_15_1;
  361.       string string_16_1;
  362.       this.method_12(enum43_0, out string_15_1, out string_16_1);
  363.       RijndaelManaged rijndaelManaged = new RijndaelManaged();
  364.       rijndaelManaged.Key = Convert.FromBase64String(string_15_1 + "=");
  365.       rijndaelManaged.IV = Convert.FromBase64String(string_16_1 + "==");
  366.       byte[] numArray = (byte[]) null;
  367.       byte[] byte_8 = (byte[]) null;
  368.       using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
  369.       {
  370.         numArray = new byte[fileStream.Length];
  371.         fileStream.Read(numArray, 0, numArray.Length);
  372.       }
  373.       Encoding encoding = this.method_11(numArray, ref byte_8, bool_0, enum43_0, rijndaelManaged.CreateDecryptor());
  374.       string_16 = encoding.GetString(byte_8);
  375.     }
  376.     catch (CCustomException ex)
  377.     {
  378.       throw ex;
  379.     }
  380.     catch (Exception ex)
  381.     {
  382.       if (!CCustomException.CheckErrorIDExsists(ex))
  383.         ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  384.       CCustomException.Rethrow(ex);
  385.     }
  386.   }
  387.  
  388.   public void method_7(string string_15, string string_16, bool bool_0)
  389.   {
  390.     try
  391.     {
  392.       if (string.IsNullOrEmpty(string_15) || string.IsNullOrEmpty(string_16))
  393.         throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
  394.       if (!File.Exists(Path.GetFullPath(string_15)))
  395.         throw new CCustomException(2392U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
  396.       TripleDESCryptoServiceProvider cryptoServiceProvider = new TripleDESCryptoServiceProvider();
  397.       cryptoServiceProvider.Key = Encoding.ASCII.GetBytes("HAVNCPSLTDTUNERAIRTRACER");
  398.       cryptoServiceProvider.IV = Encoding.ASCII.GetBytes("VEDKDJSP");
  399.       byte[] numArray = (byte[]) null;
  400.       byte[] byte_8 = (byte[]) null;
  401.       using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
  402.       {
  403.         numArray = new byte[fileStream.Length];
  404.         fileStream.Read(numArray, 0, numArray.Length);
  405.       }
  406.       this.method_11(numArray, ref byte_8, bool_0, Class291.Enum43.const_0, cryptoServiceProvider.CreateDecryptor());
  407.       using (FileStream fileStream = new FileStream(string_16, FileMode.OpenOrCreate, FileAccess.Write))
  408.         fileStream.Write(byte_8, 0, byte_8.Length);
  409.     }
  410.     catch (CCustomException ex)
  411.     {
  412.       throw ex;
  413.     }
  414.     catch (Exception ex)
  415.     {
  416.       if (!CCustomException.CheckErrorIDExsists(ex))
  417.         ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  418.       CCustomException.Rethrow(ex);
  419.     }
  420.   }
  421.  
  422.   public void method_8(byte[] byte_7, ref byte[] byte_8, bool bool_0)
  423.   {
  424.     try
  425.     {
  426.       TripleDESCryptoServiceProvider cryptoServiceProvider = new TripleDESCryptoServiceProvider();
  427.       cryptoServiceProvider.Key = Encoding.ASCII.GetBytes("HAVNCPSLTDTUNERAIRTRACER");
  428.       cryptoServiceProvider.IV = Encoding.ASCII.GetBytes("VEDKDJSP");
  429.       this.method_11(byte_7, ref byte_8, bool_0, Class291.Enum43.const_0, cryptoServiceProvider.CreateDecryptor());
  430.     }
  431.     catch (CCustomException ex)
  432.     {
  433.       throw ex;
  434.     }
  435.     catch (Exception ex)
  436.     {
  437.       if (!CCustomException.CheckErrorIDExsists(ex))
  438.         ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  439.       CCustomException.Rethrow(ex);
  440.     }
  441.   }
  442.  
  443.   public void method_9(string string_15, ref string string_16, bool bool_0)
  444.   {
  445.     try
  446.     {
  447.       TripleDESCryptoServiceProvider cryptoServiceProvider = new TripleDESCryptoServiceProvider();
  448.       cryptoServiceProvider.Key = Encoding.ASCII.GetBytes("HAVNCPSLTDTUNERAIRTRACER");
  449.       cryptoServiceProvider.IV = Encoding.ASCII.GetBytes("VEDKDJSP");
  450.       byte[] numArray = (byte[]) null;
  451.       byte[] byte_8 = (byte[]) null;
  452.       using (FileStream fileStream = new FileStream(string_15, FileMode.Open, FileAccess.Read))
  453.       {
  454.         numArray = new byte[fileStream.Length];
  455.         fileStream.Read(numArray, 0, numArray.Length);
  456.       }
  457.       Encoding encoding = this.method_11(numArray, ref byte_8, bool_0, Class291.Enum43.const_0, cryptoServiceProvider.CreateDecryptor());
  458.       string_16 = encoding.GetString(byte_8);
  459.     }
  460.     catch (CCustomException ex)
  461.     {
  462.       throw ex;
  463.     }
  464.     catch (Exception ex)
  465.     {
  466.       if (!CCustomException.CheckErrorIDExsists(ex))
  467.         ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  468.       CCustomException.Rethrow(ex);
  469.     }
  470.   }
  471.  
  472.   private void method_10(byte[] byte_7, ref byte[] byte_8, bool bool_0, ICryptoTransform icryptoTransform_0)
  473.   {
  474.     try
  475.     {
  476.       if (byte_7 == null || byte_7.Length <= 0)
  477.         throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", EncryptFile", ((object) Environment.StackTrace).ToString());
  478.       if (bool_0)
  479.       {
  480.         using (MemoryStream memoryStream = new MemoryStream())
  481.         {
  482.           using (GZipStream gzipStream = new GZipStream((Stream) memoryStream, CompressionMode.Compress, true))
  483.             gzipStream.Write(byte_7, 0, byte_7.Length);
  484.           byte_7 = memoryStream.ToArray();
  485.         }
  486.       }
  487.       using (MemoryStream memoryStream = new MemoryStream())
  488.       {
  489.         using (CryptoStream cryptoStream = new CryptoStream((Stream) memoryStream, icryptoTransform_0, CryptoStreamMode.Write))
  490.         {
  491.           cryptoStream.Write(byte_7, 0, byte_7.Length);
  492.           cryptoStream.FlushFinalBlock();
  493.         }
  494.         byte_8 = memoryStream.ToArray();
  495.       }
  496.     }
  497.     catch (CCustomException ex)
  498.     {
  499.       throw ex;
  500.     }
  501.     catch (Exception ex)
  502.     {
  503.       if (!CCustomException.CheckErrorIDExsists(ex))
  504.         ex.Source = 2393U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  505.       CCustomException.Rethrow(ex);
  506.     }
  507.   }
  508.  
  509.   private Encoding method_11(byte[] byte_7, ref byte[] byte_8, bool bool_0, Class291.Enum43 enum43_0, ICryptoTransform icryptoTransform_0)
  510.   {
  511.     Encoding encoding_0 = (Encoding) null;
  512.     try
  513.     {
  514.       if (byte_7 == null)
  515.         throw new CCustomException(2388U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
  516.       byte[] buffer1 = new byte[byte_7.Length];
  517.       using (CryptoStream cryptoStream = new CryptoStream((Stream) new MemoryStream(byte_7), icryptoTransform_0, CryptoStreamMode.Read))
  518.         cryptoStream.Read(buffer1, 0, buffer1.Length);
  519.       if (bool_0)
  520.       {
  521.         using (GZipStream gzipStream = new GZipStream((Stream) new MemoryStream(buffer1), CompressionMode.Decompress, false))
  522.         {
  523.           byte[] buffer2 = new byte[4096];
  524.           using (MemoryStream memoryStream = new MemoryStream())
  525.           {
  526.             int count;
  527.             while ((count = gzipStream.Read(buffer2, 0, buffer2.Length)) > 0)
  528.               memoryStream.Write(buffer2, 0, count);
  529.             buffer1 = memoryStream.ToArray();
  530.           }
  531.         }
  532.       }
  533.       switch (buffer1[0])
  534.       {
  535.         case (byte) 239:
  536.           if (!buffer1[1].Equals((byte) 187) || !buffer1[2].Equals((byte) 191))
  537.             throw new CCustomException(2391U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
  538.           byte_8 = new byte[buffer1.Length - 3];
  539.           Array.Copy((Array) buffer1, 3, (Array) byte_8, 0, buffer1.Length - 3);
  540.           encoding_0 = (Encoding) new UTF8Encoding();
  541.           Class291.smethod_2(ref byte_8, encoding_0);
  542.           break;
  543.         case (byte) 254:
  544.           if (!buffer1[1].Equals(byte.MaxValue))
  545.             throw new CCustomException(2391U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
  546.           byte_8 = new byte[buffer1.Length - 2];
  547.           Array.Copy((Array) buffer1, 2, (Array) byte_8, 0, buffer1.Length - 2);
  548.           encoding_0 = (Encoding) new UnicodeEncoding();
  549.           Class291.smethod_2(ref byte_8, encoding_0);
  550.           break;
  551.         case byte.MaxValue:
  552.           if (!buffer1[1].Equals((byte) 254))
  553.             throw new CCustomException(2391U, "Secure", this.GetType().ToString() + ", DecryptFile", ((object) Environment.StackTrace).ToString());
  554.           byte_8 = new byte[buffer1.Length - 2];
  555.           Array.Copy((Array) buffer1, 2, (Array) byte_8, 0, buffer1.Length - 2);
  556.           encoding_0 = (Encoding) new UnicodeEncoding();
  557.           Class291.smethod_2(ref byte_8, encoding_0);
  558.           break;
  559.         default:
  560.           byte_8 = new byte[buffer1.Length];
  561.           Array.Copy((Array) buffer1, 0, (Array) byte_8, 0, buffer1.Length);
  562.           encoding_0 = enum43_0 != Class291.Enum43.const_4 ? (Encoding) new UTF8Encoding() : Encoding.GetEncoding(1252);
  563.           Class291.smethod_2(ref byte_8, encoding_0);
  564.           break;
  565.       }
  566.     }
  567.     catch (CCustomException ex)
  568.     {
  569.       throw ex;
  570.     }
  571.     catch (Exception ex)
  572.     {
  573.       if (!CCustomException.CheckErrorIDExsists(ex))
  574.         ex.Source = 2394U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  575.       CCustomException.Rethrow(ex);
  576.     }
  577.     return encoding_0;
  578.   }
  579.  
  580.   private static void smethod_2(ref byte[] byte_7, Encoding encoding_0)
  581.   {
  582.     try
  583.     {
  584.       string s = encoding_0.GetString(byte_7).TrimEnd(new char[1]);
  585.       byte_7 = encoding_0.GetBytes(s);
  586.     }
  587.     catch (Exception ex)
  588.     {
  589.       if (!CCustomException.CheckErrorIDExsists(ex))
  590.         ex.Source = 2390U.ToString((IFormatProvider) CultureInfo.InvariantCulture) + "|" + ex.Source;
  591.       CCustomException.Rethrow(ex);
  592.     }
  593.   }
  594.  
  595.   private void method_12(Class291.Enum43 enum43_0, out string string_15, out string string_16)
  596.   {
  597.     if (enum43_0 == Class291.Enum43.const_4)
  598.     {
  599.       string_15 = this.string_10[IntPtr(1)];
  600.       string_16 = this.string_11[IntPtr(1)];
  601.     }
  602.     else
  603.     {
  604.       string_15 = this.string_10[(IntPtr) (uint) enum43_0];
  605.       string_16 = this.string_11[(IntPtr) (uint) enum43_0];
  606.     }
  607.   }
  608.  
  609.   public enum Enum43
  610.   {
  611.     const_0 = -1,
  612.     const_1 = 0,
  613.     const_2 = 1,
  614.     const_3 = 2,
  615.     const_4 = 25,
  616.   }
  617.  
  618.   public enum Enum44
  619.   {
  620.     const_0,
  621.     const_1,
  622.   }
  623.  
  624.   public enum Enum45
  625.   {
  626.     const_0,
  627.     const_1,
  628.     const_2,
  629.   }
  630. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement