Ejemplo n.º 1
0
            private void _read()
            {
                _magic = m_io.ReadBytes(4);
                if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 78, 69, 83, 26 }) == 0)))
                {
                    throw new ValidationNotEqualError(new byte[] { 78, 69, 83, 26 }, Magic, M_Io, "/types/header/seq/0");
                }
                _lenPrgRom = m_io.ReadU1();
                _lenChrRom = m_io.ReadU1();
                __raw_f6   = m_io.ReadBytes(1);
                var io___raw_f6 = new KaitaiStream(__raw_f6);

                _f6      = new F6(io___raw_f6, this, m_root);
                __raw_f7 = m_io.ReadBytes(1);
                var io___raw_f7 = new KaitaiStream(__raw_f7);

                _f7        = new F7(io___raw_f7, this, m_root);
                _lenPrgRam = m_io.ReadU1();
                __raw_f9   = m_io.ReadBytes(1);
                var io___raw_f9 = new KaitaiStream(__raw_f9);

                _f9       = new F9(io___raw_f9, this, m_root);
                __raw_f10 = m_io.ReadBytes(1);
                var io___raw_f10 = new KaitaiStream(__raw_f10);

                _f10      = new F10(io___raw_f10, this, m_root);
                _reserved = m_io.ReadBytes(5);
                if (!((KaitaiStream.ByteArrayCompare(Reserved, new byte[] { 0, 0, 0, 0, 0 }) == 0)))
                {
                    throw new ValidationNotEqualError(new byte[] { 0, 0, 0, 0, 0 }, Reserved, M_Io, "/types/header/seq/8");
                }
            }
Ejemplo n.º 2
0
 private void _read()
 {
     _lenHeader = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(LenHeader, new byte[] { 76, 0, 0, 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 76, 0, 0, 0 }, LenHeader, M_Io, "/types/file_header/seq/0");
     }
     _linkClsid = m_io.ReadBytes(16);
     if (!((KaitaiStream.ByteArrayCompare(LinkClsid, new byte[] { 1, 20, 2, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 1, 20, 2, 0, 0, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 70 }, LinkClsid, M_Io, "/types/file_header/seq/1");
     }
     __raw_flags = m_io.ReadBytes(4);
     var io___raw_flags = new KaitaiStream(__raw_flags);
     _flags = new LinkFlags(io___raw_flags, this, m_root);
     _fileAttrs = m_io.ReadU4le();
     _timeCreation = m_io.ReadU8le();
     _timeAccess = m_io.ReadU8le();
     _timeWrite = m_io.ReadU8le();
     _targetFileSize = m_io.ReadU4le();
     _iconIndex = m_io.ReadS4le();
     _showCommand = ((WindowsLnkFile.WindowState) m_io.ReadU4le());
     _hotkey = m_io.ReadU2le();
     _reserved = m_io.ReadBytes(10);
     if (!((KaitaiStream.ByteArrayCompare(Reserved, new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, Reserved, M_Io, "/types/file_header/seq/11");
     }
 }
Ejemplo n.º 3
0
 private void _read()
 {
     _magic = m_io.ReadBytes(8);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 65, 78, 68, 82, 79, 73, 68, 33 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 65, 78, 68, 82, 79, 73, 68, 33 }, Magic, M_Io, "/seq/0");
     }
     _kernel        = new Load(m_io, this, m_root);
     _ramdisk       = new Load(m_io, this, m_root);
     _second        = new Load(m_io, this, m_root);
     _tagsLoad      = m_io.ReadU4le();
     _pageSize      = m_io.ReadU4le();
     _headerVersion = m_io.ReadU4le();
     _osVersion     = new OsVersion(m_io, this, m_root);
     _name          = System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(16), 0, false));
     _cmdline       = System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(512), 0, false));
     _sha           = m_io.ReadBytes(32);
     _extraCmdline  = System.Text.Encoding.GetEncoding("ASCII").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(1024), 0, false));
     if (HeaderVersion > 0)
     {
         _recoveryDtbo = new SizeOffset(m_io, this, m_root);
     }
     if (HeaderVersion > 0)
     {
         _bootHeaderSize = m_io.ReadU4le();
     }
     if (HeaderVersion > 1)
     {
         _dtb = new LoadLong(m_io, this, m_root);
     }
 }
