Пример #1
0
 public DefineFontNameTag(FlashReader reader, TagRecord header) :
     base(reader, header)
 {
     FontId = reader.ReadUInt16();
     FontName = reader.ReadNullTerminatedString();
     FontCopyright = reader.ReadNullTerminatedString();
 }
Пример #2
0
        public DefineBinaryDataTag(FlashReader reader, TagRecord header)
            : base(reader, header)
        {
            CharacterId = reader.ReadUInt16();
            reader.ReadUInt32();

            BinaryData = reader.ReadBytes(header.Body.Length - 6);
        }
Пример #3
0
        public ExportAssetsTag(FlashReader reader, TagRecord header) :
            base(reader, header)
        {
            int count = reader.ReadUInt16();
            Assets = new Dictionary<ushort, string>(count);

            for (int i = 0; i < count; i++)
            {
                ushort tag = reader.ReadUInt16();
                string name = reader.ReadNullTerminatedString();

                if (Assets.ContainsKey(tag))
                {
                    throw new Exception(
                        "Duplicate tag id: " + tag);
                }
                Assets[tag] = name;
            }
        }
Пример #4
0
        public SymbolClassTag(FlashReader reader, TagRecord header) :
            base(reader, header)
        {
            int symbolCount = reader.ReadUInt16();
            Symbols = new Dictionary<ushort, string>(symbolCount);

            for (int i = 0; i < symbolCount; i++)
            {
                ushort characterId = reader.ReadUInt16();
                string symbolName = reader.ReadNullTerminatedString();

                if (Symbols.ContainsKey(characterId))
                {
                    symbolName =
                        $"{Symbols[characterId]},{symbolName}";
                }
                Symbols[characterId] = symbolName;
            }
        }
Пример #5
0
        public DefineBitsLossless2Tag(FlashReader reader, TagRecord header) :
            base(reader, header)
        {
            CharacterId = reader.ReadUInt16();
            BitmapFormat = reader.ReadByte();
            BitmapWidth = reader.ReadUInt16();
            BitmapHeight = reader.ReadUInt16();

            _isCompressed = true;
            switch (BitmapFormat - 3)
            {
                case 0: break;

                case 1:
                case 2:
                {
                    _compressedBitmapData =
                        reader.ReadBytes(header.Body.Length - 7);

                    break;
                }
            }
        }
Пример #6
0
        public TagRecord(FlashReader reader)
        {
            Start = reader.Position;

            ushort header = reader.ReadUInt16();
            TagType = (FlashTagType)(header >> 6);

            int length = (header & 63);
            if (length >= 63)
            {
                length = reader.ReadInt32();
                IsSpecialLong = (length < 63);
            }
            BodyStart = reader.Position;

            Body = reader.ReadBytes(length);
            reader.Position = BodyStart;
        }
Пример #7
0
 public ScriptLimitsTag(FlashReader reader, TagRecord header) :
     base(reader, header)
 {
     MaxRecursionDepth = reader.ReadUInt16();
     ScriptTimeoutSeconds = reader.ReadUInt16();
 }