Exemplo n.º 1
0
 public virtual void vmethod_1()
 {
     try
     {
         GClass6.smethod_5(this.CurrentGamePath);
     }
     catch
     {
     }
 }
Exemplo n.º 2
0
 public void method_3()
 {
     GClass6.smethod_6(this.String_1);
     GClass6.smethod_6(this.String_3);
     try
     {
         GClass6.smethod_5(this.String_5);
     }
     catch
     {
     }
 }
Exemplo n.º 3
0
 public bool method_11()
 {
     this.method_6();
     try
     {
         GClass6.smethod_5(this.OutputPath);
         return(true);
     }
     catch (Exception ex)
     {
         return(false);
     }
 }
Exemplo n.º 4
0
        private void cmdImport_Click(object sender, EventArgs e)
        {
            if (this.lstSaves.SelectedItem == null || RadMessageBox.Show("You are about to import a save. If you already have any local save data, it will be OVERWRITTEN. If you are using Cloud Saving, your cloud save will also be OVERWRITTEN. Continue?", "Continue?", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return;
            }
            GClass95 gclass95 = this.gclass32_0.method_14(false);

            GClass6.smethod_5(gclass95.FileSaveLocation);
            GClass27.smethod_7(string.Format("{0}/communitysaves/cdn/{1}", (object)Class67.CloudWiiUUSBHelperURL, (object)(this.lstSaves.SelectedItem.Tag as frmCommunitySaves.Class131).Md5), gclass95.FileSaveLocation);
            if (Settings.Default.EnableCloudSaving)
            {
                gclass95.method_2(gclass95.vmethod_0(), Settings.Default.CloudUserName, Settings.Default.CloudPassWord);
            }
            int num = (int)RadMessageBox.Show("Save imported!");
        }
Exemplo n.º 5
0
 internal GClass95(GClass30 gclass30_1, string string_2, string string_3, bool bool_3 = true, bool bool_4 = false)
 {
     this.gclass30_0 = gclass30_1;
     this.FullScreen = bool_4;
     this.Name       = string_2;
     try
     {
         if (!Directory.Exists(this.String_6))
         {
             Directory.CreateDirectory(this.String_6);
         }
     }
     catch (Exception ex)
     {
         int num = (int)RadMessageBox.Show("An error occured while initializing the emulators. Most likely you have unplugged the drive on which your games are stored. The emulation settings will now be cleared and the application will close.\n" + ex.ToString());
         try
         {
             GClass6.smethod_5(Path.Combine(GClass17.string_0));
         }
         catch
         {
         }
         Environment.Exit(0);
         return;
     }
     if (!Directory.Exists(this.String_5))
     {
         Directory.CreateDirectory(this.String_5);
     }
     if (!Directory.Exists(this.String_4))
     {
         Directory.CreateDirectory(this.String_4);
     }
     this.Url    = string_3;
     this.bool_0 = bool_3;
     if (!bool_3)
     {
         return;
     }
     this.method_1();
 }
Exemplo n.º 6
0
        public string method_9(bool bool_6, DriveInfo driveInfo_0)
        {
            string str1 = Path.Combine(Path.GetTempPath(), "ext_usb_helper");

            Directory.CreateDirectory(str1);
            if (bool_6 && !this.method_20())
            {
                return("Download Corrupted");
            }
            string str2 = Path.Combine(driveInfo_0.Name, "Install\\", this.String_6 + (this.CfwOnly ? " (CFW ONLY)" : ""));

            GClass6.smethod_5(str2);
            Directory.CreateDirectory(str2);
            if (this.System == GEnum3.const_1)
            {
                try
                {
                    FileSystem.CopyDirectory(this.OutputPath, str2, UIOption.AllDialogs);
                }
                catch (Exception ex)
                {
                    return(ex.Message);
                }
                return("OK");
            }
            if (this.System == GEnum3.const_0)
            {
                this.method_5(str1, "game");
                FileSystem.MoveFile(Path.Combine(str1, "game.cia"), Path.Combine(str2, "title.cia"), UIOption.AllDialogs);
                return("OK");
            }
            if (this.System != GEnum3.const_3)
            {
                throw new NotImplementedException();
            }
            this.method_10(Path.Combine(driveInfo_0.Name, "wads"), this.String_6 + ".wad");
            return("OK");
        }
Exemplo n.º 7
0
 public virtual void vmethod_2()
 {
     GClass6.smethod_5(this.WorkPath);
     System.IO.Directory.CreateDirectory(this.WorkPath);
     GClass6.smethod_5(this.ToInject.OutputPath);
 }
Exemplo n.º 8
0
 public override void vmethod_2()
 {
     base.vmethod_2();
     Task.Run((Action)(() =>
     {
         try
         {
             string string_0_1 = this.Force43 ? string.Format("{0}/res/nintendont/autoboot43.dol", (object)Class67.String_2) : "https://cdn.wiiuusbhelper.com/res/nintendont/autoboot.dol";
             this.method_11(0);
             string string_0_2 = this.method_4("rawFiles\\content\\hif_000000.nfs");
             string str1 = this.method_4("rawFiles\\content\\game.iso");
             string path1 = this.method_4("new-image\\");
             string sourceFileName1 = this.method_4(Alphaleonis.Win32.Filesystem.Path.Combine(path1, "PunEmu [CEMU69].iso"));
             string sourceFileName2 = this.method_4("nfs2iso2nfs.exe");
             string str2 = this.method_4("rawFiles\\content\\nfs2iso2nfs.exe");
             string path2 = this.method_4("rawFiles\\content\\hif_000000.nfs");
             string sourceFileName3 = this.method_4("workdir.tmp2\\ticket.bin");
             string str3 = this.method_4("rawFiles\\code\\rvlt.tik");
             string sourceFileName4 = this.method_4("workdir.tmp2\\tmd.bin");
             string str4 = this.method_4("rawFiles\\code\\rvlt.tmd");
             string str5 = this.method_4("production_output");
             string str6 = this.method_4("output");
             string string_0_3 = this.method_4("workdir.tmp\\");
             string string_1 = this.method_4(Alphaleonis.Win32.Filesystem.Path.Combine(string_0_3, "sys", "main.dol"));
             string[] strArray = new string[2]
             {
                 this.method_4("workdir.tmp\\files\\game.iso"),
                 this.method_4("workdir.tmp\\files\\disc2.iso")
             };
             GClass6.smethod_8("https://cdn.wiiuusbhelper.com/res/nintendont/vc-template.zip", this.WorkPath);
             GClass6.smethod_5(this.method_4("workdir.tmp2"));
             GClass6.smethod_5(str5);
             GClass6.smethod_5(str6);
             GClass6.smethod_6(str4);
             GClass6.smethod_6(str3);
             GClass6.smethod_6(string_0_2);
             GClass6.smethod_6(str1);
             GClass6.smethod_6(str2);
             Task task = this.method_7();
             this.method_11(1);
             if (this.string_3 != null && this.ToInject.Platform == Platform.Gamecube)
             {
                 new GClass78().method_5(string_0_1, string_1, 0UL, GClass78.GEnum4.const_0, (WebProxy)null, 0L, (byte[])null, (byte[])null, (byte)0);
                 for (int index = 0; index < this.string_3.Length; ++index)
                 {
                     if (this.CompressIso)
                     {
                         this.method_15(this.string_3[index], strArray[index]);
                     }
                     else
                     {
                         Alphaleonis.Win32.Filesystem.File.Copy(this.string_3[index], strArray[index]);
                     }
                 }
                 if (!Alphaleonis.Win32.Filesystem.File.Exists(strArray[0]))
                 {
                     throw new Exception("The iso was not shrinked sucessfully. Cannot continue.");
                 }
             }
             if (this.ToInject.Platform == Platform.Wii_Custom)
             {
                 if (this.PatchWifi)
                 {
                     if (((IEnumerable <string>) new string[3]
                     {
                         "RMCP01",
                         "RMCE01",
                         "RMCJ01"
                     }).Contains <string>(this.ToInject.ProductId))
                     {
                         Alphaleonis.Win32.Filesystem.File.Copy(this.string_3[0], this.method_4(Alphaleonis.Win32.Filesystem.Path.GetFileName(this.string_3[0])));
                         using (MemoryStream memoryStream = new MemoryStream(new GClass78().method_2(string.Format("{0}/res/Wii/mk_patcher.zip", (object)Class67.String_2))))
                         {
                             using (ZipArchive zipArchive_0 = new ZipArchive((Stream)memoryStream))
                                 zipArchive_0.smethod_0(this.WorkPath, true);
                         }
                         GClass91.smethod_0("patch-wiimmfi.bat", this.WorkPath);
                         GClass6.smethod_6(this.method_4(Alphaleonis.Win32.Filesystem.Path.GetFileName(this.string_3[0])));
                         sourceFileName1 = new Alphaleonis.Win32.Filesystem.DirectoryInfo(this.method_4("wiimmfi-images/")).GetFiles()[0].FullName;
                     }
                     else if (((IEnumerable <string>) new string[3]
                     {
                         "RSBP01",
                         "RSBE01",
                         "RSBJ01"
                     }).Contains <string>(this.ToInject.ProductId))
                     {
                         GClass91.smethod_1(this.method_4("PackOnline.bat"), this.WorkPath, string.Format("\"{0}\"", (object)this.string_3[0]));
                         sourceFileName1 = Alphaleonis.Win32.Filesystem.Path.Combine(path1, "patched.iso");
                     }
                     else
                     {
                         GClass6.smethod_5(string_0_3);
                         GClass91.smethod_1(this.method_4("Extract.bat"), this.WorkPath, string.Format("\"{0}\"", (object)this.string_3[0]));
                         GClass91.smethod_0(this.method_4("Pack.bat"), this.WorkPath);
                         GClass6.smethod_5(string_0_3);
                         string fullName = new Alphaleonis.Win32.Filesystem.DirectoryInfo(path1).GetFiles()[0].FullName;
                         GClass91.smethod_1(this.method_4("PackOnline.bat"), this.WorkPath, string.Format("\"{0}\"", (object)fullName));
                         GClass6.smethod_6(fullName);
                         sourceFileName1 = Alphaleonis.Win32.Filesystem.Path.Combine(path1, "patched.iso");
                     }
                 }
                 else
                 {
                     GClass6.smethod_5(string_0_3);
                     GClass91.smethod_1(this.method_4("Extract.bat"), this.WorkPath, string.Format("\"{0}\"", (object)this.string_3[0]));
                     GClass91.smethod_0(this.method_4("Pack.bat"), this.WorkPath);
                     GClass6.smethod_5(string_0_3);
                     string fullName = new Alphaleonis.Win32.Filesystem.DirectoryInfo(path1).GetFiles()[0].FullName;
                     Alphaleonis.Win32.Filesystem.File.Move(fullName, Alphaleonis.Win32.Filesystem.Path.Combine(Alphaleonis.Win32.Filesystem.Path.GetDirectoryName(fullName), "game.iso"));
                     sourceFileName1 = Alphaleonis.Win32.Filesystem.Path.Combine(Alphaleonis.Win32.Filesystem.Path.GetDirectoryName(fullName), "game.iso");
                 }
             }
             else if (this.ToInject.Platform == Platform.Gamecube)
             {
                 GClass91.smethod_0(this.method_4("Pack.bat"), this.WorkPath);
                 GClass6.smethod_5(string_0_3);
                 sourceFileName1 = new Alphaleonis.Win32.Filesystem.DirectoryInfo(path1).GetFiles()[0].FullName;
             }
             this.method_11(2);
             GClass91.smethod_1(this.method_4("GetTik.bat"), this.WorkPath, string.Format("\"{0}\"", (object)sourceFileName1));
             GClass6.smethod_6(strArray[0]);
             GClass6.smethod_6(strArray[1]);
             Alphaleonis.Win32.Filesystem.File.Copy(sourceFileName3, str3);
             Alphaleonis.Win32.Filesystem.File.Copy(sourceFileName4, str4);
             Alphaleonis.Win32.Filesystem.File.Move(sourceFileName1, str1);
             Alphaleonis.Win32.Filesystem.File.Copy(sourceFileName2, str2);
             if (this.ToInject.Platform == Platform.Gamecube)
             {
                 GClass91.smethod_1(str2, Alphaleonis.Win32.Filesystem.Path.GetDirectoryName(str2), "-homebrew -passthrough");
             }
             else if (this.ToInject.Platform == Platform.Wii_Custom)
             {
                 GClass91.smethod_1(str2, Alphaleonis.Win32.Filesystem.Path.GetDirectoryName(str2), "-passthrough");
             }
             if (!Alphaleonis.Win32.Filesystem.File.Exists(path2))
             {
                 throw new Exception("Injection did not complete sucessfully. Cannot continue.");
             }
             GClass6.smethod_6(str1);
             GClass6.smethod_6(str2);
             this.method_11(3);
             task.Wait();
             this.vmethod_3();
             if (this.Production)
             {
                 this.method_3(str6, str5);
             }
             GClass6.smethod_5(this.method_4("workdir.tmp2"));
             GClass6.smethod_5(this.method_4("tmp"));
             GClass6.smethod_6(string_0_2);
             this.method_8();
             this.method_9();
         }
         catch (Exception ex)
         {
             this.method_10(ex);
         }
     }));
 }
Exemplo n.º 9
0
        public bool method_14()
        {
            if (this.PatchGame == null)
            {
                throw new Exception("This game is not patchable!");
            }
            GClass30 title = (GClass30)GClass28.dictionary_0[this.PatchGame];

            if (RadMessageBox.Show(string.Format("This title is a modified version of {0}.\nUSB Helper can build an iso for you by automatically patching the game from the eShop.\nThis way you do not have to provide the iso.\nProceed? (About {1}MB will of data will be downloaded)", (object)title.Name, (object)this.PatchSize), "Proceed?", MessageBoxButtons.YesNo) != DialogResult.Yes)
            {
                return(false);
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            GClass94.Class79 class79 = new GClass94.Class79();
            if (title.GEnum2_0 != GEnum2.const_2)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                GClass94.Class80 class80  = new GClass94.Class80();
                GClass80         gclass80 = new GClass80((WebProxy)null, true, true);
                // ISSUE: reference to a compiler-generated field
                class80.frmWait_0 = new FrmWait("USB Helper is downloading the base game", true);
                // ISSUE: reference to a compiler-generated method
                gclass80.Event_6 += new EventHandler <GEventArgs0>(class80.method_0);
                // ISSUE: reference to a compiler-generated method
                gclass80.Event_5 += new EventHandler <GClass81>(class80.method_1);
                gclass80.method_1(((IEnumerable <GClass30>) new GClass30[1]
                {
                    title
                }).ToList <GClass30>(), 100, 10000);
                // ISSUE: reference to a compiler-generated field
                int num = (int)class80.frmWait_0.ShowDialog();
            }
            Dolphin dolphin = new Dolphin(title, false);

            dolphin.method_5();
            string rom = dolphin.GetRom();

            // ISSUE: reference to a compiler-generated field
            class79.string_0 = new Alphaleonis.Win32.Filesystem.DirectoryInfo(rom).Parent.FullName;
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            class79.string_1 = Alphaleonis.Win32.Filesystem.Path.Combine(class79.string_0, "workdir.tmp");
            // ISSUE: reference to a compiler-generated field
            // ISSUE: reference to a compiler-generated field
            class79.string_2 = Alphaleonis.Win32.Filesystem.Path.Combine(class79.string_0, "patch.uhd");
            dolphin.method_12(true);
            int num1;
            // ISSUE: reference to a compiler-generated method
            FrmWait frmWait1 = new FrmWait("USB Helper is preparing the game...", new Action(class79.method_0), (Action <Exception>)(exception_0 => num1 = (int)RadMessageBox.Show(exception_0.ToString())));

            // ISSUE: reference to a compiler-generated field
            class79.frmWait_0 = new FrmWait("USB Helper is downloading the differential data", true);
            WebClient webClient = new WebClient();

            // ISSUE: reference to a compiler-generated method
            webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(class79.method_1);
            // ISSUE: reference to a compiler-generated method
            webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(class79.method_2);
            // ISSUE: reference to a compiler-generated field
            webClient.DownloadFileAsync(new Uri(string.Format("{0}/res/Wii/template/{1}/patch.uhd", (object)Class67.String_2, (object)this.ToInject.ProductId)), class79.string_2);
            // ISSUE: reference to a compiler-generated field
            int num2 = (int)class79.frmWait_0.ShowDialog();
            int num3;
            // ISSUE: reference to a compiler-generated method
            FrmWait frmWait2 = new FrmWait("USB HELPER is patching the game...", new Action(class79.method_3), (Action <Exception>)(exception_0 => num3 = (int)RadMessageBox.Show(exception_0.ToString())));

            // ISSUE: reference to a compiler-generated field
            GClass6.smethod_6(class79.string_2);
            // ISSUE: reference to a compiler-generated field
            GClass6.smethod_5(class79.string_1);
            // ISSUE: reference to a compiler-generated field
            if (!this.vmethod_0(new Alphaleonis.Win32.Filesystem.DirectoryInfo(Alphaleonis.Win32.Filesystem.Path.Combine(class79.string_0, "new-image")).GetFiles()[0].FullName))
            {
                throw new Exception("The output iso was not recognized!");
            }
            int num4 = (int)new frmInjectionAnimation((GClass91)this).ShowDialog();

            dolphin.method_12(true);
            // ISSUE: reference to a compiler-generated field
            GClass6.smethod_5(Alphaleonis.Win32.Filesystem.Path.Combine(class79.string_0, "rawFiles"));
            return(true);
        }
Exemplo n.º 10
0
 public static void smethod_7(GClass32 gclass32_0, GClass82 gclass82_0, Form form_1)
 {
     // ISSUE: object of a compiler-generated type is created
     // ISSUE: variable of a compiler-generated type
     Class97.Class100 class100 = new Class97.Class100();
     // ISSUE: reference to a compiler-generated field
     class100.gclass32_0 = gclass32_0;
     // ISSUE: reference to a compiler-generated field
     class100.gclass82_0 = gclass82_0;
     // ISSUE: reference to a compiler-generated field
     class100.form_0 = form_1;
     // ISSUE: reference to a compiler-generated field
     if (class100.gclass82_0 == null)
     {
         // ISSUE: reference to a compiler-generated field
         Class97.smethod_16(class100.form_0);
     }
     else
     {
         if (RadMessageBox.Show("USB Helper will now try to import your save from your Wii U to CEMU. This will OVERWRITE any save you already have on your computer AND on your USB Helper Cloud if enabled. Continue?", "Continue?", MessageBoxButtons.YesNo) == DialogResult.No)
         {
             return;
         }
         // ISSUE: reference to a compiler-generated field
         class100.string_0 = (string)null;
         // ISSUE: reference to a compiler-generated field
         class100.frmWait_0 = new FrmWait("Please wait while USB Helper downloads your save.", false);
         // ISSUE: reference to a compiler-generated method
         Task.Run(new Action(class100.method_0));
         // ISSUE: reference to a compiler-generated field
         int num = (int)class100.frmWait_0.ShowDialog();
         // ISSUE: reference to a compiler-generated field
         if (class100.string_0 != null)
         {
             // ISSUE: reference to a compiler-generated field
             Cemu   cemu             = class100.gclass32_0.method_14(false) as Cemu;
             string fileSaveLocation = cemu.FileSaveLocation;
             GClass6.smethod_5(fileSaveLocation);
             Directory.CreateDirectory(fileSaveLocation);
             // ISSUE: reference to a compiler-generated field
             using (FileStream fileStream = File.OpenRead(class100.string_0))
             {
                 using (ZipArchive source = new ZipArchive((Stream)fileStream))
                     source.ExtractToDirectory(fileSaveLocation);
             }
             string str = Path.Combine(fileSaveLocation, "user");
             if (Directory.Exists(str))
             {
                 try
                 {
                     Directory.Move(((IEnumerable <DirectoryInfo>) new DirectoryInfo(str).GetDirectories()).First <DirectoryInfo>((Func <DirectoryInfo, bool>)(directoryInfo_0 => GClass6.smethod_4(directoryInfo_0.Name))).FullName, Path.Combine(str, "80000001"));
                     if (Settings.Default.EnableCloudSaving)
                     {
                         cemu.method_2(cemu.vmethod_0(), Settings.Default.CloudUserName, Settings.Default.CloudPassWord);
                     }
                 }
                 catch
                 {
                 }
             }
         }
         else
         {
             // ISSUE: reference to a compiler-generated field
             Class97.smethod_15(class100.form_0, "Could not import your save.");
         }
         // ISSUE: reference to a compiler-generated field
         class100.frmWait_0.method_0();
     }
 }
Exemplo n.º 11
0
 public static void smethod_0(string string_0, string string_1, string string_2)
 {
     GClass6.smethod_5(string_2);
     Alphaleonis.Win32.Filesystem.Directory.CreateDirectory(string_2);
     GClass4.smethod_3(string_0);
     using (FileStream fileStream1 = Alphaleonis.Win32.Filesystem.File.OpenRead(string_1))
     {
         using (ZipArchive zipArchive = new ZipArchive((Stream)fileStream1, ZipArchiveMode.Read, false, (Encoding)null, (CompressionSettings)null, GClass4.encryptionSettings_0))
         {
             string[] strArray1 = (string[])null;
             using (ZipArchiveEntry entry = zipArchive.GetEntry("usb_helper_fst"))
             {
                 using (StreamReader streamReader = new StreamReader(entry.Open()))
                     strArray1 = streamReader.ReadToEnd().Split(new string[1]
                     {
                         Environment.NewLine
                     }, StringSplitOptions.RemoveEmptyEntries);
             }
             byte[] buffer = new byte[1024];
             foreach (string str1 in strArray1)
             {
                 char[] chArray = new char[1] {
                     ':'
                 };
                 string[] strArray2 = str1.Split(chArray);
                 string   str2      = strArray2[0];
                 string   entryName = strArray2[1];
                 string   str3      = Alphaleonis.Win32.Filesystem.Path.Combine(string_2, entryName);
                 string   str4      = Alphaleonis.Win32.Filesystem.Path.Combine(string_0, entryName);
                 Alphaleonis.Win32.Filesystem.Path.GetDirectoryName(str3);
                 using (MD5.Create())
                 {
                     if (!(str2 == "CRT"))
                     {
                         if (!(str2 == "COP"))
                         {
                             if (str2 == "DIR")
                             {
                                 Alphaleonis.Win32.Filesystem.Directory.CreateDirectory(str3);
                             }
                         }
                         else
                         {
                             GClass4.smethod_1(str4, strArray2[2]);
                             Alphaleonis.Win32.Filesystem.File.Copy(str4, str3, true);
                         }
                     }
                     else
                     {
                         using (FileStream fileStream2 = Alphaleonis.Win32.Filesystem.File.Create(str3))
                         {
                             using (ZipArchiveEntry entry = zipArchive.GetEntry(entryName))
                             {
                                 using (Stream stream = entry.Open())
                                 {
                                     int count;
                                     do
                                     {
                                         count = stream.Read(buffer, 0, buffer.Length);
                                         fileStream2.Write(buffer, 0, count);
                                     }while (count > 0);
                                 }
                             }
                         }
                         GClass4.smethod_1(str3, strArray2[2]);
                     }
                 }
             }
         }
     }
 }