mirror of
https://github.com/Ap0dexMe0/unixtract.git
synced 2026-07-16 05:04:22 +02:00
epk2,epk3: improve signature handling
This commit is contained in:
+3
-3
@@ -75,7 +75,7 @@ pub fn is_epk2_file(file: &File) -> bool {
|
||||
}
|
||||
|
||||
pub fn extract_epk2(mut file: &File, output_folder: &str) -> Result<(), Box<dyn std::error::Error>> {
|
||||
file.seek(SeekFrom::Start(128))?; //inital signature
|
||||
let _header_signature = common::read_exact(&mut file, SIGNATURE_SIZE as usize)?;
|
||||
|
||||
let stored_header = common::read_exact(&mut file, 1584)?; //max header size
|
||||
let header;
|
||||
@@ -122,7 +122,7 @@ pub fn extract_epk2(mut file: &File, output_folder: &str) -> Result<(), Box<dyn
|
||||
let actual_offset = pak.offset + (SIGNATURE_SIZE * signature_count);
|
||||
file.seek(SeekFrom::Start(actual_offset as u64))?;
|
||||
|
||||
let _signature = common::read_exact(&mut file, SIGNATURE_SIZE as usize)?;
|
||||
let mut _segment_signature = common::read_exact(&mut file, SIGNATURE_SIZE as usize)?;
|
||||
signature_count += 1;
|
||||
|
||||
let encrypted_header = common::read_exact(&mut file, 128)?;
|
||||
@@ -150,7 +150,7 @@ pub fn extract_epk2(mut file: &File, output_folder: &str) -> Result<(), Box<dyn
|
||||
for i in 0..pak_header.segment_count {
|
||||
// for first segment we already read the header so skip doing that for it
|
||||
if i > 0 {
|
||||
let _signature = common::read_exact(&mut file, 128)?;
|
||||
_segment_signature = common::read_exact(&mut file, 128)?;
|
||||
signature_count += 1;
|
||||
|
||||
let encrypted_header = common::read_exact(&mut file, 128)?;
|
||||
|
||||
Reference in New Issue
Block a user