sys.stdout = sys.stderr = IDAPythonStdOut() # ----------------------------------------------------------------------- # Initialize the help, with our own stdin wrapper, that'll query the user # ----------------------------------------------------------------------- import pydoc class IDAPythonHelpPrompter: def readline(self): return idaapi.askstr(0, '', 'Help topic?') help = pydoc.Helper(input = IDAPythonHelpPrompter(), output = sys.stdout) # Assign a default sys.argv sys.argv = [""] # Have to make sure Python finds our modules sys.path.append(_idaapi.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()) # Import all the required modules from idaapi import Choose, get_user_idadir, cvar, Choose2, Appcall, Form from idc import *
def isatty(self): return False # Redirect stderr and stdout to the IDA message window sys.stdout = sys.stderr = MyStdOut() # Assign a default sys.argv sys.argv = [""] # Have to make sure Python finds our modules if _idaapi.idainfo_is_64bit(_idaapi.cvar.inf): pythonDir = "python64" else: pythonDir = "python" sys.path.append(_idaapi.idadir(pythonDir)) print_banner() #----------------------------------------------------------- # Import all the required modules #----------------------------------------------------------- from idaapi import Choose, get_user_idadir, cvar from idc import * from idautils import * import idaapi #----------------------------------------------------------- # Build up the ScriptBox tool #-----------------------------------------------------------
# ----------------------------------------------------------------------- import pydoc class IDAPythonHelpPrompter: def readline(self): return idaapi.askstr(0, '', 'Help topic?') help = pydoc.Helper(input=IDAPythonHelpPrompter(), output=sys.stdout) # Assign a default sys.argv sys.argv = [""] # Have to make sure Python finds our modules sys.path.append(_idaapi.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()) # Import all the required modules from idaapi import Choose, get_user_idadir, cvar, Choose2, Appcall, Form from idc import *
def isatty(self): return False # Redirect stderr and stdout to the IDA message window sys.stdout = sys.stderr = MyStdOut() # Assign a default sys.argv sys.argv = [ "" ] # Have to make sure Python finds our modules if _idaapi.idainfo_is_64bit(_idaapi.cvar.inf): pythonDir = "python64" else: pythonDir = "python" sys.path.append(_idaapi.idadir(pythonDir)) print_banner() #----------------------------------------------------------- # Import all the required modules #----------------------------------------------------------- from idaapi import Choose, get_user_idadir, cvar from idc import * from idautils import * import idaapi #----------------------------------------------------------- # Build up the ScriptBox tool #----------------------------------------------------------- class ScriptBox(Choose):