示例#1
0
 /// <summary>
 /// DvdMenuReadSectors constructor
 /// </summary>
 /// <param name="path">path to iso with dvd-video</param>
 public DvdMenuReadSectors(string path)
 {
     try
     {
         this.fs = new FileStream(path, FileMode.Open, FileAccess.Read);
         this.br = new MyBinaryReader(this.fs);
     }
     catch (Exception ex)
     {
         throw new Exception("Error opening iso file", ex);
     }
 }
示例#2
0
        public XeXHeader(MemoryStream file)
        {
            MyBinaryReader reader;

            try
            {
                reader = new MyBinaryReader(file, EndianType.BigEndian);

                reader.BaseStream.Seek(0L, SeekOrigin.Begin);
                if (Encoding.ASCII.GetString(reader.ReadBytes(4)) == "XEX2")
                {
                    reader.BaseStream.Seek(20L, SeekOrigin.Begin);

                    uint headerCount = reader.ReadUInt32();
                    byte[] infoArray = new byte[] { 0, 4, 0, 6 };

                    for (int i = 0; i < headerCount; i++)
                    {
                        byte[] headerIdArray = reader.ReadBytes(4);

                        uint headerId = BitConverter.ToUInt32(headerIdArray, 0);

                        if (headerId == BitConverter.ToUInt32(infoArray, 0))
                        {
                            uint dataAddress = reader.ReadUInt32();

                            reader.BaseStream.Seek((long)dataAddress, SeekOrigin.Begin);
                            this.mediaId = reader.ReadBytes(4);
                            this.version = reader.ReadUInt32();
                            this.baseVersion = reader.ReadUInt32();
                            this.titleId = reader.ReadBytes(4);
                            this.platform = reader.ReadByte();
                            this.executableType = reader.ReadByte();
                            this.discNumber = reader.ReadByte();
                            this.discCount = reader.ReadByte();
                            break;
                        }
                        else
                        {
                            reader.ReadUInt32();
                        }
                    }
                }
                else throw new Exception("Extracted file is not XEX file");
            }
            catch (Exception ex)
            {
                throw ex;
            }

            reader.Close();
        }
示例#3
0
        public VTSM_PGCI_LU_MENU(byte[] array, int numberOfMenu)
        {
            MemoryStream ms = new MemoryStream(array);
            MyBinaryReader br = new MyBinaryReader(ms);

            br.Skip(8 + (numberOfMenu * 8));
            //byte a = br.ReadByte();
            isGameMenu = br.ReadByte() == (byte)0;
            br.Skip(3);
            startByteVTSM_PGCI = br.ReadInt32B();

            br.BaseStream.Seek(startByteVTSM_PGCI + 0xE8, SeekOrigin.Begin);
            short offsetCellPlaybackInformation = br.ReadInt16B();

            br.BaseStream.Seek(startByteVTSM_PGCI + offsetCellPlaybackInformation, SeekOrigin.Begin);
            br.Skip(8);
            sector = br.ReadInt32B();
        }
示例#4
0
        public VTSM_PGCI_UT(byte[] array)
        {
            try
            {
                MemoryStream ms = new MemoryStream(array);
                MyBinaryReader br = new MyBinaryReader(ms);

                numberOfVTSM_PGCI_LU = br.ReadInt16B();
                br.Skip(2);
                endByteOfVTSM_PGCI_LU = br.ReadInt32B();
                br.Skip(4);
                int LU_1startByte = br.ReadInt32B();
                br.BaseStream.Seek(LU_1startByte, SeekOrigin.Begin);
                menus = new VTSM_PGCI_LU_MENUS(br.ReadBytes(array.Length - LU_1startByte));
            }
            catch (Exception ex)
            {
                throw new Exception("Error searching sectors in DVD MENU", ex);
            }
        }
示例#5
0
文件: Iso.cs 项目: rejdzu/xkey-brew
 /// <summary>
 /// Open Iso file
 /// </summary>
 private void OpenIsoFile()
 {
     if (CheckPath())
     {
         try
         {
             this.file = new FileStream(this.filePath, FileMode.Open, FileAccess.Read);
             this.reader = new MyBinaryReader(this.file);
         }
         catch(Exception ex)
         {
             throw ex;
         }
     }
     else throw new Exception("Provided path is not correct");
 }