Skip to content

Commit

Permalink
Disable zero-fill for damaged content. Fixes #75
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazza committed Jan 2, 2021
1 parent 03a118a commit 7d3e769
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions recuperabit/fs/ntfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,15 +328,12 @@ def content_iterator(self, partition, image, datas):
for attr in datas:
diff = attr['start_VCN'] - vcn
if diff > 0:
# We do not try to fill with zeroes as this might produce huge useless files
logging.warning(
u'Missing part for {}, filling {} clusters '
'with zeros'.format(self, diff)
u'Missing part for {}, {} clusters skipped'.format(self, diff)
)
while diff > 0:
amount = min(max_sectors//spc, diff)
vcn += amount
diff -= amount
yield '\x00' * sector_size * spc * amount
vcn += diff
yield ''

clusters_pos = 0
size = attr['real_size']
Expand Down

0 comments on commit 7d3e769

Please sign in to comment.