public EncryptedPS3(string path) : base(path) { string region; using (var stream = new FileStream(Path.Combine(path, "PARAM.SFO"), FileMode.Open, FileAccess.Read)) { var buffer = new byte[9]; stream.Seek(0x968, SeekOrigin.Begin); stream.Read(buffer, 0, 9); region = Encoding.ASCII.GetString(buffer); } type = DetectPS3GameType(region); switch (type) { case GameType.RAC: manager = new Ps3SaveManager(path, new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0xFA, 0xCB, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10 }); break; case GameType.GC: manager = new Ps3SaveManager(path, new byte[] { 0xC0, 0xA3, 0xB3, 0x64, 0x1C, 0x2A, 0xD1, 0xEF, 0x23, 0x15, 0x3A, 0x48, 0xA3, 0xE1, 0x2F, 0xE8 }); break; case GameType.UYA: manager = new Ps3SaveManager(path, new byte[] { 0xC0, 0xA3, 0xB3, 0x64, 0x1C, 0x2A, 0xD1, 0xEF, 0x23, 0x15, 0x3A, 0x48, 0xA3, 0xE1, 0x2F, 0xE7 }); break; case GameType.QFB: manager = new Ps3SaveManager(path, new byte[] { 0xC0, 0xA3, 0xB3, 0x64, 0x1C, 0x2A, 0xD1, 0xEF, 0x23, 0x15, 0x3A, 0x48, 0xA3, 0xE1, 0x2F, 0xE7 }); break; default: manager = new Ps3SaveManager(path, new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }); break; } }
private void OpenPS3Save(string directory) { manager = new Ps3SaveManager(directory, secureFileId); Ps3File file = manager.Files.FirstOrDefault(t => t.PFDEntry.FileName == dataName); byte[] filedata = null; if (file != null) { filedata = file.DecryptToBytes(); } if (filedata == null) { return; } ReadFile(new MemoryStream(filedata)); }
static byte[] Decrypt(String dirpath) { //define the securefile id byte[] key = new byte[] { 0x77, 0x1D, 0x1C, 0x71, 0xE7, 0x5B, 0x4E, 0x70, 0x80, 0x38, 0x73, 0xF7, 0x40, 0x25, 0x11, 0xA7 }; //declare ps3 manager using the directory path, and the secure file id Ps3SaveManager manager = new Ps3SaveManager(dirpath, key); //get file entry using name Ps3File file = manager.Files.FirstOrDefault(t => t.PFDEntry.file_name == "REPLAY.0"); //define byte array that the decrypted data should be allocated byte[] filedata = null; //check if file is not null if (file != null) { filedata = file.DecryptToBytes(); } return(filedata); }
private void main1() { this.listView1.Items.Clear(); this.dirpath = this.textBox1.Text; this.fbd.SelectedPath = this.textBox1.Text; this.button2.Visible = true; this.button2.Enabled = true; string state; if (File.Exists(this.dirpath + "\\\\~decrypted.txt")) { this.button2.Text = "Encrypt"; state = "✓"; this.pictureBox1.Image = global::GSecPs3Decrypter.Properties.Resources.unlock; } else { this.button2.Text = "Decrypt"; state = "🔒"; this.pictureBox1.Image = global::GSecPs3Decrypter.Properties.Resources._lock; } try { //Ps3SaveManager ps3SaveManager = new Ps3SaveManager(this.textBox1.Text, this.key); //this.key = ps3SaveManager.GetSecureFileIdFromConfigFile_2(); for (int i = 0; i <= ps3SaveManager.Param_PFD.Entries.Length - 1; i++) { this.listView1.Items.Add("[" + state + "] " + ps3SaveManager.Param_PFD.Entries[i].file_name); } this.SetStatus("Loaded directory"); } catch (Exception z) { this.listView1.Items.Clear(); this.button2.Visible = false; this.button2.Enabled = false; this.pictureBox1.Image = global::GSecPs3Decrypter.Properties.Resources.icon; this.SetStatus(z.Message); } }
private void OpenPS3Save(Stream pfd, Stream sfo, Stream bin) { //declare ps3 manager using the directory path, and the secure file id manager = new Ps3SaveManager(pfd, sfo, bin, dataName, secureFileId); //get data file entry by name Ps3File file = manager.Files.FirstOrDefault(t => t.PFDEntry.FileName == dataName); byte[] filedata = null; //decrypt file to raw save bytes if (file != null) { filedata = file.DecryptToBytes(); } if (filedata == null) { return; } ReadFile(new MemoryStream(filedata)); }