Beispiel #1
0
def ProcessUiActions(actions, flags=0):
    """
    @param actions: A string containing a list of actions separated by semicolon, a list or a tuple
    @param flags: flags to be passed to process_ui_action()
    @return: Boolean. Returns False if the action list was empty or execute_ui_requests() failed.
    """

    # Instantiate a helper
    helper = __process_ui_actions_helper(actions, flags)
    return False if len(helper) < 1 else idaapi.execute_ui_requests((helper,))
Beispiel #2
0
def ProcessUiActions(actions, flags=0):
    """
    @param actions: A string containing a list of actions separated by semicolon, a list or a tuple
    @param flags: flags to be passed to process_ui_action()
    @return: Boolean. Returns False if the action list was empty or execute_ui_requests() failed.
    """

    # Instantiate a helper
    helper = __process_ui_actions_helper(actions, flags)
    return False if len(helper) < 1 else idaapi.execute_ui_requests((helper, ))
Beispiel #3
0
 def run(self, arg):
     cfn = UiCallable(self._run)
     idaapi.execute_ui_requests((cfn, ))
Beispiel #4
0
# --------------------------------------------------------------------------
def ProcessUiActions(actions, flags=0):
    """
    @param actions: A string containing a list of actions separated by semicolon, a list or a tuple
    @param flags: flags to be passed to process_ui_action()
    @return: Boolean. Returns False if the action list was empty or execute_ui_requests() failed.
    """

    # Instantiate a helper
    helper = __process_ui_actions_helper(actions, flags)
    return False if len(helper) < 1 else idaapi.execute_ui_requests((helper, ))


# --------------------------------------------------------------------------
class print_req_t(object):
    def __init__(self, s):
        self.s = s

    def __call__(self):
        idaapi.msg("%s" % self.s)
        return False  # Don't reschedule


if idc.AskYN(1,
             ("HIDECANCEL\nDo you want to run execute_ui_requests() example?\n"
              "Press NO to execute ProcessUiActions() example\n")):
    idaapi.execute_ui_requests((print_req_t("Hello"), print_req_t(" world\n")))
else:
    ProcessUiActions("JumpQ;JumpName")
Beispiel #5
0
def fix_graph_layout():
    def fun():
        idaapi.update_action_state("GraphLayout", 0)
        idaapi.process_ui_action("GraphLayout")

    idaapi.execute_ui_requests((fun, ))
Beispiel #6
0
# --------------------------------------------------------------------------
def ProcessUiActions(actions, flags=0):
    """
    @param actions: A string containing a list of actions separated by semicolon, a list or a tuple
    @param flags: flags to be passed to process_ui_action()
    @return: Boolean. Returns False if the action list was empty or execute_ui_requests() failed.
    """

    # Instantiate a helper
    helper = __process_ui_actions_helper(actions, flags)
    return False if len(helper) < 1 else idaapi.execute_ui_requests((helper,))


# --------------------------------------------------------------------------
class print_req_t(object):
    def __init__(self, s):
        self.s = s
    def __call__(self):
        idaapi.msg("%s" % self.s)
        return False # Don't reschedule



if idc.ask_yn(1,("HIDECANCEL\nDo you want to run execute_ui_requests() example?\n"
                "Press NO to execute ProcessUiActions() example\n")):
    idaapi.execute_ui_requests(
       (print_req_t("Hello"), print_req_t(" world\n")) )
else:
    ProcessUiActions("JumpQ;JumpName")
Beispiel #7
0
def set_graph_view():
    def fun():
        idaapi.set_view_renderer_type(idaapi.get_current_viewer(),
                                      idaapi.TCCRT_GRAPH)

    idaapi.execute_ui_requests((fun, ))
Beispiel #8
0
def set_flat_view():
    def fun():
        idaapi.set_view_renderer_type(idaapi.get_current_viewer(),
                                      idaapi.TCCRT_FLAT)

    idaapi.execute_ui_requests((fun, ))
Beispiel #9
0
def analyze_area(begin_addr, end_addr):
    def fun(begin_addr, end_addr):
        idaapi.analyze_area(begin_addr, end_addr)

    idaapi.execute_ui_requests((partial(fun, begin_addr, end_addr), ))
Beispiel #10
0
def set_func_end(func_addr, end_addr):
    def fun(func_addr, end_addr):
        idaapi.func_setend(func_addr, end_addr)

    idaapi.execute_ui_requests((partial(fun, func_addr, end_addr), ))
Beispiel #11
0
def patch_bytes(addr, bs):
    def fun(addr, bs):
        idaapi.patch_many_bytes(addr, bs)

    idaapi.execute_ui_requests((partial(fun, addr, bs), ))
Beispiel #12
0
def safe_jump(ea):
    idaapi.execute_ui_requests((jump_req_t(ea), ))
Beispiel #13
0
def safe_setcolor(ea, color):
    idaapi.execute_ui_requests((color_req_t(ea, color), ))