Skip to main content

A python library for generate ida pro files in batch mode & compare executable files use bindiff in batch mode.

Project description

Batch-IDA

GitHub License GitHub top language Pepy Total Downlods

PyPI - Version PyPI - Wheel PyPI - Python Version

A python library for generate ida pro files in batch mode & compare executable files use bindiff in batch mode.

Features

  1. Fast generate idb/i64 files from binary files in batch mode (Multiprocess supported) generate_idb
  2. IDA Pro Plugin Script support
  3. Use Bindiff for batch comparison of idb files
  4. Roughly read the comparison results bia_result

Requirements

  • Windows environment or Linux wine environment
  • IDA pro 7.7/8.3
  • BinDiff 7/8 (Optional, used to compare executable files in batch mode)

Install

pip install --upgrade batch-ida

Usage

BI_IDA

Generate .idb/.i64 files (and run plugin) in batch mode.

from batch_ida import BI_IDA


# create a BI_IDA object with ida pro path
bi = BI_IDA('C:\Tools\IDA Pro')
# if you use wine in linux, you can set use_wine=True
# bi = BI_IDA('\home\Tools\IDA Pro', use_wine=True)

# optional
# bi.set_script(r'.\example_script.py')   # run IDA script
# bi.max_subprocess = 8                   # set max subprocess

bi.batch_idb_fromdir('your/binary/files/dir')   # generate idb files from binary files

BI_Dircmp

Compare files in dir_a & dir_b, and move different files to dst_a & dst_b.

from batch_ida import BI_Dircmp


dir_a = r'ver_A.rom/squashfs-root/usr/lib/'
dir_b = r'ver_B.rom/squashfs-root/usr/lib/'

dst_a = r'compare/ver_A'
dst_b = r'compare/ver_B'

bid = BI_Dircmp(dir_a, dir_b, dst_a, dst_b)
bid.cmp()

BI_Bindiff

Generate .idb and .bindiff files in batch mode. (Windows only)

from batch_ida import BI_Bindiff


bib = BI_Bindiff()

# Set ida pro and bindiff path
bib.set_ida_path('C:\Tools\IDA Pro')
bib.set_bindiff_path('C:\Program Files\BinDiff')

dst_a = r'compare/ver_A'
dst_b = r'compare/ver_B'
# dst_a and dst_b are the directories where the binary files to be compared are located
output = bib.batch_bindiff(dst_a, dst_b)
# output is a directory containing bindiff files(sqlite3)

BI_Analyzer

Analyze Bindiff files (sqlite3 file format) in batch mode and print the results.

from batch_ida import BI_Analyzer


bia = BI_Analyzer(r'path\to\output_dir')
bia.print_base_info()

# let's print the diff files with similarity < 0.95 and != 0.0
print("%s\t%s\t%s\t%s\t%s\t%s" % ("SIM", "CONF", "TOTAL", "FUNC", "LIBFUNC", "NAME"))
info_list = bia.get_info_list()
for i in info_list:
    if i['total_func'] & i['func_dif'] & i['libfunc_dif']:
        print("%.02f\t%.2f\t%d\t%d\t%d\t%s" % (i['similarity'], i['confidence'], i['total_func'], i['func_dif'], i[
            "libfunc_dif"], i['name']))
    elif i['similarity'] < 0.95 and i['similarity'] != 0.0:
        print("%.02f\t%.2f\t%d\t%d\t%d\t%s" % (i['similarity'], i['confidence'], i['total_func'], i['func_dif'], i[
            "libfunc_dif"], i['name']))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

batch_ida-0.1.6.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

batch_ida-0.1.6-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file batch_ida-0.1.6.tar.gz.

File metadata

  • Download URL: batch_ida-0.1.6.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.8 Windows/10

File hashes

Hashes for batch_ida-0.1.6.tar.gz
Algorithm Hash digest
SHA256 c11fcde4d17d0c758ea30cedc8e5a42ed000c3540276bf1d4b0f1722d70b7763
MD5 b7595e9d3a0f3e4466e32781793cd30d
BLAKE2b-256 8441efe22e3aa76e6b509de3c01f3ef2ee99290fcb9c3060014afefd439285ea

See more details on using hashes here.

File details

Details for the file batch_ida-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: batch_ida-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.8 Windows/10

File hashes

Hashes for batch_ida-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2e5eefb7038080e941964a8d32a5e2d2856e67109725d1f224dc1c45d4d8a44d
MD5 1b98d014d276d99914d1bcb5c3b53324
BLAKE2b-256 93918b56a5dfff9dfda7c01514e69c567a3bd47a1639f3801e5c699e18768f7e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page