Esempio n. 1
0
        public void FTP_UploadZIP(string string_4, ZipArchive zipArchive_0)
        {
            this.FTP_MakeDir(string_4);
            List <string> stringList = new List <string>();

            foreach (ZipArchiveEntry entry in zipArchive_0.Entries)
            {
                string directoryName = Path.GetDirectoryName(entry.FullName);
                if (!stringList.Contains(directoryName))
                {
                    stringList.Add(directoryName);
                    string[] strArray   = directoryName.Split('\\');
                    string   string_4_1 = string_4;
                    foreach (string str in strArray)
                    {
                        string_4_1 = string_4_1 + "/" + str;
                        this.FTP_MakeDir(string_4_1);
                    }
                }
            }
            foreach (ZipArchiveEntry entry in zipArchive_0.Entries)
            {
                if (!(entry.FullName == "meta.json"))
                {
                    string string_4_1 = Path.Combine(string_4, entry.FullName.Replace("\\", "/"));
                    if (!FTPConnection.smethod_1(string_4_1))
                    {
                        this.method_19(string_4_1, entry);
                    }
                }
            }
        }
Esempio n. 2
0
        public void method_7()
        {
            FTPConnection class600 = this.class60_0;

            if (class600 == null)
            {
                return;
            }
            class600.FTP_AbortFTP();
        }
