mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-06 12:58:45 +08:00
Use msg_tool_xp3data package to store xp3 data
This commit is contained in:
14
msg_tool_xp3data/lib.rs
Normal file
14
msg_tool_xp3data/lib.rs
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user