Skip to content

Commit

Permalink
Fixed nasty filename bug. Closed #15
Browse files Browse the repository at this point in the history
  • Loading branch information
Lazza committed Sep 17, 2017
1 parent 987ab05 commit 37f2535
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
__author__ = "Andrea Lazzarotto"
__copyright__ = "(c) 2014-2017, Andrea Lazzarotto"
__license__ = "GPLv3"
__version__ = "1.1"
__version__ = "1.1.1"
__maintainer__ = "Andrea Lazzarotto"
__email__ = "andrea.lazzarotto@gmail.com"

Expand Down
13 changes: 8 additions & 5 deletions recuperabit/fs/ntfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,15 @@ def __init__(self, parsed, offset, is_ghost=False, ads=''):
size = attr['content_size']
break

name = best_name([
(f['content']['namespace'], f['content']['name'] + ads_suffix)
for f in filenames if f.has_key('content') and
filtered = [
f for f in filenames if f.has_key('content') and
f['content'] is not None and
f['content']['name_length'] > 0 and
f['content']['name'] is not None
]
name = best_name([
(f['content']['namespace'], f['content']['name'] + ads_suffix)
for f in filtered
])
hasname = name is not None

Expand All @@ -300,10 +303,10 @@ def __init__(self, parsed, offset, is_ghost=False, ads=''):
File.__init__(self, index, name, size, is_dir, is_del, is_ghost)
# Additional attributes
if hasname:
parent_id = filenames[0]['content']['parent_entry']
first = filtered[0]['content']
parent_id = first['parent_entry']
File.set_parent(self, parent_id)
File.set_offset(self, offset)
first = filenames[0]['content']
File.set_mac(
self, first['modification_time'],
first['access_time'], first['creation_time']
Expand Down

0 comments on commit 37f2535

Please sign in to comment.