Ninres-rs
Read commonly used Nintendo file formats.
Please refer to the Wiki: https://github.com/Kinnay/Nintendo-File-Formats/wiki
All file formats are behind feature flags. Here is a list of available Nintendo file format features:
bfres, sarc
You can also enable additional features:
tar_ninres: write Nintendo resource to tar ball.
zstd: ZSTD decompression.
All features of this crate can be compiled to WebAssembly.
Examples
Enable desired features in Cargo.toml.
[]
= { = "*", = ["bfres", "sarc", "zstd"] }
In your main.rs.
use read;
use ;
let buffer = read?;
let ninres = buffer.as_ninres?;
match &ninres
Write to tar
Convert resource into tar buffer. This buffer can then e.g. be stored in a file.
The mode parameter refers to the file mode within the tar ball.
Examples
use ;
use ;
let sarc_file = new?;
let tar = sarc_file.into_tar?;
let mut file = create?;
file.write_all?;