<s> import os <EOL> import sys <EOL> import time <EOL> import warnings <EOL> import _idaapi <EOL> __EA64__ = _idaapi . BADADDR == <NUM_LIT> L <EOL> class IDAPythonStdOut : <EOL> """<STR_LIT>""" <EOL> def write ( self , text ) : <EOL> text = text . decode ( '<STR_LIT:ascii>' , '<STR_LIT:replace>' ) . encode ( '<STR_LIT:ascii>' , '<STR_LIT:replace>' ) <EOL> _idaapi . msg ( text ) <EOL> def flush ( self ) : <EOL> pass <EOL> def isatty ( self ) : <EOL> return False <EOL> def runscript ( script ) : <EOL> """<STR_LIT>""" <EOL> import idaapi <EOL> return idaapi . IDAPython_ExecScript ( script , globals ( ) ) <EOL> def print_banner ( ) : <EOL> banner = [ <EOL> "<STR_LIT>" % sys . version , <EOL> "<STR_LIT>" + ( "<STR_LIT>" if __EA64__ else "<STR_LIT>" ) + "<STR_LIT>" % IDAPYTHON_VERSION <EOL> ] <EOL> sepline = '<STR_LIT:->' * ( max ( [ len ( s ) for s in banner ] ) + <NUM_LIT:1> ) <EOL> print ( sepline ) <EOL> print ( "<STR_LIT:\n>" . join ( banner ) ) <EOL> print ( sepline ) <EOL> _orig_stdout = sys . stdout ; <EOL> _orig_stderr = sys . stderr ; <EOL> sys . stdout = sys . stderr = IDAPythonStdOut ( ) <EOL> import pydoc <EOL> class IDAPythonHelpPrompter : <EOL> def readline ( self ) : <EOL> return idaapi . askstr ( <NUM_LIT:0> , '<STR_LIT>' , '<STR_LIT>' ) <EOL> help = pydoc . Helper ( input = IDAPythonHelpPrompter ( ) , output = sys . stdout ) <EOL> sys . argv = [ "<STR_LIT>" ] <EOL> sys . path . append ( _idaapi . idadir ( "<STR_LIT>" ) ) <EOL> if '<STR_LIT>' in sys . path : <EOL> sys . path . remove ( '<STR_LIT>' ) <EOL> if os . getcwd ( ) in sys . path : <EOL> sys . path . remove ( os . getcwd ( ) ) <EOL> if not IDAPYTHON_REMOVE_CWD_SYS_PATH : <EOL> sys . path . append ( os . getcwd ( ) ) <EOL> from idaapi import Choose , get_user_idadir , cvar , Choose2 , Appcall , Form <EOL> from idc import * <EOL> from idautils import * <EOL> import idaapi <EOL> userrc = os . path . join ( get_user_idadir ( ) , "<STR_LIT>" ) <EOL> if os . path . exists ( userrc ) : <EOL> idaapi . IDAPython_ExecScript ( userrc , globals ( ) ) </s>
