def term(self):
		'''
		Cleanup IDASimulator and breakpoints when terminated.
		'''
		self.Cleanup()
		idaapi.del_menu_item(self.menu_context)
		return None
Beispiel #2
0
    def remove_menus(self):
        if self.qtconsole_action is not None:
            remove_idaipython_menu()
            idaapi.unregister_action(self.qtconsole_action.name)

        for menu_item in self.menu_items:
            idaapi.del_menu_item(menu_item)
 def term(self):
     """
     Terminate plugin
     """
     for context in self.menu_contexts:
         idaapi.del_menu_item(context)
     return None
Beispiel #4
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.detach_action_from_menu(self.menu_tab, self.fluorescence_action_name)
     else:
         if self.context_menu is not None:
             idaapi.del_menu_item(self.context_menu)
     return None
Beispiel #5
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.detach_action_from_menu(self.root_tab, self.action_name)
     else:
         if self.menu_context is not None:
             idaapi.del_menu_item(self.menu_context)
     return None
Beispiel #6
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.detach_action_from_menu(self.menu_tab, self.action_name)
     else:
         if self.menu_context is not None:
             idaapi.del_menu_item(self.menu_context)
     return None
 def term(self):
     """
     Terminate plugin
     """
     for context in self.menu_contexts:
         idaapi.del_menu_item(context)
     return None
Beispiel #8
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.detach_action_from_menu(self.menu_tab, self.leaf_function_action_name)
         idaapi.detach_action_from_menu(self.menu_tab, self.format_string_action_name)
     else:
         for context in self.menu_context:
             idaapi.del_menu_item(context)
     return None
Beispiel #9
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.unregister_action(self.action_rizzo_loadfile)
         idaapi.unregister_action(self.action_rizzo_producefile)
     else:
         idaapi.del_menu_item(self.menu_context_load)
         idaapi.del_menu_item(self.menu_context_produce)
     return None
Beispiel #10
0
    def destory():

        if Config.MENU_CONTEXT:
            idaapi.del_menu_item(Config.MENU_CONTEXT)
        
        try:
            Config.save()
        except IOError:
            logging.getLogger("Stingray").warning("Failed to write config file")
Beispiel #11
0
    def term(self):
        idaapi.msg("Terminating %s\n" % self.wanted_name)
        try:
            self.stop()
        except:
            pass

        for ctx in self.ctxs:
            idaapi.del_menu_item(ctx)
Beispiel #12
0
    def term(self):
        idaapi.msg("Terminating %s\n" % self.wanted_name)
        try:
            self.stop()
        except:
            pass

        for ctx in self.ctxs:
            idaapi.del_menu_item(ctx)
Beispiel #13
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.detach_action_from_menu(self.menu_name, self.to_from_action_name)
         idaapi.detach_action_from_menu(self.menu_name, self.from_to_action_name)
         idaapi.detach_action_from_menu(self.menu_name, self.curr_func_curr_block_action_name)
     else:
         for context in self.menu_context:
             idaapi.del_menu_item(context)
     return None
Beispiel #14
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.detach_action_from_menu(self.menu_tab,
                                        self.leaf_function_action_name)
         idaapi.detach_action_from_menu(self.menu_tab,
                                        self.format_string_action_name)
     else:
         for context in self.menu_context:
             idaapi.del_menu_item(context)
     return None
Beispiel #15
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.detach_action_from_menu(self.menu_tab,
                                        self.xref_current_func_action_name)
         idaapi.detach_action_from_menu(self.menu_tab,
                                        self.all_xref_action_name)
     else:
         for context in self.menu_context:
             idaapi.del_menu_item(context)
     return None
Beispiel #16
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.detach_action_from_menu(self.menu_tab,
                                        self.code_action_name)
         idaapi.detach_action_from_menu(self.menu_tab,
                                        self.data_action_name)
     else:
         for context in self.menu_context:
             idaapi.del_menu_item(context)
     return None
