ShockwaveFlash
SWF

Overview

Read, edit and write SWF files as a strongly-typed, mutable tag tree.

The ShockwaveFlash package disassembles a .swf into a strongly-typed tag tree, lets you inspect or edit it in code, then assembles it back — the round-trip is lossless: byte-identical for canonically-encoded SWFs and byte-stable on re-encode, validated on a real corpus of production files.

using ShockwaveFlash;

var swf = ShockwaveFlashFile.Disassemble(File.ReadAllBytes("movie.swf"));

Console.WriteLine($"SWF v{swf.Header.Version} ({swf.Header.Compression})");
Console.WriteLine($"Frame size : {swf.Header.FrameSize}");
Console.WriteLine($"Frame rate : {swf.Header.FrameRate.ToSingle()} fps");
Console.WriteLine($"Tags       : {swf.Tags.Count}");

File.WriteAllBytes("copy.swf", swf.Assemble().ToArray());

At a glance

  • Broad tag coverage — shapes, fonts, text, sounds, bitmaps, sprites, buttons, morph shapes, video, ABC and control tags. Unknown tags are preserved verbatim, so nothing is lost on round-trip.
  • Exact wire model — fixed-point types (Fixed16 16.16, Fixed8 8.8) and twip rectangles; no lossy float conversions on the wire.
  • All three containersFWS (uncompressed), CWS (zlib) and ZWS (LZMA) are read and written.
  • Allocation-light — the public surface works over ReadOnlyMemory<byte>; no unsafe, no Span plumbing in your code.

On this page