コード例 #1
0
        public List <byte[]> FillListWithMenuSectors()
        {
            List <byte[]> result = new List <byte[]>();
            Dictionary <string, byte[]> files = GetFilesWithSectors();

            foreach (KeyValuePair <string, byte[]> kvp in files)
            {
                if (kvp.Key.ToUpper().Contains("_0.IFO"))
                {
                    //sector of ifo file
                    int  sector  = BitConverter.ToInt32(kvp.Value, 0);
                    long address = (long)sector * this.sectorSize;

                    //sector of vob file
                    int sectorVob = GetSectorOfVtsVob(kvp.Key);

                    if (sector > 0 && sectorVob > 0)
                    {
                        // jumt to 0x0D to read start offset of VTSM_PGCI_UT
                        br.BaseStream.Seek(address + 0xD0, SeekOrigin.Begin);

                        // get sector
                        int  startOffsetVTSM_PGCI_UT = br.ReadInt32B();
                        long addressVTSM_PGCI_UT     = address + ((long)startOffsetVTSM_PGCI_UT * this.sectorSize);

                        // jump to VTSM_PGCI_UT
                        br.BaseStream.Seek(addressVTSM_PGCI_UT, SeekOrigin.Begin);
                        br.ReadInt32B();
                        int  endByteVTSM_PGCI_UT    = br.ReadInt32B();
                        long addressEndVTSM_PGCI_UT = addressVTSM_PGCI_UT + endByteVTSM_PGCI_UT;

                        br.BaseStream.Seek(addressVTSM_PGCI_UT, SeekOrigin.Begin);
                        VTSM_PGCI_UT titleSetPGCI = new VTSM_PGCI_UT(br.ReadBytes(endByteVTSM_PGCI_UT));

                        for (int i = 0; i < titleSetPGCI.Menus.Count; i++)
                        {
                            if (i % 2 == 1 && titleSetPGCI.Menus[i].IsGameMenu)
                            {
                                int gameSector = sectorVob + titleSetPGCI.Menus[i].Sector;
                                result.Add(BitConverter.GetBytes(gameSector));
                            }
                        }
                    }
                }
            }

            return(result);
        }
コード例 #2
0
        public VTSM_PGCI_LU_MENU(byte[] array, int numberOfMenu)
        {
            MemoryStream   s      = new MemoryStream(array);
            MyBinaryReader reader = new MyBinaryReader(s);

            reader.Skip(8 + (numberOfMenu * 8));
            this.isGameMenu = reader.ReadByte() == 0;
            reader.Skip(3);
            this.startByteVTSM_PGCI = reader.ReadInt32B();
            reader.BaseStream.Seek((long)(this.startByteVTSM_PGCI + 0xe8), SeekOrigin.Begin);
            short num = reader.ReadInt16B();

            reader.BaseStream.Seek((long)(this.startByteVTSM_PGCI + num), SeekOrigin.Begin);
            reader.Skip(8);
            this.sector = reader.ReadInt32B();
        }
コード例 #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   s      = new MemoryStream(array);
         MyBinaryReader reader = new MyBinaryReader(s);
         this.numberOfVTSM_PGCI_LU = reader.ReadInt16B();
         reader.Skip(2);
         this.endByteOfVTSM_PGCI_LU = reader.ReadInt32B();
         reader.Skip(4);
         int num = reader.ReadInt32B();
         reader.BaseStream.Seek((long)num, SeekOrigin.Begin);
         this.menus = new VTSM_PGCI_LU_MENUS(reader.ReadBytes(array.Length - num));
     }
     catch (Exception exception)
     {
         throw new Exception("Error searching sectors in DVD MENU", exception);
     }
 }
コード例 #5
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);
            }
        }
コード例 #6
0
        public VTSM_PGCI_LU_MENUS(byte[] array)
        {
            MemoryStream   s      = new MemoryStream(array);
            MyBinaryReader reader = new MyBinaryReader(s);

            this.numberOfMenus = reader.ReadInt16B();
            reader.Skip(2);
            this.endByteOfLU_MENUS = reader.ReadInt32B();
            for (int i = 0; i < this.numberOfMenus; i++)
            {
                VTSM_PGCI_LU_MENU item = new VTSM_PGCI_LU_MENU(array, i);
                base.Add(item);
            }
        }
コード例 #7
0
        public VTSM_PGCI_LU_MENUS(byte[] array)
        {
            MemoryStream   ms = new MemoryStream(array);
            MyBinaryReader br = new MyBinaryReader(ms);

            numberOfMenus = br.ReadInt16B();
            br.Skip(2);
            endByteOfLU_MENUS = br.ReadInt32B();

            for (int i = 0; i < numberOfMenus; i++)
            {
                VTSM_PGCI_LU_MENU menu = new VTSM_PGCI_LU_MENU(array, i);
                this.Add(menu);
            }
        }