import os
import subprocess

def make_i64(ida_executable, infile, idbfile):
    if os.path.isfile(idbfile):
        print("\033[31mSkipping existing IDB %s. Analysis has already been made\033[0m" % idbfile)
        return
    
    print(f"\033[92mAnalysing {infile}...\033[0m")

    cmd = [ida_executable, "-B", "-o%s" % idbfile, infile]

    process = subprocess.Popen(cmd, shell=True)
    process.wait()

if __name__ == "__main__":

    ida_executable = r"C:\Users\user\Desktop\IDA Pro 7.7.220118 (Windows) (x86,x64,ARM64)\ida64.exe"
    exe_file = r"C:\tools\ilya.exe"
    i64path = exe_file + ".i64"

    make_i64(ida_executable, exe_file, i64path)