mirror of
https://github.com/Ap0dexMe0/unixtract.git
synced 2026-07-16 05:04:22 +02:00
tpv_timg - now rename to nvt_timg, fix false gzip extraction
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
pub mod mstar;
|
pub mod mstar;
|
||||||
pub mod samsung_old;
|
pub mod samsung_old;
|
||||||
pub mod tpv_timg;
|
pub mod nvt_timg;
|
||||||
pub mod pfl_upg;
|
pub mod pfl_upg;
|
||||||
pub mod sddl_sec;
|
pub mod sddl_sec;
|
||||||
pub mod novatek;
|
pub mod novatek;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ impl PIMG {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_tpv_timg_file(file: &File) -> bool {
|
pub fn is_nvt_timg_file(file: &File) -> bool {
|
||||||
let header = common::read_file(&file, 0, 4).expect("Failed to read from file.");
|
let header = common::read_file(&file, 0, 4).expect("Failed to read from file.");
|
||||||
if header == b"TIMG" {
|
if header == b"TIMG" {
|
||||||
true
|
true
|
||||||
@@ -48,7 +48,7 @@ fn decompress_gzip(compressed_data: &[u8]) -> Result<Vec<u8>, Box<dyn std::error
|
|||||||
Ok(decompressed)
|
Ok(decompressed)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn extract_tpv_timg(mut file: &File, output_folder: &str) -> Result<(), Box<dyn std::error::Error>> {
|
pub fn extract_nvt_timg(mut file: &File, output_folder: &str) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let _timg = common::read_exact(&mut file, 288)?; //TIMG magic + header
|
let _timg = common::read_exact(&mut file, 288)?; //TIMG magic + header
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
@@ -62,7 +62,7 @@ pub fn extract_tpv_timg(mut file: &File, output_folder: &str) -> Result<(), Box<
|
|||||||
|
|
||||||
let out_data;
|
let out_data;
|
||||||
|
|
||||||
if pimg.comp_type() == "gzip" {
|
if pimg.comp_type() == "gzip" && data.starts_with(b"\x1F\x8B") { //additionally check for gzip header, because sometimes its deceptive
|
||||||
println!("- Decompressing gzip...");
|
println!("- Decompressing gzip...");
|
||||||
out_data = decompress_gzip(&data)?;
|
out_data = decompress_gzip(&data)?;
|
||||||
} else if pimg.comp_type() == "none" {
|
} else if pimg.comp_type() == "none" {
|
||||||
+3
-3
@@ -65,9 +65,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
println!("MSD11 file detected!");
|
println!("MSD11 file detected!");
|
||||||
formats::msd11::extract_msd11(&file, &output_path)?;
|
formats::msd11::extract_msd11(&file, &output_path)?;
|
||||||
}
|
}
|
||||||
else if formats::tpv_timg::is_tpv_timg_file(&file) {
|
else if formats::nvt_timg::is_nvt_timg_file(&file) {
|
||||||
println!("TPV TIMG file detected!");
|
println!("Novatek TIMG file detected!");
|
||||||
formats::tpv_timg::extract_tpv_timg(&file, &output_path)?;
|
formats::nvt_timg::extract_nvt_timg(&file, &output_path)?;
|
||||||
}
|
}
|
||||||
else if formats::novatek::is_novatek_file(&file) {
|
else if formats::novatek::is_novatek_file(&file) {
|
||||||
println!("Novatek file detected!");
|
println!("Novatek file detected!");
|
||||||
|
|||||||
+1
-1
@@ -12,6 +12,7 @@
|
|||||||
| Mediatek PKG | Many Mediatek-based TVs (Hisense, Sony, Panasonic, Philips...) | Only files with 144 byte header and using 4xVendor magic as enc key are supported | https://github.com/openlgtv/epk2extract |
|
| Mediatek PKG | Many Mediatek-based TVs (Hisense, Sony, Panasonic, Philips...) | Only files with 144 byte header and using 4xVendor magic as enc key are supported | https://github.com/openlgtv/epk2extract |
|
||||||
| Mediatek upgrade_loader | Older Mediatek-based TVs | All files should be supported providing they are not encrypted | - |
|
| Mediatek upgrade_loader | Older Mediatek-based TVs | All files should be supported providing they are not encrypted | - |
|
||||||
| Novatek pkg | Some Novatek-based TVs (Philips, LG..) | All files should be supported | https://github.com/openlgtv/epk2extract |
|
| Novatek pkg | Some Novatek-based TVs (Philips, LG..) | All files should be supported | https://github.com/openlgtv/epk2extract |
|
||||||
|
| Novatek TIMG | Later Novatek Based TVs (Philips TitanOS/Hisense) | All files should be supported | - |
|
||||||
| Panasonic Blu-Ray (PANA_DVD) | Panasonic Blu-Ray Players/Recorders | Only some files are supported (**depends on keys**) | - |
|
| Panasonic Blu-Ray (PANA_DVD) | Panasonic Blu-Ray Players/Recorders | Only some files are supported (**depends on keys**) | - |
|
||||||
| Philips UPG | Philips pre-TPVision TVS 2008-2013 | Only some files are supported (**depends on keys**) | https://github.com/frederic/pflupg-tool |
|
| Philips UPG | Philips pre-TPVision TVS 2008-2013 | Only some files are supported (**depends on keys**) | https://github.com/frederic/pflupg-tool |
|
||||||
| PUP | Sony PlayStation 4/ PlayStation 5 | File has to be decrypted | https://github.com/Zer0xFF/ps4-pup-unpacker |
|
| PUP | Sony PlayStation 4/ PlayStation 5 | File has to be decrypted | https://github.com/Zer0xFF/ps4-pup-unpacker |
|
||||||
@@ -21,4 +22,3 @@
|
|||||||
| SDDL.SEC | Panasonic TVs 2011+ | All files 2011+ are supported | https://github.com/theubusu/sddl_dec |
|
| SDDL.SEC | Panasonic TVs 2011+ | All files 2011+ are supported | https://github.com/theubusu/sddl_dec |
|
||||||
| SLP | Samsung Tizen-based NX series cameras | All files should be supported | - |
|
| SLP | Samsung Tizen-based NX series cameras | All files should be supported | - |
|
||||||
| Sony BDP | Sony Blu-Ray players | Only platforms up to MSB18 are supported | http://malcolmstagg.com/bdp/s390-firmware.html |
|
| Sony BDP | Sony Blu-Ray players | Only platforms up to MSB18 are supported | http://malcolmstagg.com/bdp/s390-firmware.html |
|
||||||
| Philips/TPVision TIMG | Philips/TPV Non-Android (TitanOS/ 2023) TVs | All files should be supported | - |
|
|
||||||
Reference in New Issue
Block a user