graph.py 文件源码

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

项目:devirtualize 作者: ALSchwalm 项目源码 文件源码
def register_actions():
    AncestorGraphHandler = OpenGraphHandler()

    def type_of_current_var(vdui):
        var = vdui.item.get_lvar()
        if var is None:
            return None
        return get_type_by_tinfo(var.type())

    def graph_callback(event, *args):
        if event == idaapi.hxe_curpos:
            vdui = args[0]
            type = type_of_current_var(vdui)
            AncestorGraphHandler.target_type = type
        elif event == idaapi.hxe_populating_popup:
            form, popup, vdui = args
            if AncestorGraphHandler.target_type is None:
                return 0
            action_desc = idaapi.action_desc_t(
                None,
                'Open Ancestor Type Graph',
                AncestorGraphHandler)
            idaapi.attach_dynamic_action_to_popup(form, popup, action_desc, None)
        return 0

    action_desc = idaapi.action_desc_t(
        'devirtualize:open_ancestor_type_graph',
        'Open Ancestor Type Graph',
        AncestorGraphHandler,
        None,
        'Open Ancestor Type Graph',
        199)

    idaapi.register_action(action_desc)

    idaapi.attach_action_to_menu(
        'View/Graphs/User xrefs char...',
        'devirtualize:open_ancestor_type_graph',
        idaapi.SETMENU_APP)

    idaapi.install_hexrays_callback(graph_callback)


#TODO: Show diamond inheritance as a diamond
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号