Ejemplo n.º 1
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) };
        }
Ejemplo n.º 2
0
 /// <summary>
 ///     Encrypts inputdata
 /// </summary>
 /// <param name="inputdata">the byte array of the file to encrypt</param>
 /// <param name="entry">the the entry inside the PARAM.PFD</param>
 /// <returns>true if succesfully encrypted</returns>
 public bool Encrypt(byte[] inputdata, Ps3File entry)
 {
     try
     {
         entry.PFDEntry.file_size = (ulong)inputdata.Length;
         var data = Encrypt(new MemoryStream(inputdata), entry.PFDEntry.file_name);
         if (data == null)
         {
             return(false);
         }
         File.WriteAllBytes(entry.FilePath, data);
         data = null;
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 ///     Encrypts inputdata
 /// </summary>
 /// <param name="inputdata">the byte array of the file to encrypt</param>
 /// <param name="entry">the the entry inside the PARAM.PFD</param>
 /// <returns>true if succesfully encrypted</returns>
 public bool Encrypt(byte[] inputdata, Ps3File entry)
 {
     try
     {
         entry.PFDEntry.file_size = (ulong) inputdata.Length;
         byte[] data = Encrypt(new MemoryStream(inputdata), entry.PFDEntry.file_name);
         if (data == null)
             return false;
         File.WriteAllBytes(entry.FilePath, data);
         data = null;
         return true;
     }
     catch
     {
         return false;
     }
 }