Crates.io | blte |
lib.rs | blte |
version | 0.4.3 |
created_at | 2025-08-07 04:12:25.643985+00 |
updated_at | 2025-08-11 12:07:58.300122+00 |
description | BLTE (Block Table Encoded) compression/decompression for World of Warcraft CASC files |
homepage | https://github.com/wowemulation-dev/cascette-rs |
repository | https://github.com/wowemulation-dev/cascette-rs |
max_upload_size | |
id | 1784672 |
size | 275,150 |
BLTE (Block Table Encoded) decompression library for Blizzard's NGDP/CASC system.
Add this to your Cargo.toml
:
[dependencies]
blte = "0.3"
ngdp-crypto = "0.3" # Required for encrypted content
This crate provides complete support for decompressing BLTE-encoded files used in Blizzard's content distribution system. BLTE is a container format that supports multiple compression algorithms and encryption.
use blte::decompress_blte;
use ngdp_crypto::KeyService;
// For unencrypted content
let data = std::fs::read("file.blte")?;
let decompressed = decompress_blte(data, None)?;
// For encrypted content
let key_service = KeyService::new();
let decompressed = decompress_blte(data, Some(&key_service))?;
// Streaming decompression for large files
use blte::{BLTEStream, create_streaming_reader};
use std::io::Read;
let mut stream = create_streaming_reader(data, Some(key_service))?;
let mut buffer = [0u8; 8192];
let mut decompressed = Vec::new();
loop {
let bytes_read = stream.read(&mut buffer)?;
if bytes_read == 0 { break; }
decompressed.extend_from_slice(&buffer[..bytes_read]);
}
Raw uncompressed data. The first byte is the mode indicator, followed by the raw data.
Standard deflate compression using the flate2 crate.
LZ4 compression for fast decompression of large files.
Recursive BLTE frame - the payload is another complete BLTE file.
Encrypted blocks that must be decrypted before decompression. Supports:
Large files are split into multiple chunks for efficient streaming and parallel processing:
use blte::BLTEFile;
let blte_file = BLTEFile::parse(data)?;
if blte_file.is_multi_chunk() {
println!("File has {} chunks", blte_file.chunk_count());
}
flate2
- ZLib decompressionlz4_flex
- LZ4 decompressionngdp-crypto
- Encryption supportmd5
- Checksum verificationMIT OR Apache-2.0