ShockwaveFlash 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ShockwaveFlash --version 1.2.0
                    
NuGet\Install-Package ShockwaveFlash -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ShockwaveFlash" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ShockwaveFlash" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="ShockwaveFlash" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ShockwaveFlash --version 1.2.0
                    
#r "nuget: ShockwaveFlash, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ShockwaveFlash@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ShockwaveFlash&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=ShockwaveFlash&version=1.2.0
                    
Install as a Cake Tool

ShockwaveFlash

NuGet Downloads License: MIT

A fast, allocation-light reader and writer for the SWF (Shockwave Flash) binary format, for .NET 10.

Disassemble a .swf into a strongly-typed tag tree, inspect or edit it in code, then assemble 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.

Install

dotnet add package ShockwaveFlash

Read

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}");

foreach (var tag in swf.Tags)
    Console.WriteLine($"  {tag.Metadata.Code} ({tag.Metadata.Length} bytes)");

Edit & write

The movie and its tags are mutable, so edit them in place — Tags is a List<Tag> and every tag exposes settable properties:

using ShockwaveFlash;
using ShockwaveFlash.Tags;

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

swf.Tags.RemoveAll(tag => tag.Metadata.Code is TagCode.Metadata);

File.WriteAllBytes("movie.trimmed.swf", swf.Assemble().ToArray());

Round-trip

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

// true for canonically-encoded SWFs; always byte-stable on a second pass.
bool identical = rebuilt.Span.SequenceEqual(original);

Error handling

Malformed input throws a typed SwfException rather than corrupting state:

using ShockwaveFlash.Exceptions;

try
{
    var swf = ShockwaveFlashFile.Disassemble(bytes);
}
catch (SwfTruncatedException) { /* buffer ended mid-record */ }
catch (SwfFormatException)    { /* not a valid SWF */ }

Notes

  • Coverage — shapes, fonts, text, sounds, bitmaps, sprites, buttons, morph shapes, video, ABC, filters 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); no lossy float conversions.
  • CompressionFWS (uncompressed), CWS (zlib) and ZWS (LZMA), all read and write.
  • No unsafe, no Span plumbing — the public surface works over ReadOnlyMemory<byte>.

Part of the ShockwaveFlash project · MIT © Aerafal

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on ShockwaveFlash:

Package Downloads
ShockwaveFlash.Avm1

AVM1 (ActionScript 1/2 bytecode) decoder, encoder and data evaluator for the ShockwaveFlash SWF library. Disassemble DoAction bytecode to a typed action model, evaluate data scripts to a value tree, and write edits back.

ShockwaveFlash.Rendering

Render SWF characters (shapes, sprites, timelines, images) parsed by ShockwaveFlash to SVG and to raster images (PNG/JPEG/WebP/GIF) through a native, cross-platform Skia backend.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.8.0 131 7/8/2026
1.7.0 120 7/7/2026
1.6.0 196 6/29/2026
1.5.0 121 6/29/2026
1.4.0 130 6/27/2026
1.3.0 128 6/27/2026
1.2.0 119 6/27/2026
1.1.0 109 6/26/2026
1.0.0 98 6/25/2026