Ejemplo n.º 4
0
 private void _read()
 {
     _foo = m_io.ReadBytes(2);
     if (!((KaitaiStream.ByteArrayCompare(Foo, new byte[] { 81, 65 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 81, 65 }, Foo, M_Io, "/seq/0");
     }
 }
Ejemplo n.º 5
0
 private void _read()
 {
     _magic1 = m_io.ReadBytes(6);
     if (!((KaitaiStream.ByteArrayCompare(Magic1, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, Magic1, M_Io, "/seq/0");
     }
     _uint8 = m_io.ReadU1();
     if (!(Uint8 == 255))
     {
         throw new ValidationNotEqualError(255, Uint8, M_Io, "/seq/1");
     }
     _sint8 = m_io.ReadS1();
     if (!(Sint8 == -1))
     {
         throw new ValidationNotEqualError(-1, Sint8, M_Io, "/seq/2");
     }
     _magicUint = System.Text.Encoding.GetEncoding("utf-8").GetString(m_io.ReadBytes(10));
     if (!(MagicUint == "PACK-U-DEF"))
     {
         throw new ValidationNotEqualError("PACK-U-DEF", MagicUint, M_Io, "/seq/3");
     }
     _uint16 = m_io.ReadU2le();
     if (!(Uint16 == 65535))
     {
         throw new ValidationNotEqualError(65535, Uint16, M_Io, "/seq/4");
     }
     _uint32 = m_io.ReadU4le();
     if (!(Uint32 == 4294967295))
     {
         throw new ValidationNotEqualError(4294967295, Uint32, M_Io, "/seq/5");
     }
     _uint64 = m_io.ReadU8le();
     if (!(Uint64 == 18446744073709551615))
     {
         throw new ValidationNotEqualError(18446744073709551615, Uint64, M_Io, "/seq/6");
     }
     _magicSint = System.Text.Encoding.GetEncoding("utf-8").GetString(m_io.ReadBytes(10));
     if (!(MagicSint == "PACK-S-DEF"))
     {
         throw new ValidationNotEqualError("PACK-S-DEF", MagicSint, M_Io, "/seq/7");
     }
     _sint16 = m_io.ReadS2le();
     if (!(Sint16 == -1))
     {
         throw new ValidationNotEqualError(-1, Sint16, M_Io, "/seq/8");
     }
     _sint32 = m_io.ReadS4le();
     if (!(Sint32 == -1))
     {
         throw new ValidationNotEqualError(-1, Sint32, M_Io, "/seq/9");
     }
     _sint64 = m_io.ReadS8le();
     if (!(Sint64 == -1))
     {
         throw new ValidationNotEqualError(-1, Sint64, M_Io, "/seq/10");
     }
 }
 private void _read()
 {
     _magic1 = m_io.ReadBytes(6);
     if (!((KaitaiStream.ByteArrayCompare(Magic1, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, Magic1, M_Io, "/types/header/seq/0");
     }
     _uint8     = m_io.ReadU1();
     _sint8     = m_io.ReadS1();
     _magicUint = m_io.ReadBytes(10);
     if (!((KaitaiStream.ByteArrayCompare(MagicUint, new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 68, 69, 70 }, MagicUint, M_Io, "/types/header/seq/3");
     }
     _uint16    = m_io.ReadU2le();
     _uint32    = m_io.ReadU4le();
     _uint64    = m_io.ReadU8le();
     _magicSint = m_io.ReadBytes(10);
     if (!((KaitaiStream.ByteArrayCompare(MagicSint, new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 68, 69, 70 }, MagicSint, M_Io, "/types/header/seq/7");
     }
     _sint16      = m_io.ReadS2le();
     _sint32      = m_io.ReadS4le();
     _sint64      = m_io.ReadS8le();
     _magicUintLe = m_io.ReadBytes(9);
     if (!((KaitaiStream.ByteArrayCompare(MagicUintLe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 76, 69 }, MagicUintLe, M_Io, "/types/header/seq/11");
     }
     _uint16le    = m_io.ReadU2le();
     _uint32le    = m_io.ReadU4le();
     _uint64le    = m_io.ReadU8le();
     _magicSintLe = m_io.ReadBytes(9);
     if (!((KaitaiStream.ByteArrayCompare(MagicSintLe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 76, 69 }, MagicSintLe, M_Io, "/types/header/seq/15");
     }
     _sint16le    = m_io.ReadS2le();
     _sint32le    = m_io.ReadS4le();
     _sint64le    = m_io.ReadS8le();
     _magicUintBe = m_io.ReadBytes(9);
     if (!((KaitaiStream.ByteArrayCompare(MagicUintBe, new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 85, 45, 66, 69 }, MagicUintBe, M_Io, "/types/header/seq/19");
     }
     _uint16be    = m_io.ReadU2be();
     _uint32be    = m_io.ReadU4be();
     _uint64be    = m_io.ReadU8be();
     _magicSintBe = m_io.ReadBytes(9);
     if (!((KaitaiStream.ByteArrayCompare(MagicSintBe, new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 83, 45, 66, 69 }, MagicSintBe, M_Io, "/types/header/seq/23");
     }
     _sint16be = m_io.ReadS2be();
     _sint32be = m_io.ReadS4be();
     _sint64be = m_io.ReadS8be();
 }
Ejemplo n.º 7
0
 private void _read()
 {
     _magic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 120, 97, 114, 33 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 120, 97, 114, 33 }, Magic, M_Io, "/types/file_header_prefix/seq/0");
     }
     _lenHeader = m_io.ReadU2be();
 }
Ejemplo n.º 8
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);
 }
 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");
     }
 }
Ejemplo n.º 10
0
 private void _read()
 {
     _code = m_io.ReadBytes(1);
     if (!((KaitaiStream.ByteArrayCompare(Code, new byte[] { 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0 }, Code, M_Io, "/types/echo_msg/seq/0");
     }
     _checksum   = m_io.ReadU2be();
     _identifier = m_io.ReadU2be();
     _seqNum     = m_io.ReadU2be();
     _data       = m_io.ReadBytesFull();
 }
 private void _read()
 {
     _foo = m_io.ReadBytes(2);
     if (!((KaitaiStream.ByteArrayCompare(Foo, new byte[] { 72, 64 }) >= 0)))
     {
         throw new ValidationLessThanError(new byte[] { 72, 64 }, Foo, M_Io, "/seq/0");
     }
     if (!((KaitaiStream.ByteArrayCompare(Foo, new byte[] { 79, 126 }) <= 0)))
     {
         throw new ValidationGreaterThanError(new byte[] { 79, 126 }, Foo, M_Io, "/seq/0");
     }
 }
 private void _read()
 {
     _normal = m_io.ReadBytes(6);
     if (!((KaitaiStream.ByteArrayCompare(Normal, new byte[] { 80, 65, 67, 75, 45, 49 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 80, 65, 67, 75, 45, 49 }, Normal, M_Io, "/seq/0");
     }
     _highBit8 = m_io.ReadBytes(2);
     if (!((KaitaiStream.ByteArrayCompare(HighBit8, new byte[] { 255, 255 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 255, 255 }, HighBit8, M_Io, "/seq/1");
     }
 }
Ejemplo n.º 13
0
        private void _read()
        {
            _magic = m_io.ReadBytes(4);
            if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 46, 115, 110, 100 }) == 0)))
            {
                throw new ValidationNotEqualError(new byte[] { 46, 115, 110, 100 }, Magic, M_Io, "/seq/0");
            }
            _ofsData     = m_io.ReadU4be();
            __raw_header = m_io.ReadBytes(((OfsData - 4) - 4));
            var io___raw_header = new KaitaiStream(__raw_header);

            _header = new Header(io___raw_header, this, m_root);
        }
 private void _read()
 {
     _magic = m_io.ReadBytes(2);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 66, 75 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 66, 75 }, Magic, M_Io, "/seq/0");
     }
     _headerLength   = m_io.ReadU2le();
     _messageType    = ((EMessageType)m_io.ReadU2le());
     _contentVersion = m_io.ReadU2le();
     _reserved2      = m_io.ReadU4le();
     _time           = m_io.ReadU8le();
     _contentLength  = m_io.ReadU4le();
 }
Ejemplo n.º 15
0
 private void _read()
 {
     _magic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 16, 0, 0, 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 16, 0, 0, 0 }, Magic, M_Io, "/seq/0");
     }
     _flags = m_io.ReadU4le();
     if (HasClut)
     {
         _clut = new Bitmap(m_io, this, m_root);
     }
     _img = new Bitmap(m_io, this, m_root);
 }
