示例#1
0
        private void btnPKG_Click(object sender, EventArgs e)
        {
            #region << PeXploit PKG(s) >>
            if (radioButton2.Checked == true) //Package Install
            {
                openFileDialog2.Title = "Select PS3 PKG File";
                openFileDialog2.Filter = "PS3 PKG Files|*.pkg";
                openFileDialog2.InitialDirectory = System.Environment.SpecialFolder.MyComputer.ToString();
                if (openFileDialog2.ShowDialog() == DialogResult.OK)
                {
                    txtPKG.Text = openFileDialog2.FileName.ToString();
                    FileInfo ini = new FileInfo(txtPKG.Text);
                    pkgcount++;
                    string ReadPKGFileName = this.ReadPKGFile(txtPKG.Text,ini);
                    radioButton1.Enabled = false;
                    radioButton2.Enabled = false;
                    radioButton3.Enabled = false;
                    pkglist.Add(new DirectoryInfo(txtPKG.Text).FullName);//add the pkg to a list so we can do batch install still working out the kinks
                    packagelist.Items.Add(new FileInfo(txtPKG.Text).Name);
                    pkgcopyworker.RunWorkerAsync();
                }
            }
            #endregion << PeXploit PKG(s) >>

            #region << Bubble Install Method >>
            else if (radioButton1.Checked == true) // Bubble INstall Method
            {
                openFileDialog2.Title = "Select PS3 PKG File";
                openFileDialog2.Filter = "PS3 PKG Files|*.pkg";
                openFileDialog2.InitialDirectory = System.Environment.SpecialFolder.MyComputer.ToString();
                if (openFileDialog2.ShowDialog() == DialogResult.OK)
                {
                    txtPKG.Text = openFileDialog2.FileName.ToString();
                    FileInfo ini = new FileInfo(txtPKG.Text);
                    pkgcount++;
                    radioButton1.Enabled = false;
                    radioButton2.Enabled = false;
                    radioButton3.Enabled = false;
                    string decryptedPKGFileName = this.ReadPKGFile(txtPKG.Text, ini);
                    if ((decryptedPKGFileName != null) && (decryptedPKGFileName != string.Empty))
                    {
                        string str = null;
                        str = new pkg2sfo().DecryptPKGFile(decryptedPKGFileName);
                        if (Directory.Exists(Application.StartupPath + "\\edats"))
                        {
                            Directory.Delete(Application.StartupPath + "\\edats", true);
                        }
                    }
                    if (lblPackageType.Text != "Retail Package")
                    {
                        MessageBox.Show("Bubble Install Only Supports Retail C00 Packages");
                        return;
                    }
                    pkglist.Add(new DirectoryInfo(txtPKG.Text).FullName);//add the pkg to a list so we can do batch install still working out the kinks
                    packagelist.Items.Add(new FileInfo(txtPKG.Text).Name);
                    pkgcopyworker.RunWorkerAsync();
                }

            }
            #endregion << Bubble Install Method >>

            #region << PKG_View Extracted >>
            else if (radioButton3.Checked == true)
            {
                //open the browser to get the folder
                FolderBrowserDialog theDialog = new FolderBrowserDialog();
                theDialog.RootFolder = System.Environment.SpecialFolder.MyComputer;
                if (theDialog.ShowDialog() == DialogResult.OK)
                {
                    SFO_link.Visible = true;
                    pictureBox1.Visible = true;
                    radioButton1.Enabled = false;
                    radioButton2.Enabled = false;
                    radioButton3.Enabled = false;
                    try
                    {
                        this.Text = "PeXploit";
                        txtPKG.Text = theDialog.SelectedPath.ToString();
                        //Adding PKG(s) to the list
                        pkgcount++;
                        pkglist.Add(new DirectoryInfo(txtPKG.Text).FullName);//add the pkg to a list so we can do batch install still working out the kinks
                        packagelist.Items.Add(new FileInfo(txtPKG.Text).Name);
                        //Log it
                        log(new DirectoryInfo(txtPKG.Text).Name + " Added To List");
                        if (Directory.Exists(txtPKG.Text + @"\C00\"))
                        {
                            PARAM_SFO para = new PARAM_SFO(txtPKG.Text + @"\C00\PARAM.SFO");
                            pictureBox1.ImageLocation = theDialog.SelectedPath.ToString() + @"\C00\ICON0.PNG";
                            try
                            {
                                var file = File.ReadAllBytes(theDialog.SelectedPath.ToString() + @"\C00\PIC1.PNG");

                                pictureBox1.BackgroundImage = getImageFromBytes(file);
                            }
                            catch (Exception ee)
                            {

                            }
                            txtTitle.Text += para.TitleID;
                            txtDATA.Text += para.DataType;
                            this.Text += " : " + para.Title.Replace("???", "-");
                        }
                        else
                        {
                            PARAM_SFO para = new PARAM_SFO(txtPKG.Text + @"\PARAM.SFO");
                            pictureBox1.ImageLocation = theDialog.SelectedPath.ToString() + @"\ICON0.PNG";
                            try
                            {

                                var file = File.ReadAllBytes(theDialog.SelectedPath.ToString() + @"\PIC1.PNG");

                                pictureBox1.BackgroundImage = getImageFromBytes(file);
                            }
                            catch (Exception ee)
                            {

                            }
                            txtTitle.Text += para.TitleID;
                            txtDATA.Text += para.DataType;
                            this.Text += " : " + para.Title.Replace("???", "-");
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show("The Incorect PKG File Was Selected \n\rPKG Names Usally Starts With BLES,BLUS,NPEA\n\rA More Spesific Error Can Be Found Within The Errorlog", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        if (File.Exists("errorlog.txt"))
                            File.Delete("errorLog.txt");
                        System.IO.File.WriteAllText(Application.StartupPath + "\\errorlog.txt", ex.ToString());
                    }
                }
            }
            #endregion << PKG_View Extracted >>
        }
示例#2
0
 private static void pkg2edat(string infile)
 {
     string str = null;
     str = new pkg2sfo().DecryptPKGFile(infile);
     if (Directory.Exists("temp"))
     {
         Directory.Delete("temp", true);
     }
     if (str.EndsWith(".edat"))
     {
         Console.WriteLine("Created " + str);
     }
 }