Python idaapi 模块,refresh_idaview_anyway() 实例源码

我们从Python开源项目中,提取了以下31个代码示例,用于说明如何使用idaapi.refresh_idaview_anyway()

项目:prefix    作者:gaasedelen    | 项目源码 | 文件源码
def refresh_views():
    """
    Refresh the IDA views.
    """

    # refresh IDA views
    idaapi.refresh_idaview_anyway()

    # NOTE/COMPAT: refresh hexrays view, if active
    if using_ida7api:
        current_widget = idaapi.get_current_widget()
        vu = idaapi.get_widget_vdui(current_widget)
    else:
        current_tform = idaapi.get_current_tform()
        vu = idaapi.get_tform_vdui(current_tform)

    if vu:
        vu.refresh_ctext()
项目: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
项目: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
项目: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
项目: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
项目: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
项目: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
项目: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
项目:bap-ida-python    作者:BinaryAnalysisPlatform    | 项目源码 | 文件源码
def finish(self, bap):
        idaapi.IDAPython_ExecScript(bap.script.name, globals())
        idaapi.refresh_idaview_anyway()
        BapTaint._do_callbacks(self.kind)
        idc.Refresh()
项目:bap-ida-python    作者:BinaryAnalysisPlatform    | 项目源码 | 文件源码
def load_script(self, bap, ea):
        idc.SetStatus(idc.IDA_STATUS_WORK)
        idaapi.IDAPython_ExecScript(bap.script.name, globals())
        self._do_callbacks(ea)
        idc.Refresh()
        # do we really need to call this?
        idaapi.refresh_idaview_anyway()
        idc.SetStatus(idc.IDA_STATUS_READY)
