first.py 文件源码

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

项目:FIRST-plugin-ida 作者: vrtadmin 项目源码 文件源码
def __getattribute__(self, name):
        default = '[1st] default'

        if (idaapi.IDA_SDK_VERSION >= 700) and (name in IDAWrapper.mapping):
            name = IDAWrapper.mapping[name]

        val = getattr(idaapi, name, default)
        if val == default:
            val = getattr(idc, name, default)

        if val == default:
            val = getattr(idautils, name, default)

        if val == default:
            msg = 'Unable to find {}'.format(name)
            idaapi.execute_ui_requests((FIRSTUI.Requests.Print(msg),))
            return

        if hasattr(val, '__call__'):
            def call(*args, **kwargs):
                holder = [None] # need a holder, because 'global' sucks

                def trampoline():
                    holder[0] = val(*args, **kwargs)
                    return 1

                idaapi.execute_sync(trampoline, idaapi.MFF_FAST)
                return holder[0]
            return call

        else:
            return val
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号