示例#1
0
        public static void PatchISO(Stream file, IEnumerable <PatcherLib.Datatypes.PatchedByteArray> patches)
        {
            PspIsoInfo info = PspIsoInfo.GetPspIsoInfo(file);

            DecryptISO(file, info);
            patches.ForEach(p => ApplyPatch(file, info, p));
        }
示例#2
0
        /// <summary>
        /// Decrypts the ISO.
        /// </summary>
        /// <param name="filename">The filename of the ISO to decrypt.</param>
        public static void DecryptISO(string filename)
        {
            FileStream stream = null;

            try
            {
                stream = new FileStream(filename, FileMode.Open);
                PspIsoInfo info = PspIsoInfo.GetPspIsoInfo(stream);
                DecryptISO(stream, info);
            }
            catch (NotSupportedException)
            {
                throw;
            }
            finally
            {
                if (stream != null)
                {
                    stream.Flush();
                    stream.Close();
                    stream = null;
                }
            }
        }
示例#3
0
 public override void PatchIso(Stream iso, IList <byte> bytes)
 {
     PspIso.ApplyPatch(iso, PspIsoInfo.GetPspIsoInfo(iso), GetPatchedByteArray(bytes.ToArray()));
 }
示例#4
0
 public override byte[] ReadIso(Stream iso)
 {
     return(ReadIso(iso, PspIsoInfo.GetPspIsoInfo(iso)));
 }