Beispiel #1
0
 private void _read()
 {
     _header           = new FileHeader(m_io, this, m_root);
     _pathName         = m_io.ReadBytes((Header.PathNameSize - 1));
     _stringTerminator = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(StringTerminator, new byte[] { 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0 }, StringTerminator, M_Io, "/types/file/seq/2");
     }
     if (KaitaiStream.Mod(Header.PathNameSize, 2) == 1)
     {
         _pathNamePadding = m_io.ReadBytes(1);
         if (!((KaitaiStream.ByteArrayCompare(PathNamePadding, new byte[] { 0 }) == 0)))
         {
             throw new ValidationNotEqualError(new byte[] { 0 }, PathNamePadding, M_Io, "/types/file/seq/3");
         }
     }
     _fileData = m_io.ReadBytes(Header.FileSize.Value);
     if (KaitaiStream.Mod(Header.FileSize.Value, 2) == 1)
     {
         _fileDataPadding = m_io.ReadBytes(1);
         if (!((KaitaiStream.ByteArrayCompare(FileDataPadding, new byte[] { 0 }) == 0)))
         {
             throw new ValidationNotEqualError(new byte[] { 0 }, FileDataPadding, M_Io, "/types/file/seq/5");
         }
     }
     if ((((KaitaiStream.ByteArrayCompare(PathName, new byte[] { 84, 82, 65, 73, 76, 69, 82, 33, 33, 33 }) == 0)) && (Header.FileSize.Value == 0)))
     {
         _endOfFilePadding = m_io.ReadBytesFull();
     }
 }
Beispiel #2
0
 private void _read()
 {
     _lenProperty = m_io.ReadU4be();
     _ofsName = m_io.ReadU4be();
     _property = m_io.ReadBytes(LenProperty);
     _padding = m_io.ReadBytes(KaitaiStream.Mod(-(M_Io.Pos), 4));
 }
 private void _read()
 {
     _id        = m_io.EnsureFixedContents(new byte[] { 83, 68, 78, 65 });
     _nameMagic = m_io.EnsureFixedContents(new byte[] { 78, 65, 77, 69 });
     _numNames  = m_io.ReadU4le();
     _names     = new List <string>((int)(NumNames));
     for (var i = 0; i < NumNames; i++)
     {
         _names.Add(System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytesTerm(0, false, true, true)));
     }
     _padding1  = m_io.ReadBytes(KaitaiStream.Mod((4 - M_Io.Pos), 4));
     _typeMagic = m_io.EnsureFixedContents(new byte[] { 84, 89, 80, 69 });
     _numTypes  = m_io.ReadU4le();
     _types     = new List <string>((int)(NumTypes));
     for (var i = 0; i < NumTypes; i++)
     {
         _types.Add(System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytesTerm(0, false, true, true)));
     }
     _padding2  = m_io.ReadBytes(KaitaiStream.Mod((4 - M_Io.Pos), 4));
     _tlenMagic = m_io.EnsureFixedContents(new byte[] { 84, 76, 69, 78 });
     _lengths   = new List <ushort>((int)(NumTypes));
     for (var i = 0; i < NumTypes; i++)
     {
         _lengths.Add(m_io.ReadU2le());
     }
     _padding3   = m_io.ReadBytes(KaitaiStream.Mod((4 - M_Io.Pos), 4));
     _strcMagic  = m_io.EnsureFixedContents(new byte[] { 83, 84, 82, 67 });
     _numStructs = m_io.ReadU4le();
     _structs    = new List <DnaStruct>((int)(NumStructs));
     for (var i = 0; i < NumStructs; i++)
     {
         _structs.Add(new DnaStruct(m_io, this, m_root));
     }
 }
Beispiel #4
0
            private void _read()
            {
                _id            = m_io.ReadU4le();
                _len           = m_io.ReadU4le();
                __raw_dataSlot = m_io.ReadBytes(Len);
                var io___raw_dataSlot = new KaitaiStream(__raw_dataSlot);

                _dataSlot = new Slot(io___raw_dataSlot, this, m_root);
                _padByte  = m_io.ReadBytes(KaitaiStream.Mod(Len, 2));
            }
