def activate(self, ctx): g = globals() idahome = ida_diskio.idadir( "plugins\\Style_Paster" ) #change to set plguin path where the main plguin script is ida_idaapi.IDAPython_ExecScript( idahome + "\\Style_Paste_main.py", globals()) #change for the main plugin script
def runscript(script): """ Executes a script. This function is present for backward compatiblity. Please use idaapi.IDAPython_ExecScript() instead @param script: script path @return: Error string or None on success """ import ida_idaapi return ida_idaapi.IDAPython_ExecScript(script, globals())
# Have to make sure Python finds our modules sys.path.append(ida_diskio.idadir("python")) # Remove current directory from the top of the patch search if '' in sys.path: # On non Windows, the empty path is added sys.path.remove('') if os.getcwd() in sys.path: sys.path.remove(os.getcwd()) # ...and add it to the end if needed if not IDAPYTHON_REMOVE_CWD_SYS_PATH: sys.path.append(os.getcwd()) if IDAPYTHON_COMPAT_AUTOIMPORT_MODULES: # Import all the required modules from idaapi import get_user_idadir, cvar, Appcall, Form if IDAPYTHON_COMPAT_695_API: from idaapi import Choose2 from idc import * from idautils import * import idaapi # Load the users personal init file userrc = os.path.join(ida_diskio.get_user_idadir(), "idapythonrc.py") if os.path.exists(userrc): ida_idaapi.IDAPython_ExecScript(userrc, globals()) # All done, ready to rock.