diff options
| author | Rusty Wagner <rusty@vector35.com> | 2018-03-07 18:10:55 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2018-03-07 18:11:24 -0500 |
| commit | 1c7349fcf125994f2e577361626fe1fb02eac029 (patch) | |
| tree | 9855e97a3572c41af9f07f27e6b12eb1f117bf5d /python/binaryview.py | |
| parent | 352949f41ea0b66c833f272d2a2a1e5a77a9507c (diff) | |
Add APIs for skipping analysis of functions that are too large, and overriding this behavior
Diffstat (limited to 'python/binaryview.py')
| -rw-r--r-- | python/binaryview.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/python/binaryview.py b/python/binaryview.py index 7a6bc875..1c986a94 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -65,6 +65,9 @@ class BinaryDataNotification(object): def function_updated(self, view, func): pass + def function_update_requested(self, view, func): + pass + def data_var_added(self, view, var): pass @@ -180,6 +183,7 @@ class BinaryDataNotificationCallbacks(object): self._cb.functionAdded = self._cb.functionAdded.__class__(self._function_added) self._cb.functionRemoved = self._cb.functionRemoved.__class__(self._function_removed) self._cb.functionUpdated = self._cb.functionUpdated.__class__(self._function_updated) + self._cb.functionUpdateRequested = self._cb.functionUpdateRequested.__class__(self._function_update_requested) self._cb.dataVariableAdded = self._cb.dataVariableAdded.__class__(self._data_var_added) self._cb.dataVariableRemoved = self._cb.dataVariableRemoved.__class__(self._data_var_removed) self._cb.dataVariableUpdated = self._cb.dataVariableUpdated.__class__(self._data_var_updated) @@ -230,6 +234,12 @@ class BinaryDataNotificationCallbacks(object): except: log.log_error(traceback.format_exc()) + def _function_update_requested(self, ctxt, view, func): + try: + self.notify.function_update_requested(self.view, function.Function(self.view, core.BNNewFunctionReference(func))) + except: + log.log_error(traceback.format_exc()) + def _data_var_added(self, ctxt, view, var): try: address = var[0].address @@ -1013,6 +1023,15 @@ class BinaryView(object): result = core.BNGetGlobalPointerValue(self.handle) return function.RegisterValue(self.arch, result.value, confidence = result.confidence) + @property + def max_function_size_for_analysis(self): + """Maximum size of function (sum of basic block sizes in bytes) for auto analysis""" + return core.BNGetMaxFunctionSizeForAnalysis(self.handle) + + @max_function_size_for_analysis.setter + def max_function_size_for_analysis(self, size): + core.BNSetMaxFunctionSizeForAnalysis(self.handle, size) + def __len__(self): return int(core.BNGetViewLength(self.handle)) |
