mirror of
https://github.com/xavo95/repak.git
synced 2025-06-16 14:31:15 +00:00
fix: Zlib decryption for wuwa
For wuwa 2.4Beta+
This commit is contained in:
parent
86e6144d9e
commit
a7c0d3d6df
1 changed files with 17 additions and 1 deletions
|
@ -347,7 +347,23 @@ impl Entry {
|
|||
return Err(super::Error::Encrypted);
|
||||
};
|
||||
use aes::cipher::BlockDecrypt;
|
||||
for block in data.chunks_mut(16) {
|
||||
|
||||
let mut data_len = data.len();
|
||||
#[cfg(feature = "wuthering-waves")]
|
||||
{
|
||||
data_len = match self.compression_slot.and_then(|c| compression[c as usize]) {
|
||||
Some(Compression::Zlib) => {
|
||||
if data_len > 2048 {
|
||||
2048
|
||||
} else {
|
||||
data_len
|
||||
}
|
||||
},
|
||||
_ => data_len,
|
||||
};
|
||||
}
|
||||
|
||||
for block in data[..data_len].chunks_mut(16) {
|
||||
key.decrypt_block(aes::Block::from_mut_slice(block))
|
||||
}
|
||||
data.truncate(self.compressed as usize);
|
||||
|
|
Loading…
Reference in a new issue