idc.py 文件源码

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

项目:DecLLVM 作者: F8LEFT 项目源码 文件源码
def SetColor(ea, what, color):
    """
    Set item color

    @param ea: address of the item
    @param what: type of the item (one of CIC_* constants)
    @param color: new color code in RGB (hex 0xBBGGRR)

    @return: success (True or False)
    """
    if what not in [ CIC_ITEM, CIC_FUNC, CIC_SEGM ]:
        raise ValueError, "'what' must be one of CIC_ITEM, CIC_FUNC and CIC_SEGM"

    if what == CIC_ITEM:
        return idaapi.set_item_color(ea, color)

    if what == CIC_FUNC:
        func = idaapi.get_func(ea)
        if func:
            func.color = color
            return bool(idaapi.update_func(func))
        else:
            return False

    if what == CIC_SEGM:
        seg = idaapi.getseg(ea)
        if seg:
            seg.color = color
            return bool(seg.update())
        else:
            return False


#--------------------------------------------------------------------------
#                               X M L
#--------------------------------------------------------------------------
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号