auto_mal.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:auto_mal 作者: 0xhughes 项目源码 文件源码
def _hardcode_setup():
    # A user may want to hardcode in and out paths for their analysis files. If no config file exists, it will ask if you want to store your in/out options in one and use them from then on out.
    sane = 0
    home_dir = str(os.path.expanduser('~'))
    input_conf = raw_input('-- : --  Please enter full path to input sample directory: ')
    output_conf = raw_input('-- : --  Please enter full path to sample/analysis output directory: ')
    if not os.path.exists(input_conf) or not os.path.exists(output_conf):
        sys.exit("-- : --  Invalid paths detected. Please check input. Run again to re-enter paths.")
    print '-- : --  Is this input directory correct "'+str(input_conf)+'"?'
    print '-- : --  Is this output directory correct "'+str(output_conf)+'"?'
    while sane == 0:
        dir_choice = raw_input('-- : --  Yes or No: ')
        if dir_choice == 'Yes':
            conf_file = open(home_dir+'/automal_conf.conf', 'w')
            conf_file.write('ipath='+str(input_conf)+'\n')
            conf_file.write('opath='+str(output_conf)+'\n')
            conf_file.close()
            sane = 1
        if dir_choice == 'No':
            sys.exit('-- : --  Exited on incorrect paths. Run again to re-enter.')
        if dir_choice != 'No' and dir_choice != 'Yes':
            print '-- : --  Invalid choice, try again. Yes or No.'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号