transfer file from one zip to another, WIP (z64 broken)
This commit is contained in:
parent
8157325a02
commit
26b18bab76
4 changed files with 19 additions and 4 deletions
|
|
@ -9,6 +9,7 @@ use crate::{
|
|||
};
|
||||
use androscalpel_serializer::Serializable;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub struct ZipFileReader<T: Read + Seek> {
|
||||
pub end_of_central_directory: EndCentralDirectory,
|
||||
pub zip64_end_of_central_directory: Option<Zip64EndCentralDirectory>,
|
||||
|
|
@ -44,6 +45,7 @@ impl<T: Read + Seek> ZipFileReader<T> {
|
|||
} else {
|
||||
None
|
||||
};
|
||||
//println!("{:#?}", end_of_central_directory);
|
||||
|
||||
// At this point python's ziplib recompute the location of the central directory from the
|
||||
// location of the end of central directory in case the zip was concanated after a file.
|
||||
|
|
@ -64,6 +66,7 @@ impl<T: Read + Seek> ZipFileReader<T> {
|
|||
let cd_size = zip_file.get_cd_size();
|
||||
while size_read < cd_size {
|
||||
let header = FileHeader::deserialize(&mut zip_file.data).unwrap();
|
||||
//println!("{:#?}", header);
|
||||
size_read += header.size() as u64;
|
||||
let pos_in_dir = zip_file.data.stream_position().unwrap();
|
||||
if header.general_purpose_flags & general_purpose_flags::MASK_ENCRYPTED_CENTRAL_DIR != 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue