static void CleanMC1File(Iso9660.IsoImage iso, String filepath)
        {
            Assert.IsNotNull(iso, nameof(iso));
            Assert.IsValidString(filepath, nameof(filepath));

            var file   = iso.GetFile(filepath);
            var buffer = file.GetData();

            var count = BitConverter.ToUInt32(buffer, 0);

            for (var i = 0; i != count; ++i)
            {
                var offset = 16 + (i * 32);

                var key = System.Text.Encoding.ASCII.GetString(buffer, offset, 16).Trim('\0');

                if (Path.GetExtension(key) == ".bin")
                {
                    for (var ii = 0; ii != 32; ++ii)
                    {
                        buffer[offset + ii] = 0;
                    }
                }
            }
        }
        static void Update_datalst(Iso9660.IsoImage iso, String filepath)
        {
            Assert.IsNotNull(iso, nameof(iso));
            Assert.IsValidString(filepath, nameof(filepath));

            var datalist       = iso.GetFile(IsoFilePaths.FilePath_datalst);
            var datalistbuffer = datalist.GetData();
            var extensionslist = ReadDataLstExtensions(new FileReader(datalistbuffer, Encodings.ASCII));

            var filerecord = iso.GetFile(filepath);

            var index = FindDataLstIndex(filepath, datalistbuffer, extensionslist);

            BinaryIO.WriteIntoBuffer(datalistbuffer, index + 8, filerecord.Record.DataLength, Endian.LittleEndian);

            var sectorbytes = new Byte[4];

            BinaryIO.WriteIntoBuffer(sectorbytes, 0, filerecord.Record.SectorNumber, Endian.LittleEndian);

            for (var i = 0; i != 3; ++i)
            {
                datalistbuffer[index + 12 + i] = sectorbytes[i];
            }
        }
        static void ClearFileReference(Iso9660.IsoImage iso, String filepath, String key)
        {
            Assert.IsNotNull(iso, nameof(iso));
            Assert.IsValidString(filepath, nameof(filepath));
            Assert.IsValidString(key, nameof(key));

            var file       = iso.GetFile(filepath);
            var filebuffer = file.GetData();

            var keybytes = Encodings.ASCII.GetBytes(key);

            var find_index = FindIndex(filebuffer, 0, keybytes);

            if (find_index == -1)
            {
                return;
            }

            for (var i = 0; i != 32; ++i)
            {
                filebuffer[find_index + i] = 0;
            }
        }
        static void UpdateEboot(Iso9660.IsoImage iso, String ebootpath)
        {
            Assert.IsNotNull(iso, nameof(iso));
            Assert.IsValidString(ebootpath, nameof(ebootpath));

            var patches = BuildEbootPatches();
            var file    = iso.GetFile(@"PSP_GAME\SYSDIR\EBOOT.BIN");
            var buffer  = File.ReadAllBytes(ebootpath);

            foreach (var patch in patches)
            {
                if (patch.Type == BinaryPatchType.Clear)
                {
                    for (var i = 0; i != patch.Count; ++i)
                    {
                        buffer[patch.Offset + i] = 0;
                    }
                }

                if (patch.Type == BinaryPatchType.Overwrite)
                {
                    if (patch.Buffer != null)
                    {
                        Array.Copy(patch.Buffer, 0, buffer, patch.Offset, patch.Buffer.Length);
                    }

                    if (patch.Text != null)
                    {
                        var stringbytes = EncodedStringUtil.GetBytes(patch.Text, Encodings.ShiftJIS);
                        Array.Copy(stringbytes, 0, buffer, patch.Offset, stringbytes.Length);
                    }
                }
            }

            UpdateFileData(iso, file, buffer);
        }