2 unstable releases

0.2.0 Jan 7, 2024
0.1.0 Aug 16, 2023

#329 in Compression

39 downloads per month
Used in cdragon

MIT/Apache

39KB
671 lines

CDragon library for WAD files

Library to work with WAD archive files used Riot for League of Legends.


lib.rs:

Support of Riot WAD archive files

Example: list files in wad

use cdragon_wad::{WadFile, WadHashMapper};
let wad = WadFile::open("Global.wad.client").expect("failed to open WAD file");
let hmapper = WadHashMapper::from_path("hashes.game.txt").expect("failed to load hashes");
for entry in wad.iter_entries() {
    let entry = entry.expect("failed to read entry");
    println!("{}", hmapper.get(entry.path.hash).unwrap_or("?"));
}

cdragon_hashes::HashKind can be used to use the appropriate hash file (assuming CDragon's files are used).

if let Some(kind) = HashKind::from_wad_path("Global.wad.client") {
  let mapper = WadHashMapper::from_path(kind.mapping_path());
}

Dependencies

~5.5MB
~104K SLoC