OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # -*- coding: utf-8 -*- | 2 # -*- coding: utf-8 -*- |
3 """Script to recursively calculate a message digest hash for every file.""" | 3 """Script to recursively calculate a message digest hash for every file.""" |
4 | 4 |
5 # If you update this script make sure to update the corresponding wiki page | 5 # If you update this script make sure to update the corresponding wiki page |
6 # as well: https://github.com/log2timeline/dfvfs/wiki/Development | 6 # as well: https://github.com/log2timeline/dfvfs/wiki/Development |
7 | 7 |
8 from __future__ import print_function | 8 from __future__ import print_function |
9 from __future__ import unicode_literals | 9 from __future__ import unicode_literals |
10 | 10 |
11 import abc | 11 import abc |
12 import argparse | 12 import argparse |
13 import getpass | 13 import getpass |
14 import hashlib | 14 import hashlib |
15 import locale | 15 import locale |
16 import logging | 16 import logging |
17 import sys | 17 import sys |
18 | 18 |
| 19 from dfvfs.analyzer import analyzer as dfvfs_analyzer |
| 20 from dfvfs.analyzer import fvde_analyzer_helper |
19 from dfvfs.lib import definitions as dfvfs_definitions | 21 from dfvfs.lib import definitions as dfvfs_definitions |
20 from dfvfs.lib import errors | 22 from dfvfs.lib import errors |
21 from dfvfs.helpers import volume_scanner | 23 from dfvfs.helpers import volume_scanner |
22 from dfvfs.resolver import resolver | 24 from dfvfs.resolver import resolver |
23 | 25 |
24 | 26 |
| 27 try: |
| 28 # Disable experimental FVDE support. |
| 29 dfvfs_analyzer.Analyzer.DeregisterHelper( |
| 30 fvde_analyzer_helper.FVDEAnalyzerHelper()) |
| 31 except KeyError: |
| 32 pass |
| 33 |
| 34 |
25 class RecursiveHasherVolumeScannerMediator( | 35 class RecursiveHasherVolumeScannerMediator( |
26 volume_scanner.VolumeScannerMediator): | 36 volume_scanner.VolumeScannerMediator): |
27 """Volume scanner mediator for the recursive hasher.""" | 37 """Volume scanner mediator for the recursive hasher.""" |
28 | 38 |
29 # For context see: http://en.wikipedia.org/wiki/Byte | 39 # For context see: http://en.wikipedia.org/wiki/Byte |
30 _UNITS_1000 = ['B', 'kB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB'] | 40 _UNITS_1000 = ['B', 'kB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB'] |
31 _UNITS_1024 = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'EiB', 'ZiB', 'YiB'] | 41 _UNITS_1024 = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'EiB', 'ZiB', 'YiB'] |
32 | 42 |
33 def __init__(self): | 43 def __init__(self): |
34 """Initializes a volume scanner mediator.""" | 44 """Initializes a volume scanner mediator.""" |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 output_writer.Close() | 700 output_writer.Close() |
691 | 701 |
692 return return_value | 702 return return_value |
693 | 703 |
694 | 704 |
695 if __name__ == '__main__': | 705 if __name__ == '__main__': |
696 if not Main(): | 706 if not Main(): |
697 sys.exit(1) | 707 sys.exit(1) |
698 else: | 708 else: |
699 sys.exit(0) | 709 sys.exit(0) |
OLD | NEW |