Commit 680492cb by heffnercj

Updated common.BlockFile to include the total file size; deflate.py now uses…

Updated common.BlockFile to include the total file size; deflate.py now uses this during file extraction
......@@ -120,13 +120,15 @@ class BlockFile(file):
self.total_read = 0
self.offset = offset
try:
self.size = file_size(fname)
except:
self.size = 0
if length:
self.length = length
else:
try:
self.length = file_size(fname)
except:
self.length = 0
self.length = self.size
file.__init__(self, fname, mode)
......
......@@ -56,7 +56,7 @@ class Plugin:
# Extract the file
if self.binwalk.extractor.enabled:
self.binwalk.extractor.extract(loc, self.DESCRIPTION, fp.name, (fp.length - loc))
self.binwalk.extractor.extract(loc, self.DESCRIPTION, fp.name, (fp.size - loc))
if (current_total + i) > self.binwalk.scan_length:
break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment