PYTSK - 无法检索文件类型

时间:2017-03-08 16:54:37

标签: python computer-forensics

我正在尝试从Windows VHD获取所有文件。 在文件条目上调用.info.meta.typefilesystemObject = pytsk3.FS_Info(imagehandle, offset=(partition.start * metric.block_size)) except: print "Partition has no supported file system" continue print "File System Type Dectected ", filesystemObject.info.ftype directoryObject = filesystemObject.open_dir(path=dirPath) for entryObject in directoryObject: if (not hasattr(entryObject, "info") or not hasattr(entryObject.info, "name") or not hasattr(entryObject.info.name, "name") or entryObject.info.name.name in [".", ".."]): continue try: f_type = entryObject.info.meta.type except: print "Cannot retrieve type of", entryObject.info.name.name metric.total_files += 1 metric.failed_files += 1 continue 时,它并不总是有效并抛出错误。有没有办法检索这些文件?

> Traceback (most recent call last):   File "/Users/paulledwith/PycharmProjects/FYP/Server.py", line 352, in <module>
    directoryRecurse(directoryObject, [])   File "/Users/paulledwith/PycharmProjects/FYP/Server.py", line 185, in directoryRecurse
    directoryRecurse(sub_directory, parentPath)   File "/Users/paulledwith/PycharmProjects/FYP/Server.py", line 185, in directoryRecurse
    directoryRecurse(sub_directory, parentPath)   File "/Users/paulledwith/PycharmProjects/FYP/Server.py", line 185, in directoryRecurse
    directoryRecurse(sub_directory, parentPath)   File "/Users/paulledwith/PycharmProjects/FYP/Server.py", line 172, in directoryRecurse
    print entryObject.info.meta.size AttributeError: 'NoneType' object has no attribute 'size'

回溯:

{{1}}

这确实检索了我正在处理的5gb VHD上的大约90%的文件,但90%与0一样好。

0 个答案:

没有答案