Esempio n. 1
0
        public override bool Equals(System.Object object_Renamed)
        {
            bool isEqual = false;

            if (base.Equals(object_Renamed) && (object_Renamed is GenericTag))
            {
                GenericTag genericTag = (GenericTag)object_Renamed;

                if (equals(genericTag.data, this.data))
                {
                    isEqual = true;
                }
            }

            return(isEqual);
        }
Esempio n. 2
0
		public override void  unknown(GenericTag tag)
		{
			tags.Add(tag);
		}
Esempio n. 3
0
		public override void  protect(GenericTag tag)
		{
			tags.Add(tag);
		}
Esempio n. 4
0
		public override void  soundStreamBlock(GenericTag tag)
		{
			tags.Add(tag);
		}
Esempio n. 5
0
		public override void  jpegTables(GenericTag tag)
		{
			tags.Add(tag);
		}
		public virtual void  jpegTables(GenericTag tag)
		{
		}
		public virtual void  unknown(GenericTag tag)
		{
		}
		public virtual void  protect(GenericTag tag)
		{
		}
		public virtual void  soundStreamBlock(GenericTag tag)
		{
		}
Esempio n. 10
0
		private Tag decodeUnknown(int length, int code)
		{
			GenericTag t;
			t = new GenericTag(code);
			t.data = new byte[length];
			r.readFully(t.data);
			return t;
		}
Esempio n. 11
0
		/// <summary> decode jpeg tables.  only one per movie.  second and subsequent
		/// occurences of this tag are ignored by the player.
		/// </summary>
		/// <param name="length">
		/// </param>
		/// <returns>
		/// </returns>
		/// <throws>  IOException </throws>
		private GenericTag decodeJPEGTables(int length)
		{
			GenericTag t;
			t = new GenericTag(Flash.Swf.TagValues.stagJPEGTables);
			t.data = new byte[length];
			r.readFully(t.data);
			return t;
		}
Esempio n. 12
0
		private Tag decodeSoundStreamBlock(int length)
		{
			GenericTag t = new GenericTag(Flash.Swf.TagValues.stagSoundStreamBlock);
			t.data = new byte[length];
			r.readFully(t.data);
			return t;
		}
Esempio n. 13
0
		private Tag decodeProtect(int length)
		{
			GenericTag t;
			t = new GenericTag(Flash.Swf.TagValues.stagProtect);
			t.data = new byte[length];
			r.readFully(t.data);
			return t;
		}