Beispiel #17
0
    def destory():

        if Config.MENU_CONTEXT:
            idaapi.del_menu_item(Config.MENU_CONTEXT)

        try:
            Config.save()
        except IOError:
            logging.getLogger("Stingray").warning(
                "Failed to write config file")
Beispiel #18
0
    def term(self):
        if idaapi.IDA_SDK_VERSION <= 695:
            idaapi.del_menu_item(self.menu_context_1)
            idaapi.del_menu_item(self.menu_context_2)
        if idaapi.IDA_SDK_VERSION >= 700:
            idaapi.detach_action_from_menu('Search/', 'my:opaction')
            idaapi.detach_action_from_menu('Search/', 'my:sigaction')
        else:
            pass

        return None
Beispiel #19
0
 def term(self):
     if idaapi.IDA_SDK_VERSION >= 700:
         idaapi.detach_action_from_menu(self.menu_name,
                                        self.to_from_action_name)
         idaapi.detach_action_from_menu(self.menu_name,
                                        self.from_to_action_name)
         idaapi.detach_action_from_menu(
             self.menu_name, self.curr_func_curr_block_action_name)
     else:
         for context in self.menu_context:
             idaapi.del_menu_item(context)
     return None
Beispiel #20
0
 def del_menu_items(self):
     """ Clear Ida Rop plugin menu entries """
     if idaapi.IDA_SDK_VERSION <= 695:
         for addmenu_item_ctx in self.addmenu_item_ctxs:
             idaapi.del_menu_item(addmenu_item_ctx)
     elif idaapi.IDA_SDK_VERSION >= 700:
         idaapi.detach_action_from_menu('Search/IdaRop/',
                                        'idarop:listgadgets')
         idaapi.detach_action_from_menu('Search/IdaRop/',
                                        'idarop:searchgadgets')
     else:
         pass
Beispiel #21
0
    def term(self):

        if idaapi.IDA_SDK_VERSION >= 700:
            idaapi.unregister_action("rizzo_load")
            idaapi.unregister_action("rizzo_produce")

            # No need to call detach_action_from_menu(); it'll be
            # done automatically on destruction of the action.
        else:
            idaapi.del_menu_item(self.menu_context_load)
            idaapi.del_menu_item(self.menu_context_produce)

        return None
Beispiel #22
0
    def term(self):
        if idaapi.IDA_SDK_VERSION < 700:
            idaapi.del_menu_item(self.menu_context_load)
            idaapi.del_menu_item(self.menu_context_produce)
        else:
            idaapi.detach_action_from_menu('File/Load file/',
                                           'my:rizzoloadsig')
            idaapi.detach_action_from_menu('File/Produce file/',
                                           'my:rizzoproducesig')
            idaapi.unregister_action('my:rizzoloadsig')
            idaapi.unregister_action('my:rizzoproducesig')

        return None
Beispiel #23
0
 def term(self):
     # IDA 7.x
     if idaapi.IDA_SDK_VERSION >= 700:
         if idaapi.unregister_action(action_alleycat_from) is None:
             print "Failed to unregister action."
         if idaapi.unregister_action(action_alleycat_to) is None:
             print "Failed to unregister action."
         if idaapi.unregister_action(action_alleycat_block) is None:
             print "Failed to unregister action."
     # IDA 6.x
     else:
         for context in self.menu_contexts:
             idaapi.del_menu_item(context)
     return None
Beispiel #24
0
    def term(self):
        if idaapi.IDA_SDK_VERSION <= 695:
            idaapi.del_menu_item(self.menu_context_1)
            idaapi.del_menu_item(self.menu_context_2)
        if idaapi.IDA_SDK_VERSION >= 700:
            idaapi.detach_action_from_menu(
                'Search/',
                'my:opaction')
            idaapi.detach_action_from_menu(
                'Search/',
                'my:sigaction')
        else:
            pass

        return None
