mirror of
https://github.com/Ap0dexMe0/unixtract.git
synced 2026-07-15 21:00:03 +02:00
pfl_upg: prevent file collisions (needs more work)
This commit is contained in:
+14
-1
@@ -153,7 +153,20 @@ pub fn extract_pfl_upg(mut file: &File, output_folder: &str) -> Result<(), Box<d
|
||||
|
||||
let data = common::read_exact(&mut data_reader, file_header.stored_size as usize)?;
|
||||
|
||||
let output_path = Path::new(&output_folder).join(file_header.file_name().trim_start_matches('/'));
|
||||
let mut output_path = Path::new(&output_folder).join(file_header.file_name().trim_start_matches('/'));
|
||||
let output_path_parent = output_path.parent().expect("Failed to get parent of the output path!");
|
||||
|
||||
//prevent collisions because philips is dumb
|
||||
if output_path_parent.exists() && output_path_parent.is_file() {
|
||||
let fixed_file_name = if let Some((a, b)) = file_header.file_name().rsplit_once('/') {
|
||||
format!("{}_{}", a, b)
|
||||
} else {
|
||||
file_header.file_name()
|
||||
};
|
||||
|
||||
output_path = Path::new(&output_folder).join(file_header.file_name().trim_start_matches('/'));
|
||||
println!("[!] Warning: File collision detected, this file will be saved to: {}", fixed_file_name);
|
||||
}
|
||||
|
||||
if let Some(parent) = output_path.parent() {
|
||||
fs::create_dir_all(parent)?;
|
||||
|
||||
+2
-1
@@ -75,7 +75,8 @@ pub static EPK2: &[(&str, &str)] = &[
|
||||
//github.com/openlgtv/epk2extract
|
||||
pub static EPK3: &[(&str, &str)] = &[
|
||||
("34CC219D3AFC102433109BBC1DA44095", "m14 (m14tv) - LX webOS 1 (2014)"),
|
||||
("52A208FA24E7E70730A40999B1C22C148F4920484BC50B515D243E35D14689F1", "o24n - LX webOS 10 (2025)")
|
||||
("74514676D68B9A72A0093CEF56D3067484E1F4D5CF7D4B4ED389BED030FA1B09", "k7lp - Realtek webOS 6 (2021)"),
|
||||
("52A208FA24E7E70730A40999B1C22C148F4920484BC50B515D243E35D14689F1", "o24n - LX webOS 10 (2025)"),
|
||||
];
|
||||
|
||||
//pana dvd keys (no AES)
|
||||
|
||||
Reference in New Issue
Block a user