Ejemplo n.º 1
0
        private void button22_Click(object sender, EventArgs e)
        {
            PS4_Tools.Trophy_File trphy = new PS4_Tools.Trophy_File();
            var item = trphy.SealedTrophy(File.ReadAllBytes(@"D:\Users\3deEchelon\Desktop\PS4\RE\Ps4 Save Data Backup\10000000\trophy\data\NPWR04914_00\trophy.img"), File.ReadAllBytes(@"D:\Users\3deEchelon\Desktop\PS4\RE\Ps4 Save Data Backup\10000000\trophy\data\NPWR04914_00\sealedkey"));

            File.WriteAllBytes("testdecypt.dat", item);
        }
Ejemplo n.º 2
0
        private void button2_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
                {
                    var trp = new PS4_Tools.Trophy_File();
                    trp.Load(File.ReadAllBytes(openFileDialog1.FileName));
                    if (trp.FileCount == 0)
                    {
                        MessageBox.Show("Trophy file not valid");
                    }
                    //textBox2.Text = openFileDialog1.FileName;
                }
                catch (Exception ex)
                {
                }
            }
        }
Ejemplo n.º 3
0
 private void button19_Click(object sender, EventArgs e)
 {
     PS4_Tools.Trophy_File tphy = new PS4_Tools.Trophy_File();
     tphy.Load(File.ReadAllBytes(@"C:\Users\3deEchelon\Downloads\PlayStation 4 Trophies\PlayStation 4 Trophies\Adventures of Pip\data\NPWR09053_00\trophy.img"));
 }
Ejemplo n.º 4
0
        private void button21_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog();

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

            openFileDialog1.Title = "Select PS4 Trophy File";

            openFileDialog1.CheckFileExists = true;

            openFileDialog1.CheckPathExists = true;

            openFileDialog1.Filter = "PS4 Retail File (TROPHY.TRP)|TROPHY.TRP";

            openFileDialog1.RestoreDirectory = true;

            openFileDialog1.Multiselect = false;

            openFileDialog1.ReadOnlyChecked = true;

            openFileDialog1.ShowReadOnly = true;
            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                PS4_Tools.Trophy_File trophy = new PS4_Tools.Trophy_File();
                Stream stream     = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read);
                var    trophyfile = trophy.Load(stream);

                PS4_Tools.TROPHY.TROPCONF tconf;
                PS4_Tools.TROPHY.TROPTRNS tpsn;
                PS4_Tools.TROPHY.TROPUSR  tusr;

                DateTime ps3Time       = new DateTime(2008, 1, 1);
                DateTime randomEndTime = DateTime.Now;

                string NPCOMID   = "";
                string Diroftrpy = Path.GetDirectoryName(openFileDialog1.FileName);
                if (File.Exists(Diroftrpy + @"\TRPPARAM.INI"))
                {
                    string inifile = File.ReadAllText(Diroftrpy + @"\TRPPARAM.INI");
                    NPCOMID = getBetween(inifile, "NPCOMMID=", "TROPAPPVER=");
                    if (NPCOMID == "")
                    {
                        MessageBox.Show("Can not find NPCOMMID");
                        return;
                    }
                    NPCOMID = NPCOMID.TrimEnd();
                }
                for (int i = 0; i < trophyfile.trophyItemList.Count; i++)
                {
                    var    itembytes     = trophyfile.ExtractFileToMemory(trophyfile.trophyItemList[i].Name);
                    byte[] itemcontainer = null;
                    try
                    {
                        itemcontainer = PS4_Tools.Trophy_File.ESFM.LoadAndDecrypt(itembytes, NPCOMID);
                        File.WriteAllBytes(Application.StartupPath + @"\TropyFiles\" + trophyfile.trophyItemList[i].Name.Replace(".ESFM", ".SFM"), itemcontainer);
                    }
                    catch
                    {
                        File.WriteAllBytes(Application.StartupPath + @"\TropyFiles\" + trophyfile.trophyItemList[i].Name, itembytes);
                    }
                    //now we implement unlock all !
                    //okay lets begin

                    if (trophy.trophyItemList[i].Name == "TROPCONF.ESFM")
                    {
                        tconf = new PS4_Tools.TROPHY.TROPCONF(itemcontainer);
                    }
                    if (trophy.trophyItemList[i].Name == "TROPTRNS.DAT")
                    {
                        tpsn = new PS4_Tools.TROPHY.TROPTRNS(itemcontainer);
                    }
                    if (trophy.trophyItemList[i].Name == "TROPUSR.DAT")
                    {
                        tusr = new PS4_Tools.TROPHY.TROPUSR(itemcontainer);
                    }
                }
                MessageBox.Show("Trophy File Extraction and decryption completed");
            }
        }