mirror of
https://github.com/xavo95/repak.git
synced 2025-06-16 06:31:14 +00:00
2.4 Beta decryption with zlib fix (#2)
* fix: Zlib decryption for wuwa For wuwa 2.4Beta+ * fix: updated per requests * fix: build errors
This commit is contained in:
parent
86e6144d9e
commit
2ad368a239
1 changed files with 9 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
use std::io;
|
||||
use std::{io, process::exit};
|
||||
|
||||
use byteorder::{LE, ReadBytesExt, WriteBytesExt};
|
||||
|
||||
|
@ -347,7 +347,14 @@ 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(all(feature = "wuthering-waves", feature = "compression"))]
|
||||
if let Some(Compression::Zlib) = self.compression_slot.and_then(|c| compression[c as usize]) {
|
||||
data_len = data_len.min(2048);
|
||||
}
|
||||
|
||||
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