Beispiel #1
0
 def refresh_pseudocode(self, vu):
     if self.another_decompile_ea:
         logging.debug("decompile again")
         ea = self.another_decompile_ea
         ida_hexrays.mark_cfunc_dirty(ea, False)
         cfunc = ida_hexrays.decompile(ea)
         self.another_decompile_ea = None
         vu.switch_to(cfunc, True)
     return 0
Beispiel #2
0
def _on_refresh_pseudocode(vu):
    global _ANOTHER_DECOMPILER_EA
    if not _ANOTHER_DECOMPILER_EA:
        return
    log.debug("decompile again")
    ea = _ANOTHER_DECOMPILER_EA
    ida_hexrays.mark_cfunc_dirty(ea, False)
    cfunc = ida_hexrays.decompile(ea)
    _ANOTHER_DECOMPILER_EA = None
    vu.switch_to(cfunc, True)
Beispiel #3
0
def get_microcode(func, maturity):
    """
    Return the mba_t of the given function at the specified maturity.
    """
    mbr = ida_hexrays.mba_ranges_t(func)
    hf = ida_hexrays.hexrays_failure_t()
    ml = ida_hexrays.mlist_t()
    ida_hexrays.mark_cfunc_dirty(func.start_ea)
    mba = ida_hexrays.gen_microcode(mbr, hf, ml, ida_hexrays.DECOMP_NO_WAIT, maturity)
    if not mba:
        print("0x%08X: %s" % (hf.errea, hf.desc()))
        return None
    return mba
Beispiel #4
0
    def invalidate_cache(self, close_window=False):
        """
            Allows to invalidate the cache for this hexray function. This will
            remove information associated with this function, forcing IDA to
            regenerate the view for the function next time it will be open.

            .. warning::

                This function may generate the same problem as decompiling
                again the function, this has not been tested. See
                :class:`HxCFunc` warning for more information about this
                potential problem.

            :param close_window: If true the window(s) showing the
                disassembled function will be closed. False by default.
        """
        ida_hexrays.mark_cfunc_dirty(self.ea, close_window)