Esempio n. 3
0
 public void method_13(bool bool_2)
 {
     try
     {
         FTPConnection.smethod_2(this.FTPIP, 21, this.FTPUser, this.FTPPassword, "REMO " + (bool_2 ? "Y" : "N"));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
Esempio n. 4
0
 public void method_12(string string_4)
 {
     try
     {
         FTPConnection.smethod_2(this.FTPIP, 21, this.FTPUser, this.FTPPassword, "INST install/" + string_4);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
Esempio n. 5
0
 public static int smethod_1(GClass82 gclass82_0, GClass30 gclass30_0)
 {
     try
     {
         byte[]      bytes       = new FTPConnection(gclass82_0.IPAddress_0.ToString(), "", "").method_7(string.Format("/storage_usb/usr/title/0005000e/{0}/meta/meta.xml", (object)gclass30_0.TitleId.High.ToLower()));
         XmlDocument xmlDocument = new XmlDocument();
         string      xml         = Encoding.UTF8.GetString(bytes).Trim('\xFEFF');
         xmlDocument.LoadXml(xml);
         return(int.Parse(xmlDocument.SelectSingleNode("/menu[@type=\"complex\"]/title_version[@type=\"unsignedInt\"]/text()").Value));
     }
     catch
     {
         return(-1);
     }
 }
Esempio n. 6
0
 public void method_8(string string_4, ZipArchive zipArchive_0, string string_5)
 {
     foreach (string str in this.method_4(string_4))
     {
         string string_5_1 = Path.Combine(string_5, str);
         if (FTPConnection.smethod_1(str))
         {
             this.method_8(Path.Combine(string_4, str) + "/", zipArchive_0, string_5_1);
         }
         else
         {
             this.method_17(Path.Combine(string_4, str), zipArchive_0, string_5_1);
         }
     }
 }
Esempio n. 7
0
        public static void BackupWiiUSave(GClass30 gclass30_0, IPAddress ipaddress_0, string string_0)
        {
            if (gclass30_0.TitleId.IdType != DownloadType.GameWiiOrU)
            {
                throw new Exception("You can only backup game saves!");
            }
            if (gclass30_0.System != SystemType.SystemWiiU)
            {
                throw new Exception("Save backup is only compatible with Wii U Games");
            }
            FTPConnection class60 = new FTPConnection(ipaddress_0.ToString(), "anonymous", "");

            if (!class60.method_4("/storage_usb/usr/save/00050000/").Contains(gclass30_0.TitleId.High.ToLower()))
            {
                throw new GException0();
            }
            class60.method_5("/storage_usb/usr/save/00050000/" + gclass30_0.TitleId.High.ToLower() + "/", string_0);
        }
Esempio n. 8
0
        private static bool smethod_2(string string_4, int int_2, string string_5, string string_6, string string_7)
        {
            bool flag = false;

            try
            {
                TcpClient tcpClient_0 = new TcpClient();
                tcpClient_0.Connect(string_4, int_2);
                FTPConnection.smethod_0(tcpClient_0);
                if (FTPConnection.smethod_3(tcpClient_0, "user " + string_5).Contains("331") && FTPConnection.smethod_3(tcpClient_0, "pass " + string_6).Contains("230") && FTPConnection.smethod_3(tcpClient_0, string_7).Contains("200"))
                {
                    flag = true;
                }
                tcpClient_0.Close();
            }
            catch (Exception ex)
            {
                Console.WriteLine("TransmitCommand exception: " + ex.Message);
            }
            return(flag);
        }
Esempio n. 9
0
 public void method_18(bool bool_6, GClass82 gclass82_0, bool bool_7, bool?nullable_0)
 {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     GClass30.Class51 class51 = new GClass30.Class51();
     // ISSUE: reference to a compiler-generated field
     class51.gclass30_0 = this;
     // ISSUE: reference to a compiler-generated field
     class51.bool_0 = bool_7;
     if (this.System != SystemType.SystemWiiU)
     {
         return;
     }
     this.CurrentlyUploaded = true;
     if (bool_6 && !this.method_20())
     {
         // ISSUE: reference to a compiler-generated field
         EventHandler <GClass81> eventHandler0 = this.eventHandler_0;
         if (eventHandler0 == null)
         {
             return;
         }
         eventHandler0((object)this, new GClass81("Download Corrupted", true, GEnum5.const_5));
     }
     else
     {
         // ISSUE: reference to a compiler-generated field
         class51.string_0 = this.String_6 + (this.CfwOnly ? " (CFW ONLY)" : "");
         // ISSUE: reference to a compiler-generated field
         class51.long_1 = ((IEnumerable <FileInfo>) new DirectoryInfo(this.OutputPath).GetFiles()).Sum <FileInfo>((Func <FileInfo, long>)(fileInfo_0 => fileInfo_0.Length));
         // ISSUE: reference to a compiler-generated field
         string string_4 = Path.Combine("/sd/Install/", class51.string_0);
         this.class60_0 = new FTPConnection(gclass82_0.IPAddress_0.ToString(), "anonymous", "");
         if (!this.class60_0.FTP_ListFiles())
         {
             // ISSUE: reference to a compiler-generated field
             EventHandler <GClass81> eventHandler0 = this.eventHandler_0;
             if (eventHandler0 == null)
             {
                 return;
             }
             eventHandler0((object)this, new GClass81("Could not connect to the WIIU", true, GEnum5.const_1));
         }
         else
         {
             if (nullable_0.HasValue)
             {
                 this.class60_0.method_13(nullable_0.Value);
             }
             this.class60_0.FTP_MakeDir("/sd/Install/");
             this.class60_0.FTP_MakeDir(string_4);
             // ISSUE: reference to a compiler-generated method
             this.class60_0.Event_1 += new EventHandler(class51.method_0);
             // ISSUE: reference to a compiler-generated field
             class51.long_0 = 0L;
             // ISSUE: reference to a compiler-generated field
             class51.dateTime_0 = DateTime.Now;
             // ISSUE: reference to a compiler-generated field
             class51.ulong_0 = 0UL;
             // ISSUE: reference to a compiler-generated method
             this.class60_0.Event_0 += new EventHandler <long>(class51.method_1);
             try
             {
                 this.class60_0.method_14(string_4, this.OutputPath);
             }
             catch (Exception ex)
             {
                 // ISSUE: reference to a compiler-generated field
                 EventHandler <GClass81> eventHandler0 = this.eventHandler_0;
                 if (eventHandler0 == null)
                 {
                     return;
                 }
                 eventHandler0((object)this, new GClass81(ex.Message, true, GEnum5.const_4));
             }
         }
     }
 }