Beispiel #25
0
def get_online(*args):
    global backup_file, m7, poli_id, sample_id, skel_conn

    if skel_conn.is_online:
        return 0

    print ""
    print "<!------- POLICHOMBR UPDATE -------!>"

    skel_conn.get_online()

    SaveBase(backup_file, idaapi.DBFL_TEMP)

    # test si le sample courant existe sur poli et si non, on le cree :]
    if poli_id == 0:
        data = skel_conn.poli_get(
            "/api/1.0/samples/" +
            lower(
                GetInputMD5()) +
            "/")
        if data["sample_id"] is not None:
            sample_id = data["sample_id"]
        else:
            print "[!] Cannot find remote sample"
            # XXX upload sample!
            skel_conn.get_offline()
            return 0

    # maintenant on peut update (et pousser nos modifs au passage)
    if update_poli_db() == -1:
        return -1

    # remove les liens vu qu'on en a plus besoin
    if "m7" in globals() and m7 is not None:
        idaapi.del_menu_item(m7)
        m7 = None
    # if "m8" in globals() and m8 != None:
        # idaapi.del_menu_item(m8)
        #m8 = None

    print "[+] Update finished"
    print "<!---------------------------------!>"
    return 0
Beispiel #26
0
def get_online(*args):
    global backup_file, m7, poli_id, sample_id, skel_conn

    if skel_conn.is_online:
        return 0

    print ""
    print "<!------- POLICHOMBR UPDATE -------!>"

    skel_conn.get_online()

    SaveBase(backup_file, idaapi.DBFL_TEMP)

    # test si le sample courant existe sur poli et si non, on le cree :]
    if poli_id == 0:
        data = skel_conn.poli_get("/api/1.0/samples/" + lower(GetInputMD5()) +
                                  "/")
        if data["sample_id"] is not None:
            sample_id = data["sample_id"]
        else:
            print "[!] Cannot find remote sample"
            # XXX upload sample!
            skel_conn.get_offline()
            return 0

    # maintenant on peut update (et pousser nos modifs au passage)
    if update_poli_db() == -1:
        return -1

    # remove les liens vu qu'on en a plus besoin
    if "m7" in globals() and m7 is not None:
        idaapi.del_menu_item(m7)
        m7 = None
    # if "m8" in globals() and m8 != None:
    # idaapi.del_menu_item(m8)
    #m8 = None

    print "[+] Update finished"
    print "<!---------------------------------!>"
    return 0
Beispiel #27
0
 def remove(self, option_groups):
     if "enable" in option_groups:
         if self.enable_menu_item:
             idaapi.del_menu_item(self.enable_menu_item)
     if "svn" in option_groups:
         for x in self.svn_menuitems:
             idaapi.del_menu_item(x)
             self.svn_menuitems = []
     if "full" in option_groups:
         for x in self.ex_addmenu_item_ctx:
             idaapi.del_menu_item(x)
         self.ex_addmenu_item_ctx = []
Beispiel #28
0
 def remove(self, option_groups):
     if "enable" in option_groups:
         if self.enable_menu_item:
             idaapi.del_menu_item(self.enable_menu_item)
     if "svn" in option_groups:
         for x in self.svn_menuitems:
             idaapi.del_menu_item(x)
             self.svn_menuitems = []
     if "full" in option_groups:
         for x in self.ex_addmenu_item_ctx:
             idaapi.del_menu_item(x)
         self.ex_addmenu_item_ctx = []
