Example #1
0
 private void _read()
 {
     _magic = m_io.ReadBytes(2);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 80, 77 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 77 }, Magic, M_Io, "/types/partition_entry/seq/0");
     }
     _reserved1          = m_io.ReadBytes(2);
     _numberOfPartitions = m_io.ReadU4be();
     _partitionStart     = m_io.ReadU4be();
     _partitionSize      = m_io.ReadU4be();
     _partitionName      = System.Text.Encoding.GetEncoding("ascii").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(32), 0, false));
     _partitionType      = System.Text.Encoding.GetEncoding("ascii").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(32), 0, false));
     _dataStart          = m_io.ReadU4be();
     _dataSize           = m_io.ReadU4be();
     _partitionStatus    = m_io.ReadU4be();
     _bootCodeStart      = m_io.ReadU4be();
     _bootCodeSize       = m_io.ReadU4be();
     _bootLoaderAddress  = m_io.ReadU4be();
     _reserved2          = m_io.ReadBytes(4);
     _bootCodeEntry      = m_io.ReadU4be();
     _reserved3          = m_io.ReadBytes(4);
     _bootCodeCksum      = m_io.ReadU4be();
     _processorType      = System.Text.Encoding.GetEncoding("ascii").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(16), 0, false));
 }
Example #2
0
 private void _read()
 {
     _magic = m_io.ReadBytes(16);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 83, 81, 76, 105, 116, 101, 32, 102, 111, 114, 109, 97, 116, 32, 51, 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 83, 81, 76, 105, 116, 101, 32, 102, 111, 114, 109, 97, 116, 32, 51, 0 }, Magic, M_Io, "/seq/0");
     }
     _lenPageMod             = m_io.ReadU2be();
     _writeVersion           = ((Versions)m_io.ReadU1());
     _readVersion            = ((Versions)m_io.ReadU1());
     _reservedSpace          = m_io.ReadU1();
     _maxPayloadFrac         = m_io.ReadU1();
     _minPayloadFrac         = m_io.ReadU1();
     _leafPayloadFrac        = m_io.ReadU1();
     _fileChangeCounter      = m_io.ReadU4be();
     _numPages               = m_io.ReadU4be();
     _firstFreelistTrunkPage = m_io.ReadU4be();
     _numFreelistPages       = m_io.ReadU4be();
     _schemaCookie           = m_io.ReadU4be();
     _schemaFormat           = m_io.ReadU4be();
     _defPageCacheSize       = m_io.ReadU4be();
     _largestRootPage        = m_io.ReadU4be();
     _textEncoding           = ((Encodings)m_io.ReadU4be());
     _userVersion            = m_io.ReadU4be();
     _isIncrementalVacuum    = m_io.ReadU4be();
     _applicationId          = m_io.ReadU4be();
     _reserved               = m_io.ReadBytes(20);
     _versionValidFor        = m_io.ReadU4be();
     _sqliteVersionNumber    = m_io.ReadU4be();
     _rootPage               = new BtreePage(m_io, this, m_root);
 }
Example #3
0
 private void _read()
 {
     _colon1 = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Colon1, new byte[] { 58 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 58 }, Colon1, M_Io, "/types/custom_serialized_object_contents/seq/0");
     }
     _className = new LengthPrefixedQuotedString(m_io, this, m_root);
     _colon2    = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Colon2, new byte[] { 58 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 58 }, Colon2, M_Io, "/types/custom_serialized_object_contents/seq/2");
     }
     _lenDataDec   = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytesTerm(58, false, true, true));
     _openingBrace = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(OpeningBrace, new byte[] { 123 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 123 }, OpeningBrace, M_Io, "/types/custom_serialized_object_contents/seq/4");
     }
     _data         = m_io.ReadBytes(LenData);
     _closingQuote = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(ClosingQuote, new byte[] { 125 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 125 }, ClosingQuote, M_Io, "/types/custom_serialized_object_contents/seq/6");
     }
 }
