summaryrefslogtreecommitdiff
path: root/python/binaryview.py
diff options
context:
space:
mode:
authorverylazyguy <verylazyguy@hotmail.com>2019-01-03 13:04:31 -0500
committerJordan <jordan@psifertex.com>2019-01-03 14:02:55 -0500
commitac204fce33045803f27b438a2ffd3930d96fc52b (patch)
tree2882b35ebc9ab9aa4391e962c0d381b90062e081 /python/binaryview.py
parent38d01a00b5e4e67b4fad5d73617ad33f170f98bc (diff)
- add progress_func optional keyword argument to get_view_of_file
Diffstat (limited to 'python/binaryview.py')
-rw-r--r--python/binaryview.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/binaryview.py b/python/binaryview.py
index 768bd5f4..51b7da6c 100644
--- a/python/binaryview.py
+++ b/python/binaryview.py
@@ -411,12 +411,13 @@ class BinaryViewType(with_metaclass(_BinaryViewTypeMetaclass, object)):
return self.create(data)
@classmethod
- def get_view_of_file(cls, filename, update_analysis=True):
+ def get_view_of_file(cls, filename, update_analysis=True, progress_func=None):
"""
``get_view_of_file`` returns the first available, non-Raw `BinaryView` available.
:param str filename: Path to filename or bndb
:param bool update_analysis: defaults to True. Pass False to not run update_analysis_and_wait.
+ :param callable() progress_func: optional function to be called with the current progress and total count.
:return: returns a BinaryView object for the given filename.
:rtype: BinaryView or None
"""
@@ -426,7 +427,7 @@ class BinaryViewType(with_metaclass(_BinaryViewTypeMetaclass, object)):
if f is None or f.read(len(sqlite)) != sqlite:
return None
f.close()
- view = binaryninja.filemetadata.FileMetadata().open_existing_database(filename)
+ view = binaryninja.filemetadata.FileMetadata().open_existing_database(filename, progress_func)
else:
view = BinaryView.open(filename)