Ejemplo n.º 16
0
 private void _read()
 {
     _magic = m_io.ReadBytes(3);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 84, 65, 71 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 84, 65, 71 }, Magic, M_Io, "/types/id3_v1_1_tag/seq/0");
     }
     _title   = m_io.ReadBytes(30);
     _artist  = m_io.ReadBytes(30);
     _album   = m_io.ReadBytes(30);
     _year    = System.Text.Encoding.GetEncoding("ASCII").GetString(m_io.ReadBytes(4));
     _comment = m_io.ReadBytes(30);
     _genre   = ((GenreEnum)m_io.ReadU1());
 }
Ejemplo n.º 17
0
 private void _read()
 {
     _magic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 39, 5, 25, 86 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 39, 5, 25, 86 }, Magic, M_Io, "/types/uheader/seq/0");
     }
     _headerCrc       = m_io.ReadU4be();
     _timestamp       = m_io.ReadU4be();
     _lenImage        = m_io.ReadU4be();
     _loadAddress     = m_io.ReadU4be();
     _entryAddress    = m_io.ReadU4be();
     _dataCrc         = m_io.ReadU4be();
     _osType          = ((Uimage.UimageOs)m_io.ReadU1());
     _architecture    = ((Uimage.UimageArch)m_io.ReadU1());
     _imageType       = ((Uimage.UimageType)m_io.ReadU1());
     _compressionType = ((Uimage.UimageComp)m_io.ReadU1());
     _name            = System.Text.Encoding.GetEncoding("UTF-8").GetString(KaitaiStream.BytesTerminate(m_io.ReadBytes(32), 0, false));
 }