Example #4
0
 private void _read()
 {
     _syncCode = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(SyncCode, new byte[] { 79, 103, 103, 83 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 79, 103, 103, 83 }, SyncCode, M_Io, "/types/page/seq/0");
     }
     _version = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Version, new byte[] { 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0 }, Version, M_Io, "/types/page/seq/1");
     }
     _reserved1           = m_io.ReadBitsIntBe(5);
     _isEndOfStream       = m_io.ReadBitsIntBe(1) != 0;
     _isBeginningOfStream = m_io.ReadBitsIntBe(1) != 0;
     _isContinuation      = m_io.ReadBitsIntBe(1) != 0;
     m_io.AlignToByte();
     _granulePos      = m_io.ReadU8le();
     _bitstreamSerial = m_io.ReadU4le();
     _pageSeqNum      = m_io.ReadU4le();
     _crc32           = m_io.ReadU4le();
     _numSegments     = m_io.ReadU1();
     _lenSegments     = new List <byte>();
     for (var i = 0; i < NumSegments; i++)
     {
         _lenSegments.Add(m_io.ReadU1());
     }
     _segments = new List <byte[]>();
     for (var i = 0; i < NumSegments; i++)
     {
         _segments.Add(m_io.ReadBytes(LenSegments[i]));
     }
 }
Example #5
0
 private void _read()
 {
     _magic = m_io.ReadBytes(6);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 76, 85, 75, 83, 186, 190 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 76, 85, 75, 83, 186, 190 }, Magic, M_Io, "/types/partition_header/seq/0");
     }
     _version = m_io.ReadBytes(2);
     if (!((KaitaiStream.ByteArrayCompare(Version, new byte[] { 0, 1 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0, 1 }, Version, M_Io, "/types/partition_header/seq/1");
     }
     _cipherNameSpecification      = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(32));
     _cipherModeSpecification      = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(32));
     _hashSpecification            = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(32));
     _payloadOffset                = m_io.ReadU4be();
     _numberOfKeyBytes             = m_io.ReadU4be();
     _masterKeyChecksum            = m_io.ReadBytes(20);
     _masterKeySaltParameter       = m_io.ReadBytes(32);
     _masterKeyIterationsParameter = m_io.ReadU4be();
     _uuid     = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(40));
     _keySlots = new List <KeySlot>();
     for (var i = 0; i < 8; i++)
     {
         _keySlots.Add(new KeySlot(m_io, this, m_root));
     }
 }
                private void _read()
                {
                    {
                        byte[] on = M_Parent.Indicator;
                        if ((KaitaiStream.ByteArrayCompare(on, new byte[] { 73, 73 }) == 0))
                        {
                            m_isLe = (bool)(true);
                        }
                        else if ((KaitaiStream.ByteArrayCompare(on, new byte[] { 77, 77 }) == 0))
                        {
                            m_isLe = (bool)(false);
                        }
                    }

                    if (m_isLe == null)
                    {
                        throw new UndecidedEndiannessError();
                    }
                    else if (m_isLe == true)
                    {
                        _readLE();
                    }
                    else
                    {
                        _readBE();
                    }
                }
Example #7
0
 private void _read()
 {
     _catalogEnd = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(CatalogEnd, new byte[] { 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0 }, CatalogEnd, M_Io, "/types/volume_info/seq/0");
     }
     _unused = m_io.ReadBytes(224);
     _firstFreeSectorSector = m_io.ReadU1();
     _firstFreeSectorTrack  = m_io.ReadU1();
     _diskType       = ((TrDosImage.DiskType)m_io.ReadU1());
     _numFiles       = m_io.ReadU1();
     _numFreeSectors = m_io.ReadU2le();
     _trDosId        = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(TrDosId, new byte[] { 16 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 16 }, TrDosId, M_Io, "/types/volume_info/seq/7");
     }
     _unused2         = m_io.ReadBytes(2);
     _password        = m_io.ReadBytes(9);
     _unused3         = m_io.ReadBytes(1);
     _numDeletedFiles = m_io.ReadU1();
     _label           = m_io.ReadBytes(8);
     _unused4         = m_io.ReadBytes(3);
 }
