Esempio n. 1
0
        private void ReadFileSystemData(byte[] buffer, int fsOffset, XDvdFsFileSystemEntry parentEntry, ISOFileStreamer ifs)
        {
            if (fsOffset > buffer.Length)
            {
                throw new SystemException("Disaster");
            }
            XFSInputFile          ifile = new XFSInputFile(this, buffer, fsOffset);
            XDvdFsFileSystemEntry entry = new XDvdFsFileSystemEntry(ifile);

            entry.ParentNode = parentEntry;
            ushort num  = BitConverter.ToUInt16(buffer, fsOffset);
            ushort num2 = BitConverter.ToUInt16(buffer, fsOffset + 2);

            if (ifile.StartSector == -1)
            {
                throw new SystemException("Invalid TOC entry");
            }
            if (num != 0)
            {
                if ((num * 4) > buffer.Length)
                {
                    throw new SystemException("Disaster 2!");
                }
                this.ReadFileSystemData(buffer, num * 4, parentEntry, ifs);
            }
            if (ifile.IsFolder())
            {
                if ((ifile.StartSector == 0) || (ifile.GetFileLength() == 0L))
                {
                    parentEntry.Files.Add(entry);
                }
                else
                {
                    byte[] buffer2 = new byte[ifile.GetFileLength()];
                    ifs.GetNewFile(ifile);
                    ifs.Read(buffer2, 0, (int)ifile.GetFileLength());
                    parentEntry.Files.Add(entry);
                    this.ReadFileSystemData(buffer2, 0, entry, ifs);
                }
            }
            else
            {
                parentEntry.Files.Add(entry);
            }
            if (num2 != 0)
            {
                if ((num2 * 4) > buffer.Length)
                {
                    throw new SystemException("Disaster 3!");
                }
                this.ReadFileSystemData(buffer, num2 * 4, parentEntry, ifs);
            }
        }
Esempio n. 2
0
 public void GetNewFile(XFSInputFile xfs)
 {
     this.startOffset  = xfs.StartSector * 0x800L;
     this.startOffset += this._fsOffset;
     this.length       = xfs.GetFileLength();
     this.position     = 0L;
 }
Esempio n. 3
0
 public ISOFileStreamer(XFSInputFile xfs, long FileSystemOffset, BinaryReader instream)
 {
     this.startOffset  = xfs.StartSector * 0x800L;
     this._fsOffset    = FileSystemOffset;
     this.startOffset += this._fsOffset;
     this.length       = xfs.GetFileLength();
     this.instream     = instream;
 }