예제 #1
0
        private void button13_Click(object sender, EventArgs e)
        {
            //Open File Items
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            openFileDialog1.Title = "Select PS4 File";

            openFileDialog1.CheckFileExists = true;

            openFileDialog1.CheckPathExists = true;

            openFileDialog1.Filter = "PS4 File (*.*)|*.*";

            openFileDialog1.RestoreDirectory = true;

            openFileDialog1.Multiselect = false;

            openFileDialog1.ReadOnlyChecked = true;

            openFileDialog1.ShowReadOnly = true;

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                var ps4filetype = PS4_Tools.Tools.Get_PS4_File_Type(openFileDialog1.FileName);
                MessageBox.Show("File is a " + ps4filetype.ToString());
                switch (ps4filetype)
                {
                case PS4_Tools.Tools.File_Type.PARAM_SFO:
                    var sfo = new Param_SFO.PARAM_SFO(openFileDialog1.FileName);
                    break;

                case PS4_Tools.Tools.File_Type.PS4_DDS:
                    var dd = PS4_Tools.Image.DDS.GetBytesFromDDS(openFileDialog1.FileName);
                    break;

                case PS4_Tools.Tools.File_Type.PS4_PKG:
                    var pkg = PS4_Tools.PKG.SceneRelated.Read_PKG(openFileDialog1.FileName);
                    break;

                case PS4_Tools.Tools.File_Type.UpdateFile:
                    var update   = new PS4_Tools.PUP();
                    var tempfile = update.Read_Pup(openFileDialog1.FileName);
                    break;

                case PS4_Tools.Tools.File_Type.ATRAC9:
                    var bytes = PS4_Tools.Media.Atrac9.LoadAt9(openFileDialog1.FileName);
                    System.Media.SoundPlayer player = new System.Media.SoundPlayer(new MemoryStream(bytes));
                    player.Play();
                    break;
                }
            }
        }
예제 #2
0
        private void btnPUPExtract_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

            openFileDialog1.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);

            openFileDialog1.Title = "Select PS4 PUP File";

            openFileDialog1.CheckFileExists = true;

            openFileDialog1.CheckPathExists = true;

            openFileDialog1.DefaultExt = "pup";

            openFileDialog1.Filter = "PS4 PUP File (*.pup)|*.pup";

            openFileDialog1.RestoreDirectory = true;

            openFileDialog1.Multiselect = false;

            openFileDialog1.ReadOnlyChecked = true;

            openFileDialog1.ShowReadOnly = true;



            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                //FolderBrowserDialog folderDlg = new FolderBrowserDialog();
                //folderDlg.ShowNewFolderButton = true;
                //// Show the FolderBrowserDialog.
                //if (folderDlg.ShowDialog() == DialogResult.OK)
                {
                    //PS4_Tools.PUP pupfunction = new PS4_Tools.PUP();
                    //pupfunction.Unpack_PUP(openFileDialog1.FileName, folderDlg.SelectedPath);
                    PS4_Tools.PUP pupfile = new PS4_Tools.PUP();
                    PS4_Tools.PUP.PlaystationUpdateFile pup = pupfile.Read_Pup(openFileDialog1.FileName);
                }
            }
        }