function.py 文件源码

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

项目:idascripts 作者: ctfhacker 项目源码 文件源码
def set_color(cls, bb, rgb, **frame):
        """Sets the color of the basic-block ``bb`` to ``rgb``.
        If the color ``frame`` is specified, set the frame to the specified color.
        """
        res, fn, n = cls.get_color(bb), by_address(bb.startEA), idaapi.node_info_t()

        # specify the bg color
        r,b = (rgb&0xff0000) >> 16, rgb&0x0000ff
        n.bg_color = n.frame_color = (b<<16)|(rgb&0x00ff00)|r

        # now the frame color
        frgb = frame.get('frame', 0x000000)
        fr, fb = (frgb & 0xff0000) >> 16, frgb&0x0000ff
        n.frame_color = (fb<<16)|(frgb&0x00ff00)|fr

        # set the node
        f = (idaapi.NIF_BG_COLOR|idaapi.NIF_FRAME_COLOR) if frame else idaapi.NIF_BG_COLOR
        try: idaapi.set_node_info2(fn.startEA, bb.id, n, f)
        finally: idaapi.refresh_idaview_anyway()

        # update the colors of each item too.
        for ea in block.iterate(bb):
            database.set_color(ea, rgb)
            #internal.netnode.alt.set(ea, 0x14, n.bg_color)
        return res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号