Example #1
0
 def event_callback(self, event, *args):
     
     try:
         if event == idaapi.hxe_keyboard:
             vu, keycode, shift = args
             
             if idaapi.lookup_key_code(keycode, shift, True) == idaapi.get_key_code("X") and shift == 0:
                 if self.show_xrefs(vu):
                     return 1
             
         elif event == idaapi.hxe_right_click:
             self.vu = args[0]
             idaapi.add_custom_viewer_popup_item(self.vu.ct, "Xrefs", "X", self.menu_callback)
         
     except:
         traceback.print_exc()
     
     return 0
Example #2
0
    def event_callback(self, event, *args):

        try:
            if event == idaapi.hxe_keyboard:
                vu, keycode, shift = args

                if idaapi.lookup_key_code(
                        keycode, shift,
                        True) == idaapi.get_key_code("X") and shift == 0:
                    if self.show_xrefs(vu):
                        return 1

            elif event == idaapi.hxe_right_click:
                self.vu = args[0]
                idaapi.add_custom_viewer_popup_item(self.vu.ct, "Xrefs", "X",
                                                    self.menu_callback)

        except:
            traceback.print_exc()

        return 0
Example #3
0
    def event_callback(self, event, *args):

        try:
            if event == idaapi.hxe_keyboard:
                vu, keycode, shift = args

                if idaapi.lookup_key_code(keycode, shift, True) == idaapi.get_key_code("I") and shift == 0:
                    if self.invert_if_event(vu):
                        return 1

            elif event == idaapi.hxe_right_click:
                self.vu,  = args
                idaapi.add_custom_viewer_popup_item(self.vu.ct, "Invert then/else", "I", self.menu_callback)

            elif event == idaapi.hxe_maturity:
                cfunc, maturity = args

                if maturity == idaapi.CMAT_FINAL:
                    self.restore(cfunc)
        except:
            traceback.print_exc()

        return 0