def EnumerateNode(mainFrame,tree_item,node,dlg_flag=True):
if isinstance(node, source_scanner.SourceScanNode):
if (node.type_indicator == definitions.TYPE_INDICATOR_TSK or
node.type_indicator == definitions.TYPE_INDICATOR_VSHADOW):
if mainFrame.tree_fs.GetChildrenCount(tree_item) < 1:
if node.type_indicator == definitions.TYPE_INDICATOR_VSHADOW:
location = getattr(node.path_spec, 'location', None)
if location == u'/':
return
identifier = location[1:]
try:
path_spec = node.path_spec
if node.type_indicator == definitions.TYPE_INDICATOR_VSHADOW:
path_spec = path_spec_factory.Factory.NewPathSpec(
definitions.TYPE_INDICATOR_TSK,
location=u'/',
parent=node.path_spec
)
file_system = resolver.Resolver.OpenFileSystem(path_spec)
except Exception as error:
file_system = None
print str(error)
if file_system is not None:
if dlg_flag:
dlg = pyprogress.PyProgress(
mainFrame,
-1,
"Enumerating Filesystem",
"This can take a while",
agwStyle=wx.PD_APP_MODAL | wx.PD_ELAPSED_TIME
)
dlg.SetGaugeProportion(.10)
dlg.SetGaugeSteps(100)
file_entry = file_system.GetRootFileEntry()
ProcessFolder(
file_system,
file_entry,
u'',
tree_fs=mainFrame.tree_fs,
tree_item=tree_item,
dlg=dlg
)
if dlg_flag:
dlg.Destroy()
FileSystemEnumerator.py 文件源码
python
阅读 21
收藏 0
点赞 0
评论 0
评论列表
文章目录