Exemplo n.º 1
0
 SwfTagData ISwfTagVisitor <ISwfStreamWriter, SwfTagData> .Visit(ScriptLimitsTag tag, ISwfStreamWriter writer)
 {
     writer.WriteUInt16(tag.MaxRecursionDepth);
     writer.WriteUInt16(tag.ScriptTimeoutSeconds);
     return(null);
 }
Exemplo n.º 2
0
 SwfTagBase ISwfTagVisitor <ISwfStreamReader, SwfTagBase> .Visit(ScriptLimitsTag tag, ISwfStreamReader reader)
 {
     tag.MaxRecursionDepth    = reader.ReadUInt16();
     tag.ScriptTimeoutSeconds = reader.ReadUInt16();
     return(tag);
 }
Exemplo n.º 3
0
        static SwfTagBase Create(SwfTagData tag_data)
        {
            var reader = new SwfStreamReader(tag_data.TagData);

            switch (tag_data.TagId)
            {
            // Display list
            case (int)SwfTagType.PlaceObject:                  return(PlaceObjectTag.Create(reader));

            case (int)SwfTagType.PlaceObject2:                 return(PlaceObject2Tag.Create(reader));

            case (int)SwfTagType.PlaceObject3:                 return(PlaceObject3Tag.Create(reader));

            case (int)SwfTagType.RemoveObject:                 return(RemoveObjectTag.Create(reader));

            case (int)SwfTagType.RemoveObject2:                return(RemoveObject2Tag.Create(reader));

            case (int)SwfTagType.ShowFrame:                    return(ShowFrameTag.Create(reader));

            // Control
            case (int)SwfTagType.SetBackgroundColor:           return(SetBackgroundColorTag.Create(reader));

            case (int)SwfTagType.FrameLabel:                   return(FrameLabelTag.Create(reader));

            case (int)SwfTagType.Protect:                      return(ProtectTag.Create(reader));

            case (int)SwfTagType.End:                          return(EndTag.Create(reader));

            case (int)SwfTagType.ExportAssets:                 return(ExportAssetsTag.Create(reader));

            case (int)SwfTagType.ImportAssets:                 return(UnsupportedTag.Create(SwfTagType.ImportAssets));

            case (int)SwfTagType.EnableDebugger:               return(EnableDebuggerTag.Create(reader));

            case (int)SwfTagType.EnableDebugger2:              return(EnableDebugger2Tag.Create(reader));

            case (int)SwfTagType.ScriptLimits:                 return(ScriptLimitsTag.Create(reader));

            case (int)SwfTagType.SetTabIndex:                  return(UnsupportedTag.Create(SwfTagType.SetTabIndex));

            case (int)SwfTagType.ImportAssets2:                return(UnsupportedTag.Create(SwfTagType.ImportAssets2));

            case (int)SwfTagType.SymbolClass:                  return(SymbolClassTag.Create(reader));

            case (int)SwfTagType.Metadata:                     return(MetadataTag.Create(reader));

            case (int)SwfTagType.DefineScalingGrid:            return(UnsupportedTag.Create(SwfTagType.DefineScalingGrid));

            case (int)SwfTagType.DefineSceneAndFrameLabelData: return(DefineSceneAndFrameLabelDataTag.Create(reader));

            // Actions
            case (int)SwfTagType.DoAction:                     return(UnsupportedTag.Create(SwfTagType.DoAction));

            case (int)SwfTagType.DoInitAction:                 return(UnsupportedTag.Create(SwfTagType.DoInitAction));

            case (int)SwfTagType.DoABC:                        return(DoABCTag.Create(reader));

            // Shape
            case (int)SwfTagType.DefineShape:                  return(DefineShapeTag.Create(reader));

            case (int)SwfTagType.DefineShape2:                 return(DefineShape2Tag.Create(reader));

            case (int)SwfTagType.DefineShape3:                 return(DefineShape3Tag.Create(reader));

            case (int)SwfTagType.DefineShape4:                 return(DefineShape4Tag.Create(reader));

            // Bitmaps
            case (int)SwfTagType.DefineBits:                   return(UnsupportedTag.Create(SwfTagType.DefineBits));

            case (int)SwfTagType.JPEGTables:                   return(UnsupportedTag.Create(SwfTagType.JPEGTables));

            case (int)SwfTagType.DefineBitsJPEG2:              return(UnsupportedTag.Create(SwfTagType.DefineBitsJPEG2));

            case (int)SwfTagType.DefineBitsJPEG3:              return(UnsupportedTag.Create(SwfTagType.DefineBitsJPEG3));

            case (int)SwfTagType.DefineBitsLossless:           return(DefineBitsLosslessTag.Create(reader));

            case (int)SwfTagType.DefineBitsLossless2:          return(DefineBitsLossless2Tag.Create(reader));

            case (int)SwfTagType.DefineBitsJPEG4:              return(UnsupportedTag.Create(SwfTagType.DefineBitsJPEG4));

            // Shape Morphing
            case (int)SwfTagType.DefineMorphShape:             return(UnsupportedTag.Create(SwfTagType.DefineMorphShape));

            case (int)SwfTagType.DefineMorphShape2:            return(UnsupportedTag.Create(SwfTagType.DefineMorphShape2));

            // Fonts and Text
            case (int)SwfTagType.DefineFont:                   return(UnsupportedTag.Create(SwfTagType.DefineFont));

            case (int)SwfTagType.DefineFontInfo:               return(UnsupportedTag.Create(SwfTagType.DefineFontInfo));

            case (int)SwfTagType.DefineFontInfo2:              return(UnsupportedTag.Create(SwfTagType.DefineFontInfo2));

            case (int)SwfTagType.DefineFont2:                  return(UnsupportedTag.Create(SwfTagType.DefineFont2));

            case (int)SwfTagType.DefineFont3:                  return(UnsupportedTag.Create(SwfTagType.DefineFont3));

            case (int)SwfTagType.DefineFontAlignZones:         return(UnsupportedTag.Create(SwfTagType.DefineFontAlignZones));

            case (int)SwfTagType.DefineFontName:               return(UnsupportedTag.Create(SwfTagType.DefineFontName));

            case (int)SwfTagType.DefineText:                   return(UnsupportedTag.Create(SwfTagType.DefineText));

            case (int)SwfTagType.DefineText2:                  return(UnsupportedTag.Create(SwfTagType.DefineText2));

            case (int)SwfTagType.DefineEditText:               return(UnsupportedTag.Create(SwfTagType.DefineEditText));

            case (int)SwfTagType.CSMTextSettings:              return(UnsupportedTag.Create(SwfTagType.CSMTextSettings));

            case (int)SwfTagType.DefineFont4:                  return(UnsupportedTag.Create(SwfTagType.DefineFont4));

            // Sounds
            case (int)SwfTagType.DefineSound:                  return(UnsupportedTag.Create(SwfTagType.DefineSound));

            case (int)SwfTagType.StartSound:                   return(UnsupportedTag.Create(SwfTagType.StartSound));

            case (int)SwfTagType.StartSound2:                  return(UnsupportedTag.Create(SwfTagType.StartSound2));

            case (int)SwfTagType.SoundStreamHead:              return(UnsupportedTag.Create(SwfTagType.SoundStreamHead));

            case (int)SwfTagType.SoundStreamHead2:             return(UnsupportedTag.Create(SwfTagType.SoundStreamHead2));

            case (int)SwfTagType.SoundStreamBlock:             return(UnsupportedTag.Create(SwfTagType.SoundStreamBlock));

            // Buttons
            case (int)SwfTagType.DefineButton:                 return(UnsupportedTag.Create(SwfTagType.DefineButton));

            case (int)SwfTagType.DefineButton2:                return(UnsupportedTag.Create(SwfTagType.DefineButton2));

            case (int)SwfTagType.DefineButtonCxform:           return(UnsupportedTag.Create(SwfTagType.DefineButtonCxform));

            case (int)SwfTagType.DefineButtonSound:            return(UnsupportedTag.Create(SwfTagType.DefineButtonSound));

            // Sprites and Movie Clips
            case (int)SwfTagType.DefineSprite:                 return(DefineSpriteTag.Create(reader));

            // Video
            case (int)SwfTagType.DefineVideoStream:            return(UnsupportedTag.Create(SwfTagType.DefineVideoStream));

            case (int)SwfTagType.VideoFrame:                   return(UnsupportedTag.Create(SwfTagType.VideoFrame));

            // Metadata
            case (int)SwfTagType.FileAttributes:               return(FileAttributesTag.Create(reader));

            case (int)SwfTagType.EnableTelemetry:              return(EnableTelemetryTag.Create(reader));

            case (int)SwfTagType.DefineBinaryData:             return(DefineBinaryDataTag.Create(reader));

            default:                                           return(UnknownTag.Create(tag_data.TagId));
            }
        }
