FileSystemEnumerator.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:PancakeViewer 作者: forensicmatt 项目源码 文件源码
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()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号