auto created i64 added

main
serr 2025-03-17 17:51:01 +03:00
parent 0f36daba75
commit c530f629e7
1 changed files with 21 additions and 5 deletions

26
comp.py
View File

@ -1,18 +1,26 @@
import subprocess
import time
import os, time
from exetoi64 import make_i64
def main():
# Задается вручную
ida_path = r"C:\Users\user\Desktop\IDA Pro 7.7.220118 (Windows) (x86,x64,ARM64)\ida64.exe"
bindiff_path = r"C:\tools\BinDiff\bin\bindiff.exe"
idb_dir = r"C:\tools\idb"
bindiff_exports_dir = r"C:\tools\export"
exe_dir = r"C:\tools\temp"
#
# Создание .i64 из .exe файлов
exe_list = find_exe_in_dir(exe_dir)
for path in exe_list:
make_i64(ida_path, path, path+'.i64')
#
# Создание файлов экспорта, сравнение
start = time.perf_counter()
create_exports(bindiff_path, idb_dir, bindiff_exports_dir)
compare_exports(bindiff_path, bindiff_exports_dir)
create_exports(bindiff_path, exe_dir, exe_dir)
compare_exports(bindiff_path, exe_dir)
#
# Подсчет времени
@ -20,6 +28,14 @@ def main():
print(f"Elapsed: {elapsed}")
#
def find_exe_in_dir(directory):
exe_files = []
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith(".exe"):
exe_files.append(os.path.join(root, file))
return exe_files
def create_exports(bindiff_path, idb_dir, bindiff_exports_dir):
cmd = f"{bindiff_path} --export {idb_dir} --output_dir {bindiff_exports_dir}"
print('Creating export files...', end=' ')