Beispiel #5
0
 private void _read()
 {
     _id = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Id, new byte[] { 83, 68, 78, 65 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 83, 68, 78, 65 }, Id, M_Io, "/types/dna1_body/seq/0");
     }
     _nameMagic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(NameMagic, new byte[] { 78, 65, 77, 69 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 78, 65, 77, 69 }, NameMagic, M_Io, "/types/dna1_body/seq/1");
     }
     _numNames = m_io.ReadU4le();
     _names    = new List <string>();
     for (var i = 0; i < NumNames; i++)
     {
         _names.Add(System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytesTerm(0, false, true, true)));
     }
     _padding1  = m_io.ReadBytes(KaitaiStream.Mod((4 - M_Io.Pos), 4));
     _typeMagic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(TypeMagic, new byte[] { 84, 89, 80, 69 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 84, 89, 80, 69 }, TypeMagic, M_Io, "/types/dna1_body/seq/5");
     }
     _numTypes = m_io.ReadU4le();
     _types    = new List <string>();
     for (var i = 0; i < NumTypes; i++)
     {
         _types.Add(System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytesTerm(0, false, true, true)));
     }
     _padding2  = m_io.ReadBytes(KaitaiStream.Mod((4 - M_Io.Pos), 4));
     _tlenMagic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(TlenMagic, new byte[] { 84, 76, 69, 78 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 84, 76, 69, 78 }, TlenMagic, M_Io, "/types/dna1_body/seq/9");
     }
     _lengths = new List <ushort>();
     for (var i = 0; i < NumTypes; i++)
     {
         _lengths.Add(m_io.ReadU2le());
     }
     _padding3  = m_io.ReadBytes(KaitaiStream.Mod((4 - M_Io.Pos), 4));
     _strcMagic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(StrcMagic, new byte[] { 83, 84, 82, 67 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 83, 84, 82, 67 }, StrcMagic, M_Io, "/types/dna1_body/seq/12");
     }
     _numStructs = m_io.ReadU4le();
     _structs    = new List <DnaStruct>();
     for (var i = 0; i < NumStructs; i++)
     {
         _structs.Add(new DnaStruct(m_io, this, m_root));
     }
 }
Beispiel #6
0
 private void _read()
 {
     _fileVersion      = m_io.ReadU2be();
     _fileMagic        = m_io.EnsureFixedContents(new byte[] { 82, 76, 68, 87 });
     _fileStartsOnDisk = m_io.ReadU2be();
     _backupStartTime  = m_io.ReadU4be();
     _headerOffset     = m_io.ReadU4be();
     _fileNameLen      = m_io.ReadU1();
     _fileName         = System.Text.Encoding.GetEncoding("ascii").GetString(m_io.ReadBytes(FileNameLen));
     _fileNamePadding  = m_io.ReadBytes((31 - FileNameLen));
     _filePart         = m_io.ReadU2be();
     _folderFlags      = m_io.ReadU1();
     _validityFlag     = m_io.ReadU1();
     if (FolderFlags == 0)
     {
         __raw_finfoData = m_io.ReadBytes(16);
         var io___raw_finfoData = new KaitaiStream(__raw_finfoData);
         _finfoData = new FinfoDataStruct(io___raw_finfoData, this, m_root);
     }
     if (FolderFlags == 0)
     {
         __raw_fxinfoData = m_io.ReadBytes(16);
         var io___raw_fxinfoData = new KaitaiStream(__raw_fxinfoData);
         _fxinfoData = new FxinfoDataStruct(io___raw_fxinfoData, this, m_root);
     }
     if (FolderFlags != 0)
     {
         __raw_dinfoData = m_io.ReadBytes(16);
         var io___raw_dinfoData = new KaitaiStream(__raw_dinfoData);
         _dinfoData = new DinfoDataStruct(io___raw_dinfoData, this, m_root);
     }
     if (FolderFlags != 0)
     {
         __raw_dxinfoData = m_io.ReadBytes(16);
         var io___raw_dxinfoData = new KaitaiStream(__raw_dxinfoData);
         _dxinfoData = new DxinfoDataStruct(io___raw_dxinfoData, this, m_root);
     }
     _fileAttributes           = m_io.ReadU1();
     _fileReserved             = m_io.ReadU1();
     _creationDate             = m_io.ReadU4be();
     _modificationDate         = m_io.ReadU4be();
     _dataForkLength           = m_io.ReadU4be();
     _resourceForkLength       = m_io.ReadU4be();
     _dataForkInFileLength     = m_io.ReadU4be();
     _resourceForkInFileLength = m_io.ReadU4be();
     _fullFilePathLength       = m_io.ReadU2be();
     _fullFilePath             = System.Text.Encoding.GetEncoding("ascii").GetString(m_io.ReadBytes(FullFilePathLength));
     _dataFork     = m_io.ReadBytes(DataForkInFileLength);
     _resourceFork = m_io.ReadBytes(ResourceForkInFileLength);
     if ((((512 - KaitaiStream.Mod((((112 + DataForkInFileLength) + ResourceForkInFileLength) + FullFilePathLength), 512)) != 512) || ((M_Parent.M_Parent.BackupDiskHeader.DiskNumber - M_Parent.M_Parent.BackupDiskHeader.TotalDisks) == 0)))
     {
         _filePadding = m_io.ReadBytes((512 - KaitaiStream.Mod((((112 + DataForkInFileLength) + ResourceForkInFileLength) + FullFilePathLength), 512)));
     }
 }
