Python idaapi.refresh_idaview_anyway() Examples

The following are 12 code examples for showing how to use idaapi.refresh_idaview_anyway(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module idaapi , or try the search function .

Example 1
Project: ida-minsc   Author: arizvisa   File: function.py    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def color(cls, bb, rgb, **frame):
        '''Sets the color of the basic block `bb` to `rgb`.'''
        set_node_info = idaapi.set_node_info2 if idaapi.__version__ < 7.0 else idaapi.set_node_info
        res, fn, ni = cls.color(bb), by_address(interface.range.start(bb)), idaapi.node_info_t()

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

        # now the frame color
        frgb = frame.get('frame', 0x000000)
        fr, fb = (frgb&0xff0000)>>16, frgb&0x0000ff
        ni.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: set_node_info(interface.range.start(fn), bb.id, ni, f)
        finally: idaapi.refresh_idaview_anyway()

        # update the colors of each item too.
        for ea in block.iterate(bb):
            database.color(ea, rgb)
            #internal.netnode.alt.set(ea, 0x14, ni.bg_color)
        return res 
Example 2
Project: heap-viewer   Author: danigargu   File: bingraph.py    License: GNU General Public License v3.0 5 votes vote down vote up
def OnCommand(self, cmd_id):
        if cmd_id == self.cmd_refresh:
            self.Refresh()
            idaapi.refresh_idaview_anyway() 
Example 3
Project: Sark   Author: tmr232   File: ui.py    License: MIT License 5 votes vote down vote up
def __exit__(self, exc_type, exc_val, exc_tb):
        can_update = self.LOCK._is_owned()

        if can_update:
            idaapi.refresh_idaview_anyway()

        self.LOCK.release() 
Example 4
Project: prefix   Author: gaasedelen   File: ida_prefix.py    License: MIT License 5 votes vote down vote up
def refresh_views():
    """
    Refresh the IDA views.
    """

    # refresh IDA views
    idaapi.refresh_idaview_anyway()

    # refresh hexrays
    current_widget = idaapi.get_current_widget()
    vu = idaapi.get_widget_vdui(current_widget)
    if vu:
        vu.refresh_ctext() 
Example 5
Project: lighthouse   Author: gaasedelen   File: ida_painter.py    License: MIT License 5 votes vote down vote up
def _refresh_ui(self):
        """
        Note that this has been decorated with @execute_paint (vs @execute_ui)
        to help avoid deadlocking on exit.
        """
        for vdui in self._vduis.values():
            if vdui.valid():
                vdui.refresh_ctext(False)
        idaapi.refresh_idaview_anyway() 
Example 6
Project: bap-ida-python   Author: BinaryAnalysisPlatform   File: bap_taint.py    License: MIT License 5 votes vote down vote up
def finish(self, bap):
        idaapi.IDAPython_ExecScript(bap.script.name, globals())
        idaapi.refresh_idaview_anyway()
        BapTaint._do_callbacks(self.kind)
        idc.Refresh() 
Example 7
Project: bap-ida-python   Author: BinaryAnalysisPlatform   File: bap_bir_attr.py    License: MIT License 5 votes vote down vote up
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) 
Example 8
Project: bap-ida-python   Author: BinaryAnalysisPlatform   File: bap_functions.py    License: MIT License 5 votes vote down vote up
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() 
Example 9
Project: ida-minsc   Author: arizvisa   File: function.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def color(cls, ea, none):
        '''Removes the color of the basic block at the address `ea`.'''
        clr_node_info = idaapi.clr_node_info2 if idaapi.__version__ < 7.0 else idaapi.clr_node_info

        res, fn, bb = cls.color(ea), by_address(ea), cls.id(ea)
        try: clr_node_info(interface.range.start(fn), 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.color(ea, None)
            # internal.netnode.alt.remove(ea, 0x14)
        return res 
Example 10
Project: ida-minsc   Author: arizvisa   File: function.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def color(cls, bb, none):
        '''Removes the color of the basic block `bb`.'''
        clr_node_info = idaapi.clr_node_info2 if idaapi.__version__ < 7.0 else idaapi.clr_node_info

        res, fn = cls.color(bb), by_address(interface.range.start(bb))
        try: clr_node_info(interface.range.start(fn), 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.color(ea, None)
            #internal.netnode.alt.remove(ea, 0x14)
        return res 
Example 11
Project: ida-minsc   Author: arizvisa   File: function.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def color(cls, ea, rgb, **frame):
        """Sets the color of the basic block at the address `ea` to `rgb`.

        If the color `frame` is specified, set the frame to the specified color.
        """
        set_node_info = idaapi.set_node_info2 if idaapi.__version__ < 7.0 else idaapi.set_node_info

        res, fn, bb = cls.color(ea), by_address(ea), cls.id(ea)
        ni = idaapi.node_info_t()

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

        # now the frame color
        frgb = frame.get('frame', 0x000000)
        fr, fb = (frgb&0xff0000)>>16, frgb&0x0000ff
        ni.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: set_node_info(interface.range.start(fn), bb, ni, f)
        finally: idaapi.refresh_idaview_anyway()

        # update the color of each item too
        for ea in block.iterate(ea):
            database.color(ea, rgb)
            #internal.netnode.alt.set(ea, 0x14, ni.bg_color)
        return res 
Example 12
Project: ida-minsc   Author: arizvisa   File: ui.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def refresh(cls):
        '''Refresh the main IDA disassembly view.'''
        return idaapi.refresh_idaview_anyway()