Beispiel #29
0
def cleanup_hooks():
    """Clean IDA hooks on exit"""
    global uihook, polihook, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10
    if "polihook" in globals() and polihook is not None:
        polihook.unhook()
        polihook = None
    if "uihook" in globals() and uihook is not None:
        uihook.unhook()
        uihook = None
    if "m1" in globals() and m1 is not None:
        idaapi.del_menu_item(m1)
        m1 = None
    if "m2" in globals() and m2 is not None:
        idaapi.del_menu_item(m2)
        m2 = None
    if "m3" in globals() and m3 is not None:
        idaapi.del_menu_item(m3)
        m3 = None
    if "m4" in globals() and m4 is not None:
        idaapi.del_menu_item(m4)
        m4 = None
    if "m5" in globals() and m5 is not None:
        idaapi.del_menu_item(m5)
        m5 = None
    if "m6" in globals() and m6 is not None:
        idaapi.del_menu_item(m6)
        m6 = None
    if "m7" in globals() and m7 is not None:
        idaapi.del_menu_item(m7)
        m7 = None
    if "m8" in globals() and m8 is not None:
        idaapi.del_menu_item(m8)
        m8 = None
    if "m9" in globals() and m9 is not None:
        idaapi.del_menu_item(m9)
        m9 = None
    if "m10" in globals() and m10 is not None:
        idaapi.del_menu_item(m10)
        m10 = None
    return
Beispiel #30
0
    # MakeComm(sEA,"Test Comment")
    SetFunctionCmt(sEA, "Test Comment", 0)
    ##graph()


def go_callback(*args):
    go()
    return 1


# IDA binds hotkeys to IDC functions so a trampoline IDC function must be created
idaapi.CompileLine('static flopy_key() { RunPythonStatement("on_hotkey()"); }')
add_idc_hotkey(hotkey_str, "flopy_key")
idaapi.CompileLine('static flopy_click() { RunPythonStatement("on_click()"); }')
add_idc_hotkey(hotkey_str2, "flopy_click")


# Add menu item
try:
    if ctx:
        idaapi.del_menu_item(ctx)
except:
    pass

ctx = idaapi.add_menu_item("Search/", "Go", "", 0, go_callback, tuple("hello world"))
if ctx is None:
    print "Failed to add menu!"
    del ctx
else:
    print "Menu added successfully!"
Beispiel #31
0
 def term(self):
     for context in self.menu_contexts:
         idaapi.del_menu_item(context)
     return None
Beispiel #32
0
def cleanup_hooks():
    """Clean IDA hooks on exit"""
    global uihook, polihook, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10
    if "polihook" in globals() and polihook is not None:
        polihook.unhook()
        polihook = None
    if "uihook" in globals() and uihook is not None:
        uihook.unhook()
        uihook = None
    if "m1" in globals() and m1 is not None:
        idaapi.del_menu_item(m1)
        m1 = None
    if "m2" in globals() and m2 is not None:
        idaapi.del_menu_item(m2)
        m2 = None
    if "m3" in globals() and m3 is not None:
        idaapi.del_menu_item(m3)
        m3 = None
    if "m4" in globals() and m4 is not None:
        idaapi.del_menu_item(m4)
        m4 = None
    if "m5" in globals() and m5 is not None:
        idaapi.del_menu_item(m5)
        m5 = None
    if "m6" in globals() and m6 is not None:
        idaapi.del_menu_item(m6)
        m6 = None
    if "m7" in globals() and m7 is not None:
        idaapi.del_menu_item(m7)
        m7 = None
    if "m8" in globals() and m8 is not None:
        idaapi.del_menu_item(m8)
        m8 = None
    if "m9" in globals() and m9 is not None:
        idaapi.del_menu_item(m9)
        m9 = None
    if "m10" in globals() and m10 is not None:
        idaapi.del_menu_item(m10)
        m10 = None
    return
 def term(self):
     logger.debug("[+] %s.term()" % self.__class__.__name__)
     for menu in self.menuitems:
         idaapi.del_menu_item(menu)
Beispiel #34
0
	def del_menu_items(self):
		for addmenu_item_ctx in self.addmenu_item_ctxs:
			idaapi.del_menu_item(addmenu_item_ctx)
Beispiel #35
0
 def term(self):
     for menu in self.menus:
         idaapi.del_menu_item(menu)
     idaapi.msg("Sunrace plugin unloaded... [ , ]\n")
     return True
Beispiel #36
0
 def term(self):
     idaapi.del_menu_item(self.menu_context_load)
     idaapi.del_menu_item(self.menu_context_produce)
     return None