Example #8
0
 private void _read()
 {
     _magic = m_io.ReadBytes(8);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 0, 255, 255, 255, 255, 255, 255, 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0, 255, 255, 255, 255, 255, 255, 0 }, Magic, M_Io, "/seq/0");
     }
     _mfgBytes         = m_io.ReadU2be();
     _productCode      = m_io.ReadU2le();
     _serial           = m_io.ReadU4le();
     _mfgWeek          = m_io.ReadU1();
     _mfgYearMod       = m_io.ReadU1();
     _edidVersionMajor = m_io.ReadU1();
     _edidVersionMinor = m_io.ReadU1();
     _inputFlags       = m_io.ReadU1();
     _screenSizeH      = m_io.ReadU1();
     _screenSizeV      = m_io.ReadU1();
     _gammaMod         = m_io.ReadU1();
     _featuresFlags    = m_io.ReadU1();
     _chromacity       = new ChromacityInfo(m_io, this, m_root);
     _estTimings       = new EstTimingsInfo(m_io, this, m_root);
     __raw_stdTimings  = new List <byte[]>();
     _stdTimings       = new List <StdTiming>();
     for (var i = 0; i < 8; i++)
     {
         __raw_stdTimings.Add(m_io.ReadBytes(2));
         var io___raw_stdTimings = new KaitaiStream(__raw_stdTimings[__raw_stdTimings.Count - 1]);
         _stdTimings.Add(new StdTiming(io___raw_stdTimings, this, m_root));
     }
 }
Example #9
0
 private void _read()
 {
     _ident = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Ident, new byte[] { 73, 68, 80, 79 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 73, 68, 80, 79 }, Ident, M_Io, "/types/mdl_header/seq/0");
     }
     _versionMustBe6 = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(VersionMustBe6, new byte[] { 6, 0, 0, 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 6, 0, 0, 0 }, VersionMustBe6, M_Io, "/types/mdl_header/seq/1");
     }
     _scale       = new Vec3(m_io, this, m_root);
     _origin      = new Vec3(m_io, this, m_root);
     _radius      = m_io.ReadF4le();
     _eyePosition = new Vec3(m_io, this, m_root);
     _numSkins    = m_io.ReadS4le();
     _skinWidth   = m_io.ReadS4le();
     _skinHeight  = m_io.ReadS4le();
     _numVerts    = m_io.ReadS4le();
     _numTris     = m_io.ReadS4le();
     _numFrames   = m_io.ReadS4le();
     _synctype    = m_io.ReadS4le();
     _flags       = m_io.ReadS4le();
     _size        = m_io.ReadF4le();
 }
Example #10
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();
     }
 }
Example #11
0
            private void _read()
            {
                {
                    byte[] on = M_Root.Signature;
                    if ((KaitaiStream.ByteArrayCompare(on, new byte[] { 222, 18, 4, 149 }) == 0))
                    {
                        m_isLe = (bool)(true);
                    }
                    else if ((KaitaiStream.ByteArrayCompare(on, new byte[] { 149, 4, 18, 222 }) == 0))
                    {
                        m_isLe = (bool)(false);
                    }
                }

                if (m_isLe == null)
                {
                    throw new UndecidedEndiannessError();
                }
                else if (m_isLe == true)
                {
                    _readLE();
                }
                else
                {
                    _readBE();
                }
            }
