Documentation

SWF Parser

crates.io GitHub repository Build status

SWF parser implemented in Rust. Converts bytes to swf-tree movies.

Usage

use swf_parser;
use swf_tree;

fn main() {
  let bytes: &[u8] = ...;
  let (_, movie): (_, swf_tree::Movie) = swf_parser::parsers::movie::parse_movie(&bytes[..])
    .expect("Failed to parse movie");
}

Contributing

This repo uses Git submodules for its test samples:

# Clone with submodules
git clone --recurse-submodules git://github.com/open-flash/swf-parser.git
# Update submodules for an already-cloned repo
git submodule update --init --recursive --remote

This library is a standard Cargo project. You can test your changes with cargo test. The commands must be run from the rs directory.

The Rust implementation supports fuzzing:

# Make sure that you have `cargo-fuzz`
cargo install cargo-fuzz
# Fuzz the `movie` parser
cargo fuzz run movie

Prefer non-master branches when sending a PR so your changes can be rebased if needed. All the commits must be made on top of master (fast-forward merge). CI must pass for changes to be accepted.