public void CreateSFX(PeXploit.PARAM_SFO psfo) { string FileHeader; if (version == Form1.Playstation.ps4) { //table items FileHeader = CreateSFXHeader(); string XMLItem = FileHeader + "\n<paramsfo>";//begin the tag foreach (var item in psfo.Tables) { XMLItem += "\n\t<param key=\"" + item.Name + "\">" + item.Value + "</param>"; } XMLItem += "\n</paramsfo>";//close the tag SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "PARAM.SFX | PARAM.SFX"; dlg.DefaultExt = "SFX"; dlg.AddExtension = true; dlg.FileName = "PARAM.SFX"; if (dlg.ShowDialog() == DialogResult.OK) { //user wants to save in a new location or whatever System.IO.File.WriteAllText(dlg.FileName, XMLItem, Encoding.UTF8); MessageBox.Show("File Saved"); System.Diagnostics.Process.Start("explorer.exe", System.IO.Path.GetDirectoryName(dlg.FileName)); } } else { MessageBox.Show("SFX For PS3 may be a bit buggy", "SFO Extarct", MessageBoxButtons.OK, MessageBoxIcon.Warning); FileHeader = CreateSFXHeader(); string XMLItem = FileHeader + "\n<paramsfo>";//begin the tag foreach (var item in psfo.Tables) { #region << Get Format >> var frmt = ""; if (item.Indextable.param_data_fmt == PeXploit.PARAM_SFO.FMT.ASCII) { frmt = "utf8-S"; } if (item.Indextable.param_data_fmt == PeXploit.PARAM_SFO.FMT.UINT32) { frmt = "int32"; } if (item.Indextable.param_data_fmt == PeXploit.PARAM_SFO.FMT.UTF_8) { frmt = "utf8"; } #endregion << Get Format >> XMLItem += "\n\t<param key=\"" + item.Name + "\"" + "fmt=\"" + frmt + "\" max_len=\"" + item.Indextable.param_data_max_len + "\"" + ">" + item.Value + "</param>"; } XMLItem += "\n</paramsfo>";//close the tag SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "PARAM.SFX | PARAM.SFX"; dlg.DefaultExt = "SFX"; dlg.AddExtension = true; dlg.FileName = "PARAM.SFX"; if (dlg.ShowDialog() == DialogResult.OK) { //user wants to save in a new location or whatever System.IO.File.WriteAllText(dlg.FileName, XMLItem, Encoding.UTF8); MessageBox.Show("File Saved"); System.Diagnostics.Process.Start("explorer.exe", System.IO.Path.GetDirectoryName(dlg.FileName)); } } }
public RawView(PeXploit.PARAM_SFO _sfo, Form1.Playstation _version) { pSFO = _sfo; version = _version; InitializeComponent(); }