Crates.io | flash-lso |
lib.rs | flash-lso |
version | 0.5.0 |
source | src |
created_at | 2020-06-24 16:37:46.079107 |
updated_at | 2021-02-08 20:52:48.274648 |
description | Fast and safe SOL/AMF0/AMF3 parsing. Supports serde, Adobe flex and cyclic references |
homepage | |
repository | https://github.com/CUB3D/rust-sol |
max_upload_size | |
id | 257621 |
size | 12,288,612 |
A parser and serializer for Adobe Local Shared Object (LSO) file format (.sol), AMF0 and AFM3 in 100% safe rust
The primary goal of this crate is to be as safe as possible against malformed and invalid input and to fail cleanly when this is identified.
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);
}
The web
directory contains an example web viewer for LSO files using yew. To run, first build into WASM like so
cd web
wasm-pack build --out-name wasm --out-dir ./static --target web --release
Then serve the static directory like so
# If needed install miniserve with `cargo install miniserve`
miniserve ./static --index index.html
This project has a collection of integration tests to verify that it is able to serialize and then deserialize LSO files to produce output that is identical to it's input Also available is a lso-to-json project which allows dumping an LSO file to json for debugging and testing.
To enable serde support
flash-lso = { version = "0.2.0", features = ["serde"] }
To enable (alpha) support for flex
flash-lso = { version = "0.2.0", features = ["flex"] }
This project makes use of cargo-fuzz to ensure correct handling of invalid data
cargo fuzz run --release fuzz_amf3_body
This project is licensed under MIT