Exemplo n.º 4
0
 ITagFormatter ISwfTagVisitor <object, ITagFormatter> .Visit(ScriptLimitsTag tag, object arg)
 {
     return(new ScriptLimitsTagFormatter());
 }
 public SwfDisplayList Visit(ScriptLimitsTag tag, SwfDisplayList dl)
 {
     return(dl);
 }
Exemplo n.º 6
0
        protected virtual TagItem ReadTag(HeaderRecord header, FlashReader input)
        {
            TagItem tag = null;

            switch (header.Kind)
            {
            case TagKind.DefineBinaryData:
                tag = new DefineBinaryDataTag(header, input);
                break;

            case TagKind.DefineBitsLossless2:
                tag = new DefineBitsLossless2Tag(header, input);
                break;

            case TagKind.DefineFontName:
                tag = new DefineFontNameTag(header, input);
                break;

            case TagKind.DefineSound:
                tag = new DefineSoundTag(header, input);
                break;

            case TagKind.DoABC:
                tag = new DoABCTag(header, input);
                break;

            case TagKind.End:
                tag = new EndTag(header);
                break;

            case TagKind.ExportAssets:
                tag = new ExportAssetsTag(header, input);
                break;

            case TagKind.FileAttributes:
                tag = new FileAttributesTag(header, input);
                break;

            case TagKind.FrameLabel:
                tag = new FrameLabelTag(header, input);
                break;

            case TagKind.ProductInfo:
                tag = new ProductInfoTag(header, input);
                break;

            case TagKind.ScriptLimits:
                tag = new ScriptLimitsTag(header, input);
                break;

            case TagKind.SetBackgroundColor:
                tag = new SetBackgroundColorTag(header, input);
                break;

            case TagKind.ShowFrame:
                tag = new ShowFrameTag(header);
                break;

            case TagKind.SymbolClass:
                tag = new SymbolClassTag(header, input);
                break;

            default:
            case TagKind.Unknown:
                tag = new UnknownTag(header, input);
                break;
            }
            return(tag);
        }