Пример #1
0
            public FileDescriptor(Stream stream, uint index, long tableOffset)
            {
                Index            = index;
                Flags            = (CABFlags)stream.ReadUInt16();
                ExpandedSize     = stream.ReadUInt32();
                stream.Position += 4;
                CompressedSize   = stream.ReadUInt32();

                stream.Position += 4;
                DataOffset       = stream.ReadUInt32();
                stream.Position += 4;
                MD5              = stream.ReadBytes(16);

                stream.Position += 16;
                NameOffset       = stream.ReadUInt32();
                DirectoryIndex   = stream.ReadUInt16();
                stream.Position += 12;
                LinkToPrevious   = stream.ReadUInt32();
                LinkToNext       = stream.ReadUInt32();

                LinkFlags = (LinkFlags)stream.ReadUInt8();
                Volume    = stream.ReadUInt16();

                var pos = stream.Position;

                stream.Position = tableOffset + NameOffset;
                Filename        = stream.ReadASCIIZ();
                stream.Position = pos;
            }
Пример #2
0
            public FileDescriptor(Stream stream, uint index, long tableOffset)
            {
                Index = index;
                Flags = (CABFlags)stream.ReadUInt16();
                ExpandedSize = stream.ReadUInt32();
                stream.Position += 4;
                CompressedSize = stream.ReadUInt32();

                stream.Position += 4;
                DataOffset = stream.ReadUInt32();
                stream.Position += 4;
                MD5 = stream.ReadBytes(16);

                stream.Position += 16;
                NameOffset = stream.ReadUInt32();
                DirectoryIndex = stream.ReadUInt16();
                stream.Position += 12;
                LinkToPrevious = stream.ReadUInt32();
                LinkToNext = stream.ReadUInt32();

                LinkFlags = (LinkFlags)stream.ReadUInt8();
                Volume = stream.ReadUInt16();

                var pos = stream.Position;
                stream.Position = tableOffset + NameOffset;
                Filename = stream.ReadASCIIZ();
                stream.Position = pos;
            }