Skip to content

Instantly share code, notes, and snippets.

@psifertex
Created May 25, 2020 21:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psifertex/6ea0f79c9347970feeaa4a86f6a848d6 to your computer and use it in GitHub Desktop.
Save psifertex/6ea0f79c9347970feeaa4a86f6a848d6 to your computer and use it in GitHub Desktop.
simple batch processing script
#!/usr/bin/env python3
from binaryninja import *
import glob, sys, os
if len(sys.argv) > 1:
path = sys.argv[1:]
else:
path = ["/bin/ls"]
for arg in path:
for f in [x for x in glob.glob(arg) if os.path.isfile(x) and os.access(x, os.R_OK)]:
bv = BinaryViewType.get_view_of_file(f)
print(f)
print("Count %d" % len(bv.functions))
for fun in bv.functions:
print("%x %s" % (fun.start, fun.name))
bv.file.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment