예제 #1
0
 def init(self):
     if not _G['inited']:
         if hasattr(Config, "debug") and Config.debug:
             Logger.setVerbose(True)
         HexraysPlugin()
         UpdateTypeAction("Ctrl-Shift-U").register().addMenu()
         RenameTypeAction().register().addMenu()
         SubclassTypeAction().register().addMenu()
         MapInterfacesAction("Ctrl-Shift-I").register().addMenu()
         ExploreAction("Ctrl-Shift-E").register().addMenu()
         ExportTypesAction().register().addMenu()
         TestAction("Ctrl-Shift-]").register().addMenu()
         IDAAction('Reload', "Ctrl-Shift-R").setProc(
             self.reload).register().addMenu()
         IDAAction('Verbose').setProc(self.verbose).register().addMenu()
         IDAAction('About').setProc(self.version).register().addMenu()
         _G['inited'] = True
         doc = os.path.split(idc.GetIdbPath())[1].split('.')[0]
         inits = ["ida_init", "ida_init_" + doc.lower()]
         for y in inits:
             if not hasattr(Config, y):
                 continue
             for x in getattr(Config, y).split(';'):
                 x = x.strip()
                 Logger.debug("initcmd: %s", x)
                 try:
                     exec(x, globals())
                 except Exception as e:
                     print "Error running init cmd", x, ":", str(e)
     return idaapi.PLUGIN_KEEP
예제 #2
0
 def verbose(self):
     Logger.setVerbose(not Logger.isVerbose())
     Logger.info("Verbose mode is %s.",
                 "ON" if Logger.isVerbose() else "OFF")
예제 #3
0
def verbose(verb=True):
    Logger.setVerbose(verb)