mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-07 05:18:44 +08:00
fix bug in qlie 3.0 unpack
This commit is contained in:
@@ -980,22 +980,12 @@ pub fn find_key_data(filename: &str) -> Result<Option<Vec<u8>>> {
|
||||
if entry.file_type()?.is_file() {
|
||||
if let Some(ext) = entry.path().extension() {
|
||||
if ext.eq_ignore_ascii_case("exe") {
|
||||
match get_key_data_from_exe(&entry.path()) {
|
||||
Ok(key) => {
|
||||
eprintln!(
|
||||
"Found key data in executable: {}",
|
||||
entry.path().display()
|
||||
);
|
||||
return Ok(Some(key));
|
||||
}
|
||||
Err(e) => {
|
||||
eprintln!(
|
||||
"Failed to get key data from executable {}: {}\n{}",
|
||||
entry.path().display(),
|
||||
e,
|
||||
e.backtrace(),
|
||||
);
|
||||
}
|
||||
if let Ok(key) = get_key_data_from_exe(&entry.path()) {
|
||||
eprintln!(
|
||||
"Found key data in executable: {}",
|
||||
entry.path().display()
|
||||
);
|
||||
return Ok(Some(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1072,6 +1062,9 @@ impl Encryption for Encryption30 {
|
||||
if self.key.is_none() || entry.common_key.is_none() {
|
||||
return Ok(Box::new(Decrypter::new(stream, entry.key, entry.size)));
|
||||
}
|
||||
if entry.is_encrypted == 0 {
|
||||
return Ok(Box::new(stream));
|
||||
}
|
||||
return Ok(Box::new(Encryption30Decrypt::new(
|
||||
stream,
|
||||
&entry.raw_name,
|
||||
|
||||
Reference in New Issue
Block a user