feat: added glue exports for kwm/qmc

This commit is contained in:
鲁树人
2024-09-07 13:13:39 +01:00
parent e7d8231474
commit 3292ad51ea
16 changed files with 398 additions and 241 deletions

View File

@@ -36,6 +36,18 @@ pub enum Cipher {
V2(CipherV2),
}
impl Cipher {
pub fn decrypt<T>(&self, data: &mut T, offset: usize)
where
T: AsMut<[u8]> + ?Sized,
{
match self {
Cipher::V1(cipher) => cipher.decrypt(data, offset),
Cipher::V2(cipher) => cipher.decrypt(data, offset),
}
}
}
pub struct Header {
pub magic: [u8; 0x10],