Beispiel #37
0
 def remove_menus():
     for menu_item in menu_items:
         idaapi.del_menu_item(menu_item)
Beispiel #38
0
 def rm(cls, path, name):
     '''Remove the menu item at the specified `path` with the provided `name`.'''
     idaapi.del_menu_item( cls.state[path, name] )
     del cls.state[path, name]
Beispiel #39
0
 def term(self):
     idaapi.del_menu_item(self.menu_context_1)
     idaapi.del_menu_item(self.menu_context_2)
     return None
Beispiel #40
0
 def term(self):
     for context in self.menu_contexts:
         idaapi.del_menu_item(context)
     return None
Beispiel #41
0
 def term(self):
     idaapi.del_menu_item(self.leaf_context_menu)
     idaapi.del_menu_item(self.stdio_context_menu)
     return None
Beispiel #42
0
import idaapi

def cb(*args):
    print("Callback called!")
    return 1

try:
    ex_addmenu_item_ctx
    idaapi.del_menu_item(ex_addmenu_item_ctx)
    print("Menu removed")
    del ex_addmenu_item_ctx
except:
    ex_addmenu_item_ctx = idaapi.add_menu_item("Search/", "X", "", 0, cb, tuple("hello world"))
    if ex_addmenu_item_ctx is None:
        print("Failed to add menu!")
        del ex_addmenu_item_ctx
    else:
        print("Menu added successfully. Run the script again to delete the menu")
Beispiel #43
0
import idaapi


def cb(*args):
    print("Callback called!")
    return 1


try:
    ex_addmenu_item_ctx
    idaapi.del_menu_item(ex_addmenu_item_ctx)
    print("Menu removed")
    del ex_addmenu_item_ctx
except:
    ex_addmenu_item_ctx = idaapi.add_menu_item("Search/", "X", "", 0, cb,
                                               tuple("hello world"))
    if ex_addmenu_item_ctx is None:
        print("Failed to add menu!")
        del ex_addmenu_item_ctx
    else:
        print(
            "Menu added successfully. Run the script again to delete the menu")
Beispiel #44
0
    def destory():

        if Config.MENU_CONTEXT:
            idaapi.del_menu_item(Config.MENU_CONTEXT)

        Config.save()
Beispiel #45
0
 def term(self):
     idaapi.del_menu_item(self.menu_context_extract)
     return None
Beispiel #46
0
	def term(self):
		for menu in self.menus:
			idaapi.del_menu_item(menu)
		idaapi.msg("Sunrace plugin unloaded... [ , ]\n")
		return True
Beispiel #47
0
 def term(self):
     idaapi.del_menu_item(self.xref_to)
     idaapi.del_menu_item(self.xref_from)
Beispiel #48
0
 def rm(cls, path, name):
     '''Remove the menu item at the specified `path` with the provided `name`.'''
     res = cls.state[path, name]
     idaapi.del_menu_item(res)
     del cls.state[path, name]
Beispiel #49
0
 def remove_menus():
     for menu_item in menu_items:
         idaapi.del_menu_item(menu_item)
Beispiel #50
0
 def term(self):
     idaapi.del_menu_item(self.menu_context)
     return None
Beispiel #51
0
 def term(self):
     for menu_items in self.menu_items:
         idaapi.del_menu_item(menu_items)
Beispiel #52
0
 def term(self):
     idaapi.del_menu_item(self.menu_context_load)
     idaapi.del_menu_item(self.menu_context_produce)
     return None
 def term(self):
     logger.debug("[+] %s.term()" % self.__class__.__name__)
     if idaapi.IDA_SDK_VERSION < 700:
         for menu in self.menuitems:
             idaapi.del_menu_item(menu)
Beispiel #54
0
 def rm(cls, path, name):
     idaapi.del_menu_item( cls.state[path,name] )
     del cls.state[path,name]
Beispiel #55
0
 def term(self):
     idaapi.del_menu_item(self.context_menu)
     return None