mirror of
https://github.com/Ap0dexMe0/unixtract.git
synced 2026-07-15 21:00:03 +02:00
nvt_timg: temp fix for other format false extraction
This commit is contained in:
@@ -9,7 +9,7 @@ use crate::utils::compression::{decompress_gzip};
|
|||||||
|
|
||||||
#[derive(Debug, BinRead)]
|
#[derive(Debug, BinRead)]
|
||||||
struct PIMG {
|
struct PIMG {
|
||||||
#[br(count = 4)] _magic_bytes: Vec<u8>,
|
#[br(count = 4)] magic_bytes: Vec<u8>,
|
||||||
_unknown1: u32,
|
_unknown1: u32,
|
||||||
size: u32,
|
size: u32,
|
||||||
_unknown2: u32,
|
_unknown2: u32,
|
||||||
@@ -49,6 +49,12 @@ pub fn extract_nvt_timg(mut file: &File, output_folder: &str) -> Result<(), Box<
|
|||||||
Ok(val) => val,
|
Ok(val) => val,
|
||||||
Err(_) => break, // EOF
|
Err(_) => break, // EOF
|
||||||
};
|
};
|
||||||
|
//there is an old format of TIMG, this is just temporary fix to prevent false extraction until i implement it.
|
||||||
|
if pimg.magic_bytes != b"PIMG" {
|
||||||
|
println!("Invalid PIMG magic!");
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
let data = common::read_exact(&mut file, pimg.size as usize)?;
|
let data = common::read_exact(&mut file, pimg.size as usize)?;
|
||||||
|
|
||||||
println!("\n#{} - {}, Size: {}, Dest: {}, Compression: {}", pimg_i, pimg.name(), pimg.size, pimg.dest_dev(), pimg.comp_type());
|
println!("\n#{} - {}, Size: {}, Dest: {}, Compression: {}", pimg_i, pimg.name(), pimg.size, pimg.dest_dev(), pimg.comp_type());
|
||||||
|
|||||||
Reference in New Issue
Block a user