#file-reader #thread-safe #wz #maplestory #wzlib

wz_reader

A wz file reader to resolve wz file with thread safe

11 releases

new 0.0.14 Dec 10, 2024
0.0.13 Dec 9, 2024
0.0.12 Nov 11, 2024
0.0.11 Sep 10, 2024
0.0.4 Apr 24, 2024

#1235 in Parser implementations

Download history 102/week @ 2024-09-04 52/week @ 2024-09-11 9/week @ 2024-09-18 37/week @ 2024-09-25 18/week @ 2024-10-02 107/week @ 2024-11-06 26/week @ 2024-11-13 6/week @ 2024-11-20 2/week @ 2024-11-27 210/week @ 2024-12-04

279 downloads per month

Custom license

280KB
6.5K SLoC

wz-reader-rs

Maplestory *.Wz file reading written in rust, try port similer code from WzComparerR2.WzLib and MapleLib

It a rust learning project, performance maybe not as good as C#.

Dependencies

  • Image
    • flate2
    • image
  • Char Decryption
    • aes
    • ecb
  • Data
    • hashbrown - Hashmap
    • memmap2
  • Others
    • rayon
    • scroll
    • thiserror

Minimum supported Rust version

wz_reader's MSRV is 1.70.0

Example

use wz_reader::util::{resolve_base, walk_node};
// NodeCast trait provide try_as_* functions to casting WzNode
use wz_reader::NodeCast;

fn main() {
    // resolve wz files
    let base_node = resolve_base(r"D:\MapleStory\Data\Base.wz", None).unwrap();

    // try to parsing every nodes on the way
    walk_node(&base_node, true, &|node| {
        let node_read = node.read().unwrap();

        if let Some(sound_node) = node_read.try_as_sound() {
            let path = std::path::Path::new("./sounds").join(node_read.name.as_str());
            if sound_node.save(path).is_err() {
                println!("failed to extract sound: {}", node_read.get_full_path());
            }
        }
    });
}

You can find more example usage in the examples folder.

License

This project is licensed under the MIT license.

Dependencies

~5.5–9MB
~178K SLoC