Example #12
0
            private void _read()
            {
                _magic = m_io.ReadBytes(2);
                if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 80, 75 }) == 0)))
                {
                    throw new ValidationNotEqualError(new byte[] { 80, 75 }, Magic, M_Io, "/types/pk_section/seq/0");
                }
                _sectionType = m_io.ReadU2le();
                switch (SectionType)
                {
                case 513: {
                    _body = new CentralDirEntry(m_io, this, m_root);
                    break;
                }

                case 1027: {
                    _body = new LocalFile(m_io, this, m_root);
                    break;
                }

                case 1541: {
                    _body = new EndOfCentralDir(m_io, this, m_root);
                    break;
                }

                case 2055: {
                    _body = new DataDescriptor(m_io, this, m_root);
                    break;
                }
                }
            }
Example #13
0
 private void _read()
 {
     _version = m_io.ReadU4be();
     if (!(Version == 2))
     {
         throw new ValidationNotEqualError(2, Version, M_Io, "/types/header/seq/0");
     }
     _width = m_io.ReadU4be();
     if (!(Width >= 1))
     {
         throw new ValidationLessThanError(1, Width, M_Io, "/types/header/seq/1");
     }
     if (!(Width <= 10000))
     {
         throw new ValidationGreaterThanError(10000, Width, M_Io, "/types/header/seq/1");
     }
     _height = m_io.ReadU4be();
     if (!(Height >= 1))
     {
         throw new ValidationLessThanError(1, Height, M_Io, "/types/header/seq/2");
     }
     if (!(Height <= 10000))
     {
         throw new ValidationGreaterThanError(10000, Height, M_Io, "/types/header/seq/2");
     }
     _bytesPerPixel = ((GimpBrush.ColorDepth)m_io.ReadU4be());
     _magic         = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 71, 73, 77, 80 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 71, 73, 77, 80 }, Magic, M_Io, "/types/header/seq/4");
     }
     _spacing   = m_io.ReadU4be();
     _brushName = System.Text.Encoding.GetEncoding("UTF-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytesFull(), 0, false));
 }
Example #14
0
 private void _read()
 {
     _magic1 = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic1, new byte[] { 68, 75, 73, 70 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 68, 75, 73, 70 }, Magic1, M_Io, "/seq/0");
     }
     _version   = m_io.ReadU2le();
     _lenHeader = m_io.ReadU2le();
     _codec     = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Codec, new byte[] { 86, 80, 56, 48 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 86, 80, 56, 48 }, Codec, M_Io, "/seq/3");
     }
     _width     = m_io.ReadU2le();
     _height    = m_io.ReadU2le();
     _framerate = m_io.ReadU4le();
     _timescale = m_io.ReadU4le();
     _numFrames = m_io.ReadU4le();
     _unused    = m_io.ReadU4le();
     _imageData = new List <Blocks>();
     for (var i = 0; i < NumFrames; i++)
     {
         _imageData.Add(new Blocks(m_io, this, m_root));
     }
 }
Example #15
0
 private void _read()
 {
     _magic = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 10 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 10 }, Magic, M_Io, "/types/header/seq/0");
     }
     _version      = ((Pcx.Versions)m_io.ReadU1());
     _encoding     = ((Pcx.Encodings)m_io.ReadU1());
     _bitsPerPixel = m_io.ReadU1();
     _imgXMin      = m_io.ReadU2le();
     _imgYMin      = m_io.ReadU2le();
     _imgXMax      = m_io.ReadU2le();
     _imgYMax      = m_io.ReadU2le();
     _hdpi         = m_io.ReadU2le();
     _vdpi         = m_io.ReadU2le();
     _palette16    = m_io.ReadBytes(48);
     _reserved     = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Reserved, new byte[] { 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0 }, Reserved, M_Io, "/types/header/seq/11");
     }
     _numPlanes    = m_io.ReadU1();
     _bytesPerLine = m_io.ReadU2le();
     _paletteInfo  = m_io.ReadU2le();
     _hScreenSize  = m_io.ReadU2le();
     _vScreenSize  = m_io.ReadU2le();
 }