Beispiel #7
0
 private void _read()
 {
     _lenDirName    = m_io.ReadU1();
     _lenExtAttrRec = m_io.ReadU1();
     _lbaExtent     = m_io.ReadU4le();
     _parentDirIdx  = m_io.ReadU2le();
     _dirName       = System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytes(LenDirName));
     if (KaitaiStream.Mod(LenDirName, 2) == 1)
     {
         _padding = m_io.ReadU1();
     }
 }
Beispiel #8
0
 private void _read()
 {
     _valueSize       = m_io.ReadU4le();
     _headerSize      = m_io.ReadU4le();
     _type            = new UnicodeOrId(m_io, this, m_root);
     _name            = new UnicodeOrId(m_io, this, m_root);
     _padding1        = m_io.ReadBytes(KaitaiStream.Mod((4 - M_Io.Pos), 4));
     _formatVersion   = m_io.ReadU4le();
     _flags           = m_io.ReadU2le();
     _language        = m_io.ReadU2le();
     _valueVersion    = m_io.ReadU4le();
     _characteristics = m_io.ReadU4le();
     _value           = m_io.ReadBytes(ValueSize);
     _padding2        = m_io.ReadBytes(KaitaiStream.Mod((4 - M_Io.Pos), 4));
 }
Beispiel #9
0
 private void _read()
 {
     _lenChunkHeader = m_io.ReadU2le();
     _blockSize      = m_io.ReadU4le();
     {
         uint M_ = BlockSize;
         if (!(KaitaiStream.Mod(M_, 4) == 0))
         {
             throw new ValidationExprError(BlockSize, M_Io, "/types/file_header/seq/1");
         }
     }
     _numBlocks = m_io.ReadU4le();
     _numChunks = m_io.ReadU4le();
     _checksum  = m_io.ReadU4le();
 }
Beispiel #10
0
 private void _read()
 {
     _lenExtAttrRec     = m_io.ReadU1();
     _lbaExtent         = new U4bi(m_io, this, m_root);
     _sizeExtent        = new U4bi(m_io, this, m_root);
     _datetime          = new Datetime(m_io, this, m_root);
     _fileFlags         = m_io.ReadU1();
     _fileUnitSize      = m_io.ReadU1();
     _interleaveGapSize = m_io.ReadU1();
     _volSeqNum         = new U2bi(m_io, this, m_root);
     _lenFileName       = m_io.ReadU1();
     _fileName          = System.Text.Encoding.GetEncoding("UTF-8").GetString(m_io.ReadBytes(LenFileName));
     if (KaitaiStream.Mod(LenFileName, 2) == 0)
     {
         _padding = m_io.ReadU1();
     }
     _rest = m_io.ReadBytesFull();
 }
 private void _read()
 {
     _header           = new FileHeader(m_io, this, m_root);
     _pathName         = m_io.ReadBytes((Header.PathNameSize - 1));
     _stringTerminator = m_io.EnsureFixedContents(new byte[] { 0 });
     if (KaitaiStream.Mod(Header.PathNameSize, 2) == 1)
     {
         _pathNamePadding = m_io.EnsureFixedContents(new byte[] { 0 });
     }
     _fileData = m_io.ReadBytes(Header.FileSize.Value);
     if (KaitaiStream.Mod(Header.FileSize.Value, 2) == 1)
     {
         _fileDataPadding = m_io.EnsureFixedContents(new byte[] { 0 });
     }
     if ((((KaitaiStream.ByteArrayCompare(PathName, new byte[] { 84, 82, 65, 73, 76, 69, 82, 33, 33, 33 }) == 0)) && (Header.FileSize.Value == 0)))
     {
         _endOfFilePadding = m_io.ReadBytesFull();
     }
 }
Beispiel #12
0
            private void _read()
            {
                _padding    = m_io.ReadBytes(KaitaiStream.Mod((8 - M_Io.Pos), 8));
                _objectType = ((ObjectTypes)m_io.ReadU1());
                _flags      = m_io.ReadU1();
                _reserved   = m_io.ReadBytes(6);
                _lenObject  = m_io.ReadU8le();
                switch (ObjectType)
                {
                case ObjectTypes.Data: {
                    __raw_payload = m_io.ReadBytes((LenObject - 16));
                    var io___raw_payload = new KaitaiStream(__raw_payload);
                    _payload = new DataObject(io___raw_payload, this, m_root);
                    break;
                }

                default: {
                    _payload = m_io.ReadBytes((LenObject - 16));
                    break;
                }
                }
            }
Beispiel #13
0
 private void _read()
 {
     _name = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytesTerm(0, false, true, true));
     _padding = m_io.ReadBytes(KaitaiStream.Mod(-(M_Io.Pos), 4));
 }
Beispiel #14
0
 private void _read()
 {
     _boundaryPadding = m_io.ReadBytes(KaitaiStream.Mod(-(M_Io.Pos), 4));
 }