Python idaapi.process_ui_action() Examples

The following are 8 code examples of idaapi.process_ui_action(). 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 also want to check out all available functions/classes of the module idaapi , or try the search function .
Example #1
Source File: idautils.py    From dumpDex with Apache License 2.0 6 votes vote down vote up
def __call__(self):
        if self.__idx >= len(self.__action_list):
            return False

        # Execute one action
        idaapi.process_ui_action(
                self.__action_list[self.__idx],
                self.__flags)

        # Move to next action
        self.__idx += 1

        # Reschedule
        return True


# -------------------------------------------------------------------------- 
Example #2
Source File: graphgrabber.py    From GraphGrabber with MIT License 5 votes vote down vote up
def graph_zoom_100():
    idaapi.process_ui_action('GraphZoom100') 
Example #3
Source File: graphgrabber.py    From GraphGrabber with MIT License 5 votes vote down vote up
def graph_zoom_fit():
    idaapi.process_ui_action('GraphZoomFit') 
Example #4
Source File: idautils.py    From dumpDex with Apache License 2.0 5 votes vote down vote up
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,))


# ----------------------------------------------------------------------- 
Example #5
Source File: clrapplier.py    From IDASkins with MIT License 5 votes vote down vote up
def load_clr_file(filepath):
    event_filter = TemporaryFilter(filepath)
    qApp.installEventFilter(event_filter)

    return idaapi.process_ui_action('SetColors') 
Example #6
Source File: ida_fuzzy.py    From IDAFuzzy with MIT License 5 votes vote down vote up
def activate(self, ctx):
        action = fuzzy_search_main()

        if action:
            idaapi.process_ui_action(action)
        return 1 
Example #7
Source File: helpers.py    From DROP-IDA-plugin with GNU General Public License v3.0 5 votes vote down vote up
def fix_graph_layout():
    def fun():
        idaapi.update_action_state("GraphLayout", 0)
        idaapi.process_ui_action("GraphLayout")
    idaapi.execute_ui_requests((fun,)) 
Example #8
Source File: ida_fuzzy.py    From IDAFuzzy with MIT License 4 votes vote down vote up
def fuzzy_search_main():
    # Create form
    global f, choices, names
    choices = {}
    names = []
    gc.collect()

    # Runtime collector.
    # Pros
    # 1. No need to refresh automatically.(When GDB start, libc symbol,PIE's symbol,etc... address will change.When user rename symbol, also.)
    # 1.1. If you want to search library's function, view module list and right-click onto target library. Then click "Analyze module".
    # 2. Action's state is collect (When user start typing, active window is FuzzySearchForm. So filter doesn't works correctly. ex: OpHex is active at Disas view but not active at FuzzySearchForm.)
    # Cons
    # 1. Become slow in case large file.
    # 1.1. Re-generate dictionary isn't matter.(But scoring time will be bigger.)
    # func ptr and icon id
    registered_actions = get_registered_actions()
    for action in registered_actions:
        # IDA's bug? tilde exists many times in label. ex) Abort -> ~A~bort
        # So fix it.
        label = get_action_label(action).replace('~', '')
        icon = get_action_icon(action)[1]
        desctription = get_action_tooltip(action)
        if get_action_state(action)[1] > idaapi.AST_ENABLE:
            continue
        choices[label] = Commands(fptr=process_ui_action, args=[action], description=desctription, icon=icon)

    # Functions()
    # Heads()
    for n in Names():
        demangled = idc.demangle_name(n[1], idc.get_inf_attr(idc.INF_SHORT_DN))
        name = demangled if demangled else n[1]
        # jump to addr
        choices[name] = Commands(fptr=jumpto, args=[n[0]], description="Jump to " + name, icon=124)

    for n in Structs():
        choices[n[2]] = Commands(fptr=open_structs_window, args=[n[1]],
                                 description="Jump to Structure definition of " + n[2], icon=52)

    for k, v in choices.items():
        names.append(k)

    f = FuzzySearchForm()

    # Compile (in order to populate the controls)
    f.Compile()
    f.iStr1.value = ""
    # Execute the form
    ok = f.Execute()

    if ok == 1 and len(f.EChooser.items) > 0:
        f.get_selected_item().execute()
    # Dispose the form
    f.Free()