Use msg_tool_xp3data package to store xp3 data

This commit is contained in:
2026-04-08 09:40:29 +08:00
parent 6f6d76e5a9
commit 0fbe9cedbc
74 changed files with 99 additions and 28 deletions

14
msg_tool_xp3data/lib.rs Normal file
View File

@@ -0,0 +1,14 @@
#![cfg_attr(any(docsrs, feature = "unstable"), feature(doc_cfg))]
use std::io::Read;
/// Control Block data for CxEncryption packed with SimplePack.
pub const CX_CB_DATA: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/cx_cb.pck"));
const CRYPT_DATA: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/crypt.json.zst"));
/// Get the crypt.json data as a string.
pub fn get_crypt_data() -> String {
let mut decoder = zstd::stream::read::Decoder::new(CRYPT_DATA).unwrap();
let mut out = String::new();
decoder.read_to_string(&mut out).unwrap();
out
}