示例#1
0
        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("Missing PARAM.PFD, Please load a valid directory");
            }
            if (!File.Exists(savedir + "\\PARAM.SFO"))
            {
                throw new Exception("Missing PARAM.SFO, Please load a valid directory");
            }
            Param_PFD = new Param_PFD(savedir + "\\PARAM.PFD");
            Param_SFO = new PARAM_SFO(savedir + "\\PARAM.SFO");

            getSetKey();

            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 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 = new BitmapImage
                {
                    StreamSource = (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();
        }
示例#3
0
        public Ps3SaveManager(Stream pfd, Stream sfo, Stream bin, string entryName, byte[] secureFileID)
        {
            Param_PFD = new Param_PFD(pfd);
            Param_SFO = new PARAM_SFO(sfo);
            if (secureFileID != null)
            {
                Param_PFD.SecureFileID = secureFileID;
            }
            RootPath = Directory.GetCurrentDirectory();

            Files = new Ps3File[] { new Ps3File(bin, entryName, Param_PFD.Entries.FirstOrDefault(s => s.FileName.ToUpper() == entryName), this) };
        }
        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();
        }