Skip to content

Instantly share code, notes, and snippets.

@rreinhardt
Created September 6, 2016 01:42
Show Gist options
  • Save rreinhardt/49dd99e376de230b43a61b5c184d243a to your computer and use it in GitHub Desktop.
Save rreinhardt/49dd99e376de230b43a61b5c184d243a to your computer and use it in GitHub Desktop.
Fix for local execution of Recuperabit
$ git diff
diff --git a/recuperabit/fs/ntfs.py b/recuperabit/fs/ntfs.py
index 56e7467..961aab3 100644
--- a/recuperabit/fs/ntfs.py
+++ b/recuperabit/fs/ntfs.py
@@ -279,7 +279,8 @@ class NTFSFile(File):
name = best_name([
(f['content']['namespace'], f['content']['name'] + ads_suffix)
- for f in filenames if f['content'] is not None and
+ 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
])
@rreinhardt
Copy link
Author

This solves the following error that I ran into running the tool—

Traceback (most recent call last):
  File "./main.py", line 309, in <module>
    main()
  File "./main.py", line 286, in main
    parts.update(scanner.get_partitions())
  File "/RecuperaBit/recuperabit/fs/ntfs.py", line 716, in get_partitions
    part.add_file(NTFSFile(parsed, position))
  File "/RecuperaBit/recuperabit/fs/ntfs.py", line 283, in __init__
    for f in filenames if not None in f['content'] and
KeyError: 'content'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment