示例#1
0
        private PsvImgHeader readHeader()
        {
            PsvImgHeader header = new PsvImgHeader();

            header.SysTime    = readUInt64();
            header.Flags      = readUInt64();
            header.Statistics = readStats();
            _read(header.bParentPath, 0x00, 256);
            header.unk_16C = readUInt32();
            _read(header.bPath, 0x00, 256);
            _read(header.Padding, 0x00, 904);
            _read(header.bEnd, 0x00, 12);
            return(header);
        }
示例#2
0
        private void findFile(string path)
        {
            _seek(0x00, SeekOrigin.Begin);
            while (psvStream.Position < psvStream.Length)
            {
                PsvImgHeader header  = readHeader();
                long         size    = (long)header.Statistics.Size;
                long         padding = PSVIMGPadding.GetPadding(size);

                if (header.Path == path)
                {
                    length   = size;
                    startPos = psvStream.Position;
                    endPos   = startPos + length;
                    return;
                }
                else
                {
                    _seek(size + padding, SeekOrigin.Current);
                    PsvImgTailer tailer = readTailer();
                }
            }
            throw new FileNotFoundException("Cannot find file specified");
        }