exetoi64 added

main
serr 2025-03-16 18:33:32 +03:00
parent 12cce59009
commit d6beddbfbd
3 changed files with 37 additions and 4 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
venv
output.xlsx
output.xlsx
__pycache__

16
comp.py
View File

@ -4,6 +4,7 @@ import subprocess
# для работы с ida
from i64tosqlite import create_sqlite_from_i64
from exetoi64 import make_i64
# для работы с excel
import pandas as pd
@ -16,12 +17,19 @@ def main():
# эти пути необходимо задавать вручную
ida_executable = r"C:\tools\IDA\ida.exe"
diaphora_dir = r"C:\tools\diaphora"
i64_1_path = r"C:\tools\ilya.exe.i64"
i64_2_path = r"C:\tools\my.exe.i64"
exe_1_path = r"C:\tools\ilya.exe"
exe_2_path = r"C:\tools\my.exe"
#
# генерация i64 из exe
start = time.perf_counter()
i64_1_path = exe_1_path + ".i64"
i64_2_path = exe_2_path + ".i64"
make_i64(ida_executable, exe_1_path, i64_1_path)
make_i64(ida_executable, exe_2_path, i64_2_path)
#
# генерация sqlite базы из i64
start = time.perf_counter()
diaphora_script_path = diaphora_dir + r"\diaphora_ida.py"
diaphora_path = diaphora_dir + r"\diaphora.py"
sqlite1_path = i64_1_path+'.sqlite'
@ -39,6 +47,8 @@ def main():
#
# удаляю ненужное
os.remove(i64_1_path)
os.remove(i64_2_path)
os.remove(sqlite1_path)
os.remove(sqlite2_path)
os.remove(sql_output_path)

22
exetoi64.py Normal file
View File

@ -0,0 +1,22 @@
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)