public TagsRemover(string fileName) { Stream stream = new FileStream(fileName, FileMode.Open); SwfReader reader = new SwfReader(stream); swf = reader.ReadSwf(); stream.Close(); }
static void ExploreSWF(Stream stream) { if (stream == null) return; SwfReader reader = new SwfReader(stream); //SwfExportTagReader reader = new SwfExportTagReader(stream); Swf swf = null; try { swf = reader.ReadSwf(); foreach (BaseTag tag in swf) { if (tag is ExportTag) { ExportTag etag = (ExportTag)tag; for (int i = 0; i < etag.Ids.Count; i++) { BaseTag ftag = FindObject(swf, (ushort)etag.Ids[i]); if (ftag is DefineSpriteTag) { DefineSpriteTag stag = (DefineSpriteTag)ftag; Console.WriteLine("Symbol '" + etag.Names[i] + "' - " + stag.Size); } else if (ftag is DefineSoundTag) { DefineSoundTag stag = (DefineSoundTag)ftag; Console.WriteLine("Sound '" + etag.Names[i] + "' - " + stag.MediaData.Length); } else if (ftag is DefineBitsTag) { DefineBitsTag btag = (DefineBitsTag)ftag; Console.WriteLine("Image '" + etag.Names[i] + "' - " + btag.MediaData.Length); } } } else if (tag is DefineFontTag) { DefineFontTag ftag = (DefineFontTag)tag; Console.WriteLine("Font '" + ftag.Name + "' - " + ftag.Data.Length); } } } catch (Exception ex) { Console.WriteLine("-- Swf error: " + ex.Message); } }