Example #16
0
            private void _read()
            {
                _type     = ((InstTypes)m_io.ReadU1());
                _filename = KaitaiStream.BytesTerminate(m_io.ReadBytes(12), 0, false);
                switch (Type)
                {
                case InstTypes.Sample: {
                    _body = new Sampled(m_io, this, m_root);
                    break;
                }

                default: {
                    _body = new Adlib(m_io, this, m_root);
                    break;
                }
                }
                _tuningHz   = m_io.ReadU4le();
                _reserved2  = m_io.ReadBytes(12);
                _sampleName = KaitaiStream.BytesTerminate(m_io.ReadBytes(28), 0, false);
                _magic      = m_io.ReadBytes(4);
                if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 83, 67, 82, 83 }) == 0)))
                {
                    throw new ValidationNotEqualError(new byte[] { 83, 67, 82, 83 }, Magic, M_Io, "/types/instrument/seq/6");
                }
            }
Example #17
0
 private void _read()
 {
     _magic = m_io.ReadBytes(8);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 137, 80, 78, 71, 13, 10, 26, 10 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 137, 80, 78, 71, 13, 10, 26, 10 }, Magic, M_Io, "/seq/0");
     }
     _ihdrLen = m_io.ReadU4be();
     if (!(IhdrLen == 13))
     {
         throw new ValidationNotEqualError(13, IhdrLen, M_Io, "/seq/1");
     }
     _ihdrType = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(IhdrType, new byte[] { 73, 72, 68, 82 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 73, 72, 68, 82 }, IhdrType, M_Io, "/seq/2");
     }
     _ihdr    = new IhdrChunk(m_io, this, m_root);
     _ihdrCrc = m_io.ReadBytes(4);
     _chunks  = new List <Chunk>();
     {
         var   i = 0;
         Chunk M_;
         do
         {
             M_ = new Chunk(m_io, this, m_root);
             _chunks.Add(M_);
             i++;
         } while (!(((M_.Type == "IEND") || (M_Io.IsEof))));
     }
 }
Example #18
0
 private void _read()
 {
     _semicolon = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Semicolon, new byte[] { 59 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 59 }, Semicolon, M_Io, "/types/null_contents/seq/0");
     }
 }
Example #19
0
 private void _read()
 {
     _magic = m_io.ReadBytes(3);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 71, 73, 70 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 71, 73, 70 }, Magic, M_Io, "/types/header/seq/0");
     }
     _version = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(3));
 }
Example #20
0
 private void _read()
 {
     _dataOffset    = m_io.ReadU4le();
     _typeIndicator = m_io.ReadBytes(8);
     if (!((KaitaiStream.ByteArrayCompare(TypeIndicator, new byte[] { 76, 86, 77, 50, 32, 48, 48, 49 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 76, 86, 77, 50, 32, 48, 48, 49 }, TypeIndicator, M_Io, "/types/physical_volume/types/label/types/label_header/types/label_header_/seq/1");
     }
 }
Example #21
0
 private void _read()
 {
     _colon = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Colon, new byte[] { 58 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 58 }, Colon, M_Io, "/types/int_contents/seq/0");
     }
     _valueDec = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytesTerm(59, false, true, true));
 }
Example #22
0
 private void _read()
 {
     _version = m_io.ReadBytes(2);
     if (!((KaitaiStream.ByteArrayCompare(Version, new byte[] { 4, 8 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 4, 8 }, Version, M_Io, "/seq/0");
     }
     _records = new Record(m_io, this, m_root);
 }
Example #23
0
 private void _read()
 {
     _alignmentHeader = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(AlignmentHeader, new byte[] { 0, 0, 0, 1 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0, 0, 0, 1 }, AlignmentHeader, M_Io, "/seq/0");
     }
     _buddyAllocatorHeader = new BuddyAllocatorHeader(m_io, this, m_root);
 }
Example #24
0
 private void _read()
 {
     _colon = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Colon, new byte[] { 58 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 58 }, Colon, M_Io, "/types/php_3_object_contents/seq/0");
     }
     _properties = new CountPrefixedMapping(m_io, this, m_root);
 }
