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());Header & wire model
The header fields, fixed-point value types, the frame rectangle in twips, and the FWS/CWS/ZWS compression formats.
Tags
The Tag base type, the mutable Tags list, every concrete tag category, and how unknown tags survive verbatim.
Editing & writing
Disassemble → edit → assemble, replacing tags, verifying the round-trip, and the typed exception hierarchy.
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 (
Fixed1616.16,Fixed88.8) and twip rectangles; no lossyfloatconversions on the wire. - All three containers —
FWS(uncompressed),CWS(zlib) andZWS(LZMA) are read and written. - Allocation-light — the public surface works over
ReadOnlyMemory<byte>; nounsafe, noSpanplumbing in your code.