Ejemplo n.º 18
0
 private void _read()
 {
     _magic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 168, 159, 101, 114 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 168, 159, 101, 114 }, Magic, M_Io, "/types/header/types/common_part/seq/0");
     }
     _lenHeader = m_io.ReadU2be();
     if (!(LenHeader == 18))
     {
         throw new ValidationNotEqualError(18, LenHeader, M_Io, "/types/header/types/common_part/seq/1");
     }
     _headerType = m_io.ReadU1();
     _unknown    = m_io.ReadU1();
     if (!(Unknown == 1))
     {
         throw new ValidationNotEqualError(1, Unknown, M_Io, "/types/header/types/common_part/seq/3");
     }
     _lenDecompressed = m_io.ReadU4be();
 }
Ejemplo n.º 19
0
 private void _read()
 {
     _magic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 75, 68, 77, 86 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 75, 68, 77, 86 }, Magic, M_Io, "/seq/0");
     }
     _version              = m_io.ReadS4le();
     _flags                = new HeaderFlags(m_io, this, m_root);
     _sizeMax              = m_io.ReadS8le();
     _sizeGrain            = m_io.ReadS8le();
     _startDescriptor      = m_io.ReadS8le();
     _sizeDescriptor       = m_io.ReadS8le();
     _numGrainTableEntries = m_io.ReadS4le();
     _startSecondaryGrain  = m_io.ReadS8le();
     _startPrimaryGrain    = m_io.ReadS8le();
     _sizeMetadata         = m_io.ReadS8le();
     _isDirty              = m_io.ReadU1();
     _stuff                = m_io.ReadBytes(4);
     _compressionMethod    = ((CompressionMethods)m_io.ReadU2le());
 }
Ejemplo n.º 20
0
 private void _read()
 {
     _headerVersion = m_io.ReadU4le();
     if (!(HeaderVersion == 1))
     {
         throw new ValidationNotEqualError(1, HeaderVersion, M_Io, "/seq/0");
     }
     _magic = m_io.ReadBytes(4);
     if (!((KaitaiStream.ByteArrayCompare(Magic, new byte[] { 78, 65, 78, 79 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 78, 65, 78, 79 }, Magic, M_Io, "/seq/1");
     }
     _appId               = m_io.ReadU8le();
     _appVersion          = m_io.ReadU4le();
     _flags               = m_io.ReadU4le();
     _hubType             = m_io.ReadU8le();
     _chreApiMajorVersion = m_io.ReadU1();
     _chreApiMinorVersion = m_io.ReadU1();
     _reserved            = m_io.ReadBytes(6);
     if (!((KaitaiStream.ByteArrayCompare(Reserved, new byte[] { 0, 0, 0, 0, 0, 0 }) == 0)))
     {
         throw new ValidationNotEqualError(new byte[] { 0, 0, 0, 0, 0, 0 }, Reserved, M_Io, "/seq/8");
     }
 }