Example #25
0
 private void _read()
 {
     _magic = m_io.ReadBytes(13);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 98, 116, 114, 102, 115, 45, 115, 116, 114, 101, 97, 109, 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 98, 116, 114, 102, 115, 45, 115, 116, 114, 101, 97, 109, 0 }, Magic, M_Io, "/types/send_stream_header/seq/0");
     }
     _version = m_io.ReadU4le();
 }
Example #26
0
 private void _read()
 {
     _reserved1 = m_io.ReadBytes(3);
     if (!((KaitaiStream.ByteArrayCompare(Reserved1, new byte[] { 0, 0, 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0, 0, 0 }, Reserved1, M_Io, "/types/instrument/types/adlib/seq/0");
     }
     __unnamed1 = m_io.ReadBytes(16);
 }
Example #27
0
 private void _read()
 {
     _magic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 22, 209, 22, 209 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 22, 209, 22, 209 }, Magic, M_Io, "/types/header/seq/0");
     }
     _version = m_io.ReadU1();
 }
Example #28
0
 private void _read()
 {
     _songName = KaitaiStream.BytesTerminate(m_io.ReadBytes(28), 0, false);
     _magic1   = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Magic1, new byte[] { 26 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 26 }, Magic1, M_Io, "/seq/1");
     }
     _fileType       = m_io.ReadU1();
     _reserved1      = m_io.ReadBytes(2);
     _numOrders      = m_io.ReadU2le();
     _numInstruments = m_io.ReadU2le();
     _numPatterns    = m_io.ReadU2le();
     _flags          = m_io.ReadU2le();
     _version        = m_io.ReadU2le();
     _samplesFormat  = m_io.ReadU2le();
     _magic2         = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic2, new byte[] { 83, 67, 82, 77 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 83, 67, 82, 77 }, Magic2, M_Io, "/seq/10");
     }
     _globalVolume = m_io.ReadU1();
     _initialSpeed = m_io.ReadU1();
     _initialTempo = m_io.ReadU1();
     _isStereo     = m_io.ReadBitsIntBe(1) != 0;
     _masterVolume = m_io.ReadBitsIntBe(7);
     m_io.AlignToByte();
     _ultraClickRemoval = m_io.ReadU1();
     _hasCustomPan      = m_io.ReadU1();
     _reserved2         = m_io.ReadBytes(8);
     _ofsSpecial        = m_io.ReadU2le();
     _channels          = new List <Channel>();
     for (var i = 0; i < 32; i++)
     {
         _channels.Add(new Channel(m_io, this, m_root));
     }
     _orders      = m_io.ReadBytes(NumOrders);
     _instruments = new List <InstrumentPtr>();
     for (var i = 0; i < NumInstruments; i++)
     {
         _instruments.Add(new InstrumentPtr(m_io, this, m_root));
     }
     _patterns = new List <PatternPtr>();
     for (var i = 0; i < NumPatterns; i++)
     {
         _patterns.Add(new PatternPtr(m_io, this, m_root));
     }
     if (HasCustomPan == 252)
     {
         _channelPans = new List <ChannelPan>();
         for (var i = 0; i < 32; i++)
         {
             _channelPans.Add(new ChannelPan(m_io, this, m_root));
         }
     }
 }
Example #29
0
 private void _read()
 {
     _reserved  = m_io.ReadU1();
     _varName   = m_io.ReadU1();
     _reserved1 = m_io.ReadBytes(2);
     if (!((KaitaiStream.ByteArrayCompare(Reserved1, new byte[] { 0, 128 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0, 128 }, Reserved1, M_Io, "/types/array_params/seq/2");
     }
 }
Example #30
0
 private void _read()
 {
     _magic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 80, 65, 67, 75 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75 }, Magic, M_Io, "/seq/0");
     }
     _ofsIndex = m_io.ReadU4le();
     _lenIndex = m_io.ReadU4le();
 }