Example #1
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            //var gameselected = gamelist.Select(x => x.Title == comboBox1.SelectedText);
            var result = gamelist.Single(s => s.Title == comboBox1.SelectedItem);

            //poulate date
            label8.Text = "Game Title : " + result.Title;

            label5.Text = "Content ID : " + result.ContentID;

            PS4_Tools.PKG.SceneRelated.NP_Title titleid = new PS4_Tools.PKG.SceneRelated.NP_Title(result.nptitle);
            label6.Text = "NpTitle Id : " + titleid.Nptitle;

            PS4_Tools.PKG.SceneRelated.NP_Bind NP_Bind = new PS4_Tools.PKG.SceneRelated.NP_Bind(result.npbind);
            label7.Text = "Np Bind :  " + NP_Bind.Nptitle;

            txtPreviewTitle.Text = "Unlocker for " + result.Title;
        }
Example #2
0
        private void button4_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)
            {
                try
                {
                    PS4_Tools.PKG.SceneRelated.NP_Bind bind = new PS4_Tools.PKG.SceneRelated.NP_Bind(openFileDialog1.FileName);
                    //textBox4.Text = openFileDialog1.FileName;
                    label7.Text = "Np Bind : " + bind.Nptitle;
                }
                catch (Exception ex)
                {
                }
            }
        }
Example #3
0
        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                /*We moved to FTP Alot Easier*/
                UpdateProgress("Connection to ps4");
                // Get the object used to communicate with the server.
                gamelist = new List <GameInfo>();
                string url = "ftp://" + textBox1.Text + ":1337/user/home/";
                UpdateProgress("Checking user directory");
                //var list = ListFiles(url);
                FtpWebRequest ftpRequest = (FtpWebRequest)WebRequest.Create(url);
                ftpRequest.Credentials = new NetworkCredential("anonymous", "*****@*****.**");
                ftpRequest.Method      = WebRequestMethods.Ftp.ListDirectoryDetails;
                ftpRequest.UsePassive  = true;
                FtpWebResponse  response = (FtpWebResponse)ftpRequest.GetResponse();
                List <UserInfo> result   = new List <UserInfo>();
                using (StreamReader streamReader = new StreamReader(response.GetResponseStream()))
                {
                    string line = streamReader.ReadLine();
                    while (!string.IsNullOrEmpty(line))
                    {
                        var splitt = line.Split(' ');
                        if (splitt.Length == 10)//only do this when 10 items in array
                        {
                            UserInfo info = new UserInfo();

                            byte[] userinfo = DownloadFile(url + splitt[9] + "/username.dat");
                            info.UserId = splitt[9];
                            info.Name   = System.Text.Encoding.ASCII.GetString(userinfo);
                            UpdateProgress("User found ID" + info.UserId + " Name  " + info.Name);
                            result.Add(info);//save all user folders
                        }
                        line = streamReader.ReadLine();
                    }
                }
                UpdateProgress("Gatehring game info");
                //list all games here
                url                    = "ftp://" + textBox1.Text + ":1337/system_data/priv/appmeta/";
                ftpRequest             = (FtpWebRequest)WebRequest.Create(url);
                ftpRequest.Credentials = new NetworkCredential("anonymous", "*****@*****.**");
                ftpRequest.Method      = WebRequestMethods.Ftp.ListDirectoryDetails;
                ftpRequest.UsePassive  = true;
                response               = (FtpWebResponse)ftpRequest.GetResponse();

                using (StreamReader streamReader = new StreamReader(response.GetResponseStream()))
                {
                    string line = streamReader.ReadLine();
                    while (!string.IsNullOrEmpty(line))
                    {
                        var splitt = line.Split(' ');
                        if (splitt.Length == 9)//only do this when 10 items in array
                        {
                            if (splitt[8] != "..")
                            {
                                try
                                {
                                    GameInfo info = new GameInfo();


                                    UpdateProgress("Game found " + splitt[8]);
                                    UpdateProgress("Downloading Param.SFO for " + splitt[8]);
                                    byte[] paramsfo = DownloadFile(url + splitt[8] + "/param.sfo");
                                    info.param = paramsfo;
                                    UpdateProgress("Downloading nptitle.dat for " + splitt[8]);
                                    info.nptitle = DownloadFile(url + splitt[8] + "/nptitle.dat"); //System.Text.Encoding.ASCII.GetString(userinfo);
                                    UpdateProgress("Downloading npbind.dat for " + splitt[8]);
                                    info.npbind = DownloadFile(url + splitt[8] + "/npbind.dat");
                                    //get the TrophyFile
                                    UpdateProgress("Downloading TROPHY.TRP for " + splitt[8]);
                                    var    bindinfo = new PS4_Tools.PKG.SceneRelated.NP_Bind(info.npbind);
                                    string tmpurl   = "ftp://" + textBox1.Text + ":1337/user/trophy/conf/" + bindinfo.Nptitle + "/";
                                    info.TrophyFile = DownloadFile(tmpurl + "TROPHY.TRP");
                                    gamelist.Add(info);
                                    var sfofile = PS4_Tools.PKG.SceneRelated.PARAM_SFO.Get_Param_SFO(info.param);
                                    info.TitleId   = sfofile.TitleID;
                                    info.Title     = sfofile.Title;
                                    info.ContentID = sfofile.ContentID;
                                }
                                catch (Exception ex)
                                {
                                }
                            }
                        }
                        line = streamReader.ReadLine();
                    }
                }


                //FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://"+textBox1.Text + ":1337");
                //request.Method = WebRequestMethods.Ftp.DownloadFile;

                //// This example assumes the FTP site uses anonymous logon.
                //request.Credentials = new NetworkCredential("anonymous", "");

                //response = (FtpWebResponse)request.GetResponse();

                //Stream responseStream = response.GetResponseStream();
                //StreamReader reader = new StreamReader(responseStream);
                //Console.WriteLine(reader.ReadToEnd());

                //Console.WriteLine($"Download Complete, status {response.StatusDescription}");

                //reader.Close();
                //response.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error " + ex.Message, "Error while loading game data");
            }
        }