ShockwaveFlash.Avm1 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ShockwaveFlash.Avm1 --version 1.1.0
                    
NuGet\Install-Package ShockwaveFlash.Avm1 -Version 1.1.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.Avm1" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ShockwaveFlash.Avm1" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ShockwaveFlash.Avm1" />
                    
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.Avm1 --version 1.1.0
                    
#r "nuget: ShockwaveFlash.Avm1, 1.1.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.Avm1@1.1.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.Avm1&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ShockwaveFlash.Avm1&version=1.1.0
                    
Install as a Cake Tool

ShockwaveFlash.Avm1

NuGet Downloads License: MIT

AVM1 (ActionScript 1/2 bytecode) support for ShockwaveFlash — decode DoAction bytecode to a typed action model, evaluate data scripts to a typed value tree, edit, and write the bytecode back.

Install

dotnet add package ShockwaveFlash.Avm1

Read a data table

Linear data scripts (localization / config tables, common in older games) are replayed to their global variables:

using ShockwaveFlash;
using ShockwaveFlash.Avm1;
using ShockwaveFlash.Tags.Action;

var swf = ShockwaveFlashFile.Disassemble(File.ReadAllBytes("emotes.swf"));
var version = swf.Header.Version;
var tag = swf.Tags.OfType<DoActionTag>().First();

Avm1Object globals = tag.Evaluate(version);
string name = globals["EM"].AsObject["1"].AsObject["n"].AsString;

Edit & write back

Avm1Object / Avm1Array are editable in place, and primitives convert implicitly:

var globals = tag.Evaluate(version);
var emotes = globals["EM"].AsObject;

emotes["1"].AsObject["n"] = "New name";                                             // change
emotes["24"] = new Avm1Object { Members = { ["n"] = "New emote", ["s"] = "new" } }; // add

var output = swf.ReplaceTag(tag, tag.WithGlobals(globals, version)).Assemble();
File.WriteAllBytes("emotes.swf", output.ToArray());

Raw actions

For surgical edits that preserve everything else byte-for-byte, go through the action list instead of the value tree:

var actions = tag.DecodeActions(version);       // IReadOnlyList<Action>
// ... inspect or modify actions ...
var newTag = tag.WithActions(actions, version); // re-encoded; byte-identical when unchanged

Value model

Evaluate returns an Avm1Object whose members are Avm1Values — Avm1String, Avm1Number, Avm1Boolean, Avm1Null, Avm1Undefined, Avm1Object, Avm1Array. Read them with AsObject / AsArray / AsString / AsNumber / AsBoolean.

Notes

  • The decoder and encoder cover the documented AVM1 opcode set (SWF 1–7) and round-trip byte-for-byte.
  • Avm1Machine is a focused evaluator for linear data scripts — no control-flow or function execution. Opcodes outside the supported subset are collected in UnsupportedOpcodes; pass strict: true to throw Avm1UnsupportedActionException instead of skipping them.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.8.0 104 7/8/2026
1.7.0 99 7/7/2026
1.6.0 137 6/29/2026
1.5.0 99 6/29/2026
1.4.0 112 6/27/2026
1.3.0 106 6/27/2026
1.2.0 100 6/27/2026
1.1.0 102 6/26/2026