项目:bap-ida-python    作者:BinaryAnalysisPlatform    | 项目源码 | 文件源码
def add_starts(self, bap):
        syms = []
        for line in bap.syms:
            heappush(syms, int(line, 16))
        for i in range(len(syms)):
            idaapi.add_func(heappop(syms), idaapi.BADADDR)
        idc.Refresh()
        idaapi.refresh_idaview_anyway()
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def refresh(cls):
            idaapi.refresh_lists()
            return idaapi.refresh_idaview_anyway()
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def refresh(cls):
            idaapi.refresh_lists()
            return idaapi.refresh_idaview_anyway()
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def color_block(ea=None, color=0x55ff7f):
    """http://reverseengineering.stackexchange.com/questions/10662/change-block-node-color-with-idapython
    and WanderingGlitch for the tip of refresh_idaview_anyway()"""

    func_top = fn.top()

    f = idaapi.get_func(ea)
    g = idaapi.FlowChart(f, flags=idaapi.FC_PREDS)
    bb_id = get_bb_id(g, ea)

    p = idaapi.node_info_t()
    p.bg_color = color

    idaapi.set_node_info2(func_top, bb_id, p, idaapi.NIF_BG_COLOR | idaapi.NIF_FRAME_COLOR)
    idaapi.refresh_idaview_anyway()
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, none):
        '''Removes the color of the basic-block at address ``ea``.'''
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        try: idaapi.clr_node_info2(fn.startEA, bb, idaapi.NIF_BG_COLOR | idaapi.NIF_FRAME_COLOR)
        finally: idaapi.refresh_idaview_anyway()

        # clear the color of each item too.
        for ea in block.iterate(ea):
            database.set_color(ea, None)
            # internal.netnode.alt.remove(ea, 0x14)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, rgb, **frame):
        """Sets the color of the basic-block at address ``ea`` to ``rgb``.
        If the color ``frame`` is specified, set the frame to the specified color.
        """
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        n = idaapi.node_info_t()

        # specify the bgcolor
        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, n, f)
        finally: idaapi.refresh_idaview_anyway()

        # update the color of each item too
        for ea in block.iterate(ea):
            database.set_color(ea, rgb)
            #internal.netnode.alt.set(ea, 0x14, n.bg_color)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, none):
        '''Removes the color of the basic-block at address ``ea``.'''
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        try: idaapi.clr_node_info2(fn.startEA, bb, idaapi.NIF_BG_COLOR | idaapi.NIF_FRAME_COLOR)
        finally: idaapi.refresh_idaview_anyway()

        # clear the color of each item too.
        for ea in block.iterate(ea):
            database.set_color(ea, None)
            # internal.netnode.alt.remove(ea, 0x14)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, rgb, **frame):
        """Sets the color of the basic-block at address ``ea`` to ``rgb``.
        If the color ``frame`` is specified, set the frame to the specified color.
        """
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        n = idaapi.node_info_t()

        # specify the bgcolor
        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, n, f)
        finally: idaapi.refresh_idaview_anyway()

        # update the color of each item too
        for ea in block.iterate(ea):
            database.set_color(ea, rgb)
            #internal.netnode.alt.set(ea, 0x14, n.bg_color)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, bb, none):
        '''Removes the color of the basic-block ``bb``.'''
        res, fn = cls.get_color(bb), by_address(bb.startEA)
        try: idaapi.clr_node_info2(fn.startEA, bb.id, idaapi.NIF_BG_COLOR | idaapi.NIF_FRAME_COLOR)
        finally: idaapi.refresh_idaview_anyway()

        # clear the color of each item too.
        for ea in block.iterate(bb):
            database.set_color(ea, None)
            #internal.netnode.alt.remove(ea, 0x14)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, rgb, **frame):
        """Sets the color of the basic-block at address ``ea`` to ``rgb``.
        If the color ``frame`` is specified, set the frame to the specified color.
        """
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        n = idaapi.node_info_t()

        # specify the bgcolor
        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, n, f)
        finally: idaapi.refresh_idaview_anyway()

        # update the color of each item too
        for ea in block.iterate(ea):
            database.set_color(ea, rgb)
            #internal.netnode.alt.set(ea, 0x14, n.bg_color)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, bb, none):
        '''Removes the color of the basic-block ``bb``.'''
        res, fn = cls.get_color(bb), by_address(bb.startEA)
        try: idaapi.clr_node_info2(fn.startEA, bb.id, idaapi.NIF_BG_COLOR | idaapi.NIF_FRAME_COLOR)
        finally: idaapi.refresh_idaview_anyway()

        # clear the color of each item too.
        for ea in block.iterate(bb):
            database.set_color(ea, None)
            #internal.netnode.alt.remove(ea, 0x14)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, none):
        '''Removes the color of the basic-block at address ``ea``.'''
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        try: idaapi.clr_node_info2(fn.startEA, bb, idaapi.NIF_BG_COLOR | idaapi.NIF_FRAME_COLOR)
        finally: idaapi.refresh_idaview_anyway()

        # clear the color of each item too.
        for ea in block.iterate(ea):
            database.set_color(ea, None)
            # internal.netnode.alt.remove(ea, 0x14)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, rgb, **frame):
        """Sets the color of the basic-block at address ``ea`` to ``rgb``.
        If the color ``frame`` is specified, set the frame to the specified color.
        """
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        n = idaapi.node_info_t()

        # specify the bgcolor
        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, n, f)
        finally: idaapi.refresh_idaview_anyway()

        # update the color of each item too
        for ea in block.iterate(ea):
            database.set_color(ea, rgb)
            #internal.netnode.alt.set(ea, 0x14, n.bg_color)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, none):
        '''Removes the color of the basic-block at address ``ea``.'''
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        try: idaapi.clr_node_info2(fn.startEA, bb, idaapi.NIF_BG_COLOR | idaapi.NIF_FRAME_COLOR)
        finally: idaapi.refresh_idaview_anyway()

        # clear the color of each item too.
        for ea in block.iterate(ea):
            database.set_color(ea, None)
            # internal.netnode.alt.remove(ea, 0x14)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, rgb, **frame):
        """Sets the color of the basic-block at address ``ea`` to ``rgb``.
        If the color ``frame`` is specified, set the frame to the specified color.
        """
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        n = idaapi.node_info_t()

        # specify the bgcolor
        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, n, f)
        finally: idaapi.refresh_idaview_anyway()

        # update the color of each item too
        for ea in block.iterate(ea):
            database.set_color(ea, rgb)
            #internal.netnode.alt.set(ea, 0x14, n.bg_color)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, bb, none):
        '''Removes the color of the basic-block ``bb``.'''
        res, fn = cls.get_color(bb), by_address(bb.startEA)
        try: idaapi.clr_node_info2(fn.startEA, bb.id, idaapi.NIF_BG_COLOR | idaapi.NIF_FRAME_COLOR)
        finally: idaapi.refresh_idaview_anyway()

        # clear the color of each item too.
        for ea in block.iterate(bb):
            database.set_color(ea, None)
            #internal.netnode.alt.remove(ea, 0x14)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, rgb, **frame):
        """Sets the color of the basic-block at address ``ea`` to ``rgb``.
        If the color ``frame`` is specified, set the frame to the specified color.
        """
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        n = idaapi.node_info_t()

        # specify the bgcolor
        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, n, f)
        finally: idaapi.refresh_idaview_anyway()

        # update the color of each item too
        for ea in block.iterate(ea):
            database.set_color(ea, rgb)
            #internal.netnode.alt.set(ea, 0x14, n.bg_color)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, bb, none):
        '''Removes the color of the basic-block ``bb``.'''
        res, fn = cls.get_color(bb), by_address(bb.startEA)
        try: idaapi.clr_node_info2(fn.startEA, bb.id, idaapi.NIF_BG_COLOR | idaapi.NIF_FRAME_COLOR)
        finally: idaapi.refresh_idaview_anyway()

        # clear the color of each item too.
        for ea in block.iterate(bb):
            database.set_color(ea, None)
            #internal.netnode.alt.remove(ea, 0x14)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, none):
        '''Removes the color of the basic-block at address ``ea``.'''
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        try: idaapi.clr_node_info2(fn.startEA, bb, idaapi.NIF_BG_COLOR | idaapi.NIF_FRAME_COLOR)
        finally: idaapi.refresh_idaview_anyway()

        # clear the color of each item too.
        for ea in block.iterate(ea):
            database.set_color(ea, None)
            # internal.netnode.alt.remove(ea, 0x14)
        return res
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def set_color(cls, ea, rgb, **frame):
        """Sets the color of the basic-block at address ``ea`` to ``rgb``.
        If the color ``frame`` is specified, set the frame to the specified color.
        """
        res, fn, bb = cls.get_color(ea), by_address(ea), cls.id(ea)
        n = idaapi.node_info_t()

        # specify the bgcolor
        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, n, f)
        finally: idaapi.refresh_idaview_anyway()

        # update the color of each item too
        for ea in block.iterate(ea):
            database.set_color(ea, rgb)
            #internal.netnode.alt.set(ea, 0x14, n.bg_color)
        return res
项目:DecLLVM    作者:F8LEFT    | 项目源码 | 文件源码
def Refresh():
    """
    Refresh all disassembly views
    """
    idaapi.refresh_idaview_anyway()