SWFRecomp

Static Flash Recompiler

Preserving Flash content forever through static recompilation to WebAssembly

What is SWFRecomp?

SWFRecomp is a static recompiler that translates Flash SWF files into portable C code, which can then be compiled to native executables or WebAssembly for modern web browsers.

Unlike emulators that interpret Flash bytecode at runtime, SWFRecomp performs a one-time translation, enabling Flash content to run natively without the Flash Player plugin.

Static Recompilation

Translates ActionScript bytecode to C code at build time, not runtime

WebAssembly Output

Compile to WASM for native browser execution with near-native performance

Native Builds

Also compiles to native executables

Live Demos

add_floats_consecutive_swf_4

Flash SWF test demonstrating floating-point arithmetic addition operations.

View Demo →

add_floats_imprecise_swf_4

Flash SWF test demonstrating floating-point arithmetic addition operations.

View Demo →

add_floats_swf_4

Flash SWF test demonstrating floating-point arithmetic addition operations.

View Demo →

add_strings_imprecise_swf_4

Flash SWF test demonstrating string concatenation with the add operator.

View Demo →

add_strings_swf_4

Flash SWF test demonstrating string concatenation with the add operator.

View Demo →

and_floats_both_0_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

and_floats_first_1_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

and_floats_nonzero_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

and_floats_second_1_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

and_floats_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

divide_floats_error_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

dyna_string_triple_vars_optimized_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

dyna_string_triple_vars_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

dyna_string_vars_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

equals_floats_0_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

equals_floats_1_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

equals_not_floats_false_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

equals_not_floats_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

float_vars_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

jump_swf_4

Flash SWF test demonstrating ActionScript bytecode recompilation to WebAssembly.

View Demo →

less_floats_false_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

less_floats_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

multi_push_vars_swf_4

Flash SWF test demonstrating variable storage and retrieval with ActionScript.

View Demo →

multiply_floats_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

not_floats_nonzero_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

or_floats_false_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

or_floats_first_true_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

or_floats_nonzero_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

or_floats_second_true_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

or_floats_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

string_add_a_list_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_add_b_list_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_add_both_lists_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_add_equals_a_not_list_false_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_add_equals_a_not_list_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_add_equals_b_not_list_false_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_add_equals_b_not_list_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_add_equals_false_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_add_equals_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_add_length_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_add_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_equals_0_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_equals_1_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

string_length_swf_4

Flash SWF test demonstrating string manipulation and operations.

View Demo →

subtract_floats_swf_4

Flash SWF test demonstrating floating-point arithmetic operations.

View Demo →

trace_float_swf_4

Flash SWF test demonstrating console output with the trace() function.

View Demo →

trace_swf_4

Flash SWF test demonstrating console output with the trace() function.

View Demo →

vars_between_frames_swf_4

Flash SWF test demonstrating variable storage and retrieval with ActionScript.

View Demo →

More complex demos with graphics rendering coming soon!

Excluded Tests

The following tests are currently excluded from the live demos due to known issues:

if_swf_4

Missing evaluateCondition() function in runtime

if_false_swf_4

Missing evaluateCondition() function in runtime

speed_test_swf_4

Build timeout - generates 811KB of code (stress test)

How It Works

1. SWF Parsing: Reads and decompresses the Flash SWF file

2. Code Generation: Translates ActionScript bytecode to portable C17 code

3. Compilation: Compiles C code to native executables or WebAssembly

4. Execution: Runs in browsers or as standalone applications