Esempio n. 14
0
		private Tag decodeTag(int type, int length)
		{
			Tag t;
			int pos = r.Offset;
			
			switch (type)
			{
				
				case Flash.Swf.TagValues.stagProductInfo: 
					t = decodeSerialNumber();
					break;
				
				case Flash.Swf.TagValues.stagShowFrame: 
					t = new ShowFrame();
					break;
				
				case Flash.Swf.TagValues.stagMetadata: 
					t = decodeMetadata();
					break;
				
				case Flash.Swf.TagValues.stagDefineShape: 
				case Flash.Swf.TagValues.stagDefineShape2: 
				case Flash.Swf.TagValues.stagDefineShape3: 
				case Flash.Swf.TagValues.stagDefineShape6: 
					t = decodeDefineShape(type);
					break;
				
				case Flash.Swf.TagValues.stagPlaceObject: 
					t = decodePlaceObject(length);
					break;
				
				case Flash.Swf.TagValues.stagRemoveObject: 
				case Flash.Swf.TagValues.stagRemoveObject2: 
					t = decodeRemoveObject(type);
					break;
				
				case Flash.Swf.TagValues.stagDefineBinaryData: 
					t = decodeDefineBinaryData(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineBits: 
					t = decodeDefineBits(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineButton: 
					t = decodeDefineButton(length);
					break;
				
				case Flash.Swf.TagValues.stagJPEGTables: 
					t = jpegTables = decodeJPEGTables(length);
					break;
				
				case Flash.Swf.TagValues.stagSetBackgroundColor: 
					t = decodeSetBackgroundColor();
					break;
				
				case Flash.Swf.TagValues.stagDefineFont: 
					t = decodeDefineFont();
					break;
				
				case Flash.Swf.TagValues.stagDefineText: 
				case Flash.Swf.TagValues.stagDefineText2: 
					t = decodeDefineText(type);
					break;
				
				case Flash.Swf.TagValues.stagDoAction: 
					t = decodeDoAction(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineFontInfo: 
				case Flash.Swf.TagValues.stagDefineFontInfo2: 
					t = decodeDefineFontInfo(type, length);
					break;
				
				case Flash.Swf.TagValues.stagDefineSound: 
					t = decodeDefineSound(length);
					break;
				
				case Flash.Swf.TagValues.stagStartSound: 
					t = decodeStartSound();
					break;
				
				case Flash.Swf.TagValues.stagDefineButtonSound: 
					t = decodeDefineButtonSound();
					break;
				
				case Flash.Swf.TagValues.stagSoundStreamHead2: 
				case Flash.Swf.TagValues.stagSoundStreamHead: 
					t = decodeSoundStreamHead(type);
					break;
				
				case Flash.Swf.TagValues.stagSoundStreamBlock: 
					t = decodeSoundStreamBlock(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineBitsLossless: 
					t = decodeDefineBitsLossless(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineBitsJPEG2: 
					t = decodeDefineJPEG2(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineButtonCxform: 
					t = decodeDefineButtonCxform();
					break;
				
				case Flash.Swf.TagValues.stagProtect: 
					t = decodeProtect(length);
					break;
				
				case Flash.Swf.TagValues.stagPlaceObject2: 
					t = decodePlaceObject23(Flash.Swf.TagValues.stagPlaceObject2, length);
					break;
				
				case Flash.Swf.TagValues.stagPlaceObject3: 
					t = decodePlaceObject23(Flash.Swf.TagValues.stagPlaceObject3, length);
					break;
				
				case Flash.Swf.TagValues.stagDefineButton2: 
					t = decodeDefineButton2(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineBitsJPEG3: 
					t = decodeDefineJPEG3(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineBitsLossless2: 
					t = decodeDefineBitsLossless2(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineEditText: 
					t = decodeDefineEditText();
					break;
				
				case Flash.Swf.TagValues.stagDefineSprite: 
					t = decodeDefineSprite(pos + length);
					break;
				
				case Flash.Swf.TagValues.stagDefineScalingGrid: 
					t = decodeDefineScalingGrid();
					break;
				
				case Flash.Swf.TagValues.stagFrameLabel: 
					t = decodeFrameLabel(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineMorphShape: 
					t = decodeDefineMorphShape();
					break;
				
				case Flash.Swf.TagValues.stagDefineMorphShape2: 
					t = decodeDefineMorphShape2();
					break;
				
				case Flash.Swf.TagValues.stagDefineFont2: 
					t = decodeDefineFont2();
					break;
				
				case Flash.Swf.TagValues.stagDefineFont3: 
					t = decodeDefineFont3();
					break;
				
				case Flash.Swf.TagValues.stagDefineFont4: 
					t = decodeDefineFont4(length);
					break;
				
				case Flash.Swf.TagValues.stagExportAssets: 
					t = decodeExportAssets();
					break;
				
				case Flash.Swf.TagValues.stagImportAssets: 
				case Flash.Swf.TagValues.stagImportAssets2: 
					t = decodeImportAssets(type);
					break;
				
				case Flash.Swf.TagValues.stagEnableDebugger2: 
				case Flash.Swf.TagValues.stagEnableDebugger: 
					t = decodeEnableDebugger(type);
					break;
				
				case Flash.Swf.TagValues.stagDoInitAction: 
					t = decodeDoInitAction(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineVideoStream: 
					t = decodeDefineVideoStream();
					break;
				
				case Flash.Swf.TagValues.stagVideoFrame: 
					t = decodeVideoFrame(length);
					break;
				
				case Flash.Swf.TagValues.stagDebugID: 
					t = decodeDebugID(type, length);
					break;
				
				case Flash.Swf.TagValues.stagScriptLimits: 
					t = decodeScriptLimits();
					break;
				
				case Flash.Swf.TagValues.stagSetTabIndex: 
					t = decodeSetTabIndex();
					break;
				
				case Flash.Swf.TagValues.stagDoABC: 
				case Flash.Swf.TagValues.stagDoABC2: 
					t = decodeDoABC(type, length);
					break;
				
				case Flash.Swf.TagValues.stagSymbolClass: 
					t = decodeSymbolClass();
					break;
				
				case Flash.Swf.TagValues.stagFileAttributes: 
					t = decodeFileAttributes();
					break;
				
				case Flash.Swf.TagValues.stagDefineFontAlignZones: 
					t = decodeDefineFontAlignZones();
					break;
				
				case Flash.Swf.TagValues.stagCSMTextSettings: 
					t = decodeCSMTextSettings();
					break;
				
				case Flash.Swf.TagValues.stagDefineSceneAndFrameLabelData: 
					t = decodeDefineSceneAndFrameData(length);
					break;
				
				case Flash.Swf.TagValues.stagDefineFontName: 
					t = decodeDefineFontName();
					break;
				
				default: 
					t = decodeUnknown(length, type);
					break;
				
			}
			
			int consumed = r.Offset - pos;
			
			// [preilly] It looks like past Authoring tools have generated some SWF's with
			// stagSoundStreamHead tags of length 4 with compression set to mp3, but the tag
			// really has 6 bytes in it and the player always reads the 6 bytes, so ignore the
			// difference between the consumed and the length for this special case.
			if ((consumed != length) && (type == Flash.Swf.TagValues.stagSoundStreamHead) && (consumed != (length + 2)))
			{
				throw new SwfFormatException(Flash.Swf.TagValues.names[type] + " at pos " + pos + ": " + consumed + " bytes were read. " + length + " byte were required.");
			}
			return t;
		}