function_BASE_1076.py 文件源码

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

项目:idascripts 作者: ctfhacker 项目源码 文件源码
def set_name(func, string):
    '''Set the name of the function ``func`` to ``string``.'''
    rt,ea = __addressOfRtOrSt(func)

    res = idaapi.validate_name2(buffer(string)[:])
    if string and string != res:
        logging.warn('{:s}.set_name : Stripping invalid chars from function name {!r} at {:x}. : {!r}'.format(__name__, string, ea, res))
        string = res

    if rt:
        # FIXME: shuffle the new name into the prototype and then re-mangle it
        res, ok = get_name(ea), database.set_name(ea, string)
    else:
        res, ok = get_name(ea), idaapi.set_name(ea, string, idaapi.SN_PUBLIC)
    if not ok:
        raise AssertionError('{:s}.set_name : Unable to set function name for {:x} : {!r}'.format(__name__, ea, string))
    return res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号