A fast and safe parser for Adobe Flash Local Shared Object files (.sol), AMF0 and AMF3 in rust

Tom Schuster 2f770555ea tests: Test AMF0 ECMAArray 2 months ago
.github 8a1a885083 Update libraries + minor refactor 2 years ago
flash-lso 2f770555ea tests: Test AMF0 ECMAArray 2 months ago
fuzz e00e01cbc1 Update libraries 1 year ago
lso-to-json 41e71c4dc1 Update env_logger requirement from 0.9.0 to 0.10.0 1 year ago
web 2c461570f1 Expose Rc in Element constructor 5 months ago
.gitignore 559ab9cb97 Fix clippy lints 1 year ago
Cargo.toml 6daa79870b Initial web and build on stable 3 years ago
LICENSE 4b7808d52b Create LICENSE 3 years ago
README.md 0d0da48627 Minor web fixes 7 months ago

README.md

flash-lso

GitHub license GitHub issues

A parser/encoder for Adobe Local Shared Object (LSO) file format (.sol), AMF0 and AFM3 in 100% safe rust.

Features:

  • Parsing and encoding fully supported
  • Heavily tested and fuzzed
  • Circular references fully supported
  • Support for externalizable types (flash.utils.IExternalizable)
  • Support for Adobe flex types

Example

use std::fs::File;
use std::io::Read;
use flash_lso::read::Reader;
fn main() {
    let mut x = File::open(path).expect("Couldn't open file");
    let mut data = Vec::new();
    let _ = x.read_to_end(&mut data).expect("Unable to read file");
    let d = Reader::default().parse_full(&data).expect("Failed to parse lso file");
    println!("{:#?}", d);
}

Development / Testing

To aid with development, there is a sub-project: reader, which can parse either a single file or all files in a directory and will report on which files succeeded and failed to parse

In future this will be used to verify and compare the output with the official implementation

Fuzzing

This project makes use of cargo-fuzz to ensure correct handling of invalid data

cargo fuzz run --release fuzz_amf3_body

Web

building:

wasm-pack build --out-name web --out-dir ./static --target web --release
miniserve ./static --index index.html

License

This project is licensed under MIT.

Icons used in the web editor (web/static/icon) are sourced from https://feathericons.com under MIT

Some test cases are covered under their own License, see README.md for details