Created
May 25, 2020 21:01
-
-
Save psifertex/6ea0f79c9347970feeaa4a86f6a848d6 to your computer and use it in GitHub Desktop.
simple batch processing script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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