Ejemplo n.º 1
0
 public CentralDirectoryEnd(Stream stream, CustomBinaryReader reader)
 {
     DiskNumber             = reader.ReadInt16();
     DiskNumberWithCD       = reader.ReadInt16();
     DiskEntries            = reader.ReadInt16();
     TotalEntries           = reader.ReadInt16();
     CentralDirectorySize   = reader.ReadInt32();
     OffsetOfCdStartingDisk = reader.ReadInt32();
     CommentLength          = reader.ReadInt16();
     Comment = reader.ReadString(CommentLength);
 }
 public CentralDirectoryLocator(Stream stream, CustomBinaryReader reader)
 {
     unknownA = reader.ReadInt32();
     unknownB = reader.ReadInt32();
     unknownC = reader.ReadInt16();
     unknownD = reader.ReadInt16();
     unknownE = reader.ReadInt32();
     unknownF = reader.ReadInt32();
     DontentDictionaryCount = reader.ReadInt32();
     unknownG = reader.ReadInt32();
     ContentDictionaryCount2 = reader.ReadInt32();
     unknownH = reader.ReadInt32();
     ContentDictionarySize = reader.ReadInt32();
     unknownI = reader.ReadInt32();
     ContentDirectoryOffset = reader.ReadInt64();
 }
Ejemplo n.º 3
0
        public FileStructure(Stream stream, CustomBinaryReader reader)
        {
            if ((stream.Position - 4) % 0x1000 != 0)
            {
                throw new Exception("File Data Section Alignment Error (Pre Read)");
            }

            Version          = reader.ReadInt16();
            Flags            = reader.ReadInt16();
            CompressionMode  = (FileCompressionMode)reader.ReadInt16();
            ModificationTime = reader.ReadUInt16();
            ModificationDate = reader.ReadUInt16();
            CRC32            = reader.ReadInt32();
            CompressedSize   = reader.ReadInt32();
            UncompressedSize = reader.ReadInt32();
            FilenameLength   = reader.ReadInt16();
            ExtraLength      = reader.ReadInt16();

            Filename = reader.ReadString(FilenameLength);
            Extra    = new FileStructureExtraData(stream, reader, ExtraLength);
        }
Ejemplo n.º 4
0
            public FileStructureExtraData(Stream stream, CustomBinaryReader reader, int extra_length)
            {
                var end = stream.Position + extra_length;

                _UnknownID = reader.ReadInt16();
                StructureSizeAfterHeader = reader.ReadInt16();

                UncompressedFileLength = reader.ReadInt32();
                _UnknownD            = reader.ReadInt32();
                CompressedFileLength = reader.ReadInt32();
                _UnknownF            = reader.ReadInt32();

                var data_offset_ldword = (Int64)reader.ReadUInt32();
                var data_offset_hdword = (Int64)reader.ReadUInt32();

                DataOffset = data_offset_ldword + (data_offset_hdword << 32);

                _UnknownG = reader.ReadInt32();
                _Timestamp_Maybe_But_Not_Sure = reader.ReadInt32();

                // here be demons and lots of padding
                // make sure we read this to ensure the stream position is correct

                var padding_length = end - stream.Position;
                var data           = reader.ReadBytes((int)padding_length);

                if (stream.Position % 0x1000 != 0)
                {
                    throw new Exception("File Data Section Alignment Error (End Extra Read)");
                }

                FileDataOffset = stream.Position;
            }
Ejemplo n.º 5
0
 public CentralDirectoryLocatorOffset(Stream stream, CustomBinaryReader reader)
 {
     unknownA = reader.ReadInt32();
     DirectoryLocatorOffset = reader.ReadInt64();
     unknownB = reader.ReadInt32();
 }