Example #1
0
 def finish_populating_widget_popup(self, widget, popup):
     if self.form.title == idaapi.get_widget_title(widget):
         idaapi.attach_dynamic_action_to_popup(widget, popup, idaapi.action_desc_t(None, "Update View", self.PopupActionHandler(self.form, self.form.menu_update),   None, None, -1))
         idaapi.attach_dynamic_action_to_popup(widget, popup, idaapi.action_desc_t(None, "Lookup Instruction", self.PopupActionHandler(self.form, self.form.menu_lookup),   None, None, -1))
         idaapi.attach_dynamic_action_to_popup(widget, popup, idaapi.action_desc_t(None, "Toggle Auto-refresh", self.PopupActionHandler(self.form, self.form.menu_autorefresh),   None, None, -1))
         idaapi.attach_action_to_popup(widget, popup, "-", None)
         idaapi.attach_dynamic_action_to_popup(widget, popup, idaapi.action_desc_t(None, "Change Architecture", self.PopupActionHandler(self.form, self.form.change_arch),  None, None, -1))
         idaapi.attach_action_to_popup(widget, popup, "-", None)        
Example #2
0
 def graph_callback(event, *args):
     if event == idaapi.hxe_curpos:
         vdui = args[0]
         type = type_of_current_var(vdui)
         AncestorGraphHandler.target_type = type
     elif event == idaapi.hxe_populating_popup:
         form, popup, vdui = args
         if AncestorGraphHandler.target_type is None:
             return 0
         action_desc = idaapi.action_desc_t(None,
                                            'Open Ancestor Type Graph',
                                            AncestorGraphHandler)
         idaapi.attach_dynamic_action_to_popup(form, popup, action_desc,
                                               None)
     return 0
Example #3
0
 def finish_populating_widget_popup(self, widget, popup):
     if self.form.title == idaapi.get_widget_title(widget):
         idaapi.attach_dynamic_action_to_popup(
             widget,
             popup,
             idaapi.action_desc_t(
                 None, "Update View",
                 self.PopupActionHandler(
                     self.form, self.form.menu_update),
                 None, None, -1),
         )
         idaapi.attach_dynamic_action_to_popup(
             widget,
             popup,
             idaapi.action_desc_t(
                 None,
                 "Lookup Instruction",
                 self.PopupActionHandler(
                     self.form, self.form.menu_lookup),
                 None,
                 None,
                 -1,
             ),
         )
         idaapi.attach_dynamic_action_to_popup(
             widget,
             popup,
             idaapi.action_desc_t(
                 None,
                 "Toggle Auto-refresh",
                 self.PopupActionHandler(
                     self.form, self.form.menu_autorefresh),
                 None,
                 None,
                 -1,
             ),
         )
         idaapi.attach_action_to_popup(
             widget, popup, "-", None)
         idaapi.attach_dynamic_action_to_popup(
             widget,
             popup,
             idaapi.action_desc_t(
                 None,
                 "Change Architecture",
                 self.PopupActionHandler(
                     self.form, self.form.change_arch),
                 None,
                 None,
                 -1,
             ),
         )
         idaapi.attach_action_to_popup(
             widget, popup, "-", None)
 def finish_populating_tform_popup(self, form, popup):
     tft = idaapi.get_tform_type(form)
     if tft == idaapi.BWN_DISASM:  # Disassembly view
         descs = []
         # Choose either selection or function annotation depending on cursor
         selection = idaapi.read_selection()
         if selection[0] == True:
             descs.append(
                 idaapi.action_desc_t(
                     None, 'Annotate selection with line info',
                     ALI_DISASM_SelectionHandler(
                         ACTION_ADD_ANNOTATION)))
             descs.append(
                 idaapi.action_desc_t(
                     None, 'Remove annotations from selection',
                     ALI_DISASM_SelectionHandler(
                         ACTION_DEL_ANNOTATION)))
         else:
             func = idaapi.get_func(ScreenEA())
             if func is not None:
                 descs.append(
                     idaapi.action_desc_t(
                         None, 'Annotate function with line info',
                         ALI_DISASM_FunctionHandler(
                             ACTION_ADD_ANNOTATION)))
                 descs.append(
                     idaapi.action_desc_t(
                         None, 'Remove annotations from function',
                         ALI_DISASM_FunctionHandler(
                             ACTION_DEL_ANNOTATION)))
         # Add corresponding action to popup menu
         for d in descs:
             idaapi.attach_dynamic_action_to_popup(form, popup, d, None)
     elif tft == idaapi.BWN_FUNCS:  # Functions view
         # Add action to popup menu
         idaapi.attach_action_to_popup(
             form, popup,
             type(ali_plugin).action_wfuncs_add_name, None,
             idaapi.SETMENU_INS)
         idaapi.attach_action_to_popup(
             form, popup,
             type(ali_plugin).action_wfuncs_del_name, None,
             idaapi.SETMENU_INS)
Example #5
0
 def finish_populating_tform_popup(self, form, popup):
     if idaapi.get_tform_type(form) == idaapi.BWN_DUMP:
         desc = idaapi.action_desc_t(None, 'Follow in hex dump',
                                     HexJumpHandler())
         idaapi.attach_dynamic_action_to_popup(form, popup, desc, None)