public Ps3SaveManager(string savedir, byte[] securefileid) { if (!Directory.Exists(savedir)) throw new Exception("No such directory exist!"); if (!File.Exists(savedir + "\\PARAM.PFD")) throw new Exception("Rootdirectory does not contain any PARAM.PFD, Please load a valid directory"); if (!File.Exists(savedir + "\\PARAM.SFO")) throw new Exception("Rootdirectory does not contain any PARAM.SFO, Please load a valid directory"); Param_PFD = new Param_PFD(savedir + "\\PARAM.PFD"); Param_SFO = new PARAM_SFO(savedir + "\\PARAM.SFO"); if (securefileid != null) Param_PFD.SecureFileID = securefileid; RootPath = savedir; if (File.Exists(savedir + "\\ICON0.PNG")) { //prevent file lock,reading to memory instead. SaveImage = Image.FromStream(new MemoryStream(File.ReadAllBytes(savedir + "\\ICON0.PNG"))); } Files = (from ent in Param_PFD.Entries let x = new FileInfo(savedir + "\\" + ent.file_name) where x.Extension.ToUpper() != ".PFD" && x.Extension.ToUpper() != ".SFO" select new Ps3File(savedir + "\\" + ent.file_name, ent, this)).ToArray(); }
public Ps3File(string filepath, Param_PFD.PFDEntry entry, Ps3SaveManager manager) { FilePath = filepath; PFDEntry = entry; Manager = manager; }