ida_prefix.py 文件源码

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

项目:prefix 作者: gaasedelen 项目源码 文件源码
def get_selected_funcs():
    """
    Return the list of function names selected in the Functions window.
    """

    # NOTE / COMPAT:
    if using_ida7api:
        import sip
        twidget = idaapi.find_widget("Functions window")
        widget  = sip.wrapinstance(long(twidget), QtWidgets.QWidget) # NOTE: LOL
    else:
        tform = idaapi.find_tform("Functions window")
        if using_pyqt5:
            widget = idaapi.PluginForm.FormToPyQtWidget(tform)
        else:
            widget = idaapi.PluginForm.FormToPySideWidget(tform)

    # TODO: test this
    if not widget:
        idaapi.warning("Unable to find 'Functions window'")
        return

    #
    # locate the table widget within the Functions window that actually holds
    # all the visible function metadata
    #

    table = widget.findChild(QtWidgets.QTableView)

    #
    # scrape the selected function names from the Functions window table
    #

    selected_funcs = [str(s.data()) for s in table.selectionModel().selectedRows()]

    #
    # re-map the scraped names as they appear in the function table, to their true
    # names as they are saved in the IDB. See the match_funcs(...) function
    # comment for more details
    #

    return match_funcs(selected_funcs)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号