Skip to content

Commit

Permalink
fix: some 7z files omit the length of compressed files at the end, sk…
Browse files Browse the repository at this point in the history
…ip them
  • Loading branch information
philsmd committed Jan 20, 2017
1 parent 65e854c commit 929a12e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions 7z2hashcat.pl
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,8 @@ sub extract_hash_from_archive

$number_coders = $folder->{'number_coders'};

my $num_pack_sizes = scalar (@{$pack_info->{'pack_sizes'}});

for (my $coder_pos = 0; $coder_pos < $number_coders; $coder_pos++)
{
$coder = $folder->{'coders'}[$coder_pos];
Expand All @@ -856,8 +858,12 @@ sub extract_hash_from_archive

# ELSE: update seek position and index:

my $pack_size = $pack_info->{'pack_sizes'}[$current_index];
$current_seek_position += $pack_size;
if ($current_index < $num_pack_sizes) # not all pack_sizes always need to be known (final ones can be skipped)
{
my $pack_size = $pack_info->{'pack_sizes'}[$current_index];

$current_seek_position += $pack_size;
}

$current_index++;
}
Expand Down

0 comments on commit 929a12e

Please sign in to comment.