new
commit
0f36daba75
|
@ -0,0 +1,3 @@
|
||||||
|
__pycache__
|
||||||
|
venv
|
||||||
|
*.xlsx
|
|
@ -0,0 +1,42 @@
|
||||||
|
import subprocess
|
||||||
|
import time
|
||||||
|
|
||||||
|
def main():
|
||||||
|
|
||||||
|
# Задается вручную
|
||||||
|
bindiff_path = r"C:\tools\BinDiff\bin\bindiff.exe"
|
||||||
|
idb_dir = r"C:\tools\idb"
|
||||||
|
bindiff_exports_dir = r"C:\tools\export"
|
||||||
|
#
|
||||||
|
|
||||||
|
# Создание файлов экспорта, сравнение
|
||||||
|
start = time.perf_counter()
|
||||||
|
create_exports(bindiff_path, idb_dir, bindiff_exports_dir)
|
||||||
|
compare_exports(bindiff_path, bindiff_exports_dir)
|
||||||
|
#
|
||||||
|
|
||||||
|
# Подсчет времени
|
||||||
|
elapsed = time.perf_counter() - start
|
||||||
|
print(f"Elapsed: {elapsed}")
|
||||||
|
#
|
||||||
|
|
||||||
|
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=' ')
|
||||||
|
try:
|
||||||
|
subprocess.run(cmd, capture_output=True, check=True)
|
||||||
|
print('\033[92mSuccess!\033[0m')
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print(f"\033[91mError during export: {e}\033[0m")
|
||||||
|
|
||||||
|
def compare_exports(bindiff_path, bindiff_exports_dir):
|
||||||
|
cmd = f"{bindiff_path} {bindiff_exports_dir} --output_format log"
|
||||||
|
print('Comparing...', end=' ')
|
||||||
|
try:
|
||||||
|
subprocess.run(cmd, capture_output=True, check=True)
|
||||||
|
print('\033[92mSuccess!\033[0m')
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print(f"\033[91mError during comparing: {e}\033[0m")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
|
@ -0,0 +1,24 @@
|
||||||
|
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", infile]
|
||||||
|
|
||||||
|
process = subprocess.Popen(cmd, shell=True)
|
||||||
|
process.wait()
|
||||||
|
# там почему то создается ненужный asm файл
|
||||||
|
os.remove(infile+'.asm')
|
||||||
|
|
||||||
|
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)
|
Loading…
Reference in New Issue