mirror of
https://github.com/pcvolkmer/osc-variant.git
synced 2025-12-16 07:33:20 +00:00
Add optional OSB alternative password parameter
This commit is contained in:
@@ -48,11 +48,9 @@ macro_rules! error {
|
||||
};
|
||||
}
|
||||
|
||||
pub fn unzip_osb(path: &str) {
|
||||
pub fn unzip_osb_using_password(path: &str, password: &str) {
|
||||
println!("Entpacke OSB-Datei {}\n", style(path).yellow());
|
||||
|
||||
let pw = deobfuscate(env!("OSB_KEY").trim());
|
||||
|
||||
let file = match fs::File::open(path) {
|
||||
Ok(file) => file,
|
||||
Err(err) => {
|
||||
@@ -78,7 +76,7 @@ pub fn unzip_osb(path: &str) {
|
||||
};
|
||||
|
||||
for i in 0..archive.len() {
|
||||
let mut file = if let Ok(Ok(file)) = archive.by_index_decrypt(i, pw.as_bytes()) {
|
||||
let mut file = if let Ok(Ok(file)) = archive.by_index_decrypt(i, password.as_bytes()) {
|
||||
file
|
||||
} else {
|
||||
println!(
|
||||
@@ -130,3 +128,7 @@ pub fn unzip_osb(path: &str) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn unzip_osb(path: &str) {
|
||||
unzip_osb_using_password(path, deobfuscate(env!("OSB_KEY").trim()).as_str());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user