diff options
| author | KyleMiles <krm504@nyu.edu> | 2021-05-03 22:33:48 -0400 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2021-05-03 22:33:48 -0400 |
| commit | 677a2c3461d3c95b012367c07640987d608dc382 (patch) | |
| tree | 4052961c26a8b36f1775c4214a0d470d121bba46 /python | |
| parent | 49d128abb779c91f634fb4ffad1275dc39a29992 (diff) | |
BinaryView.create_user_function() now returns the created function
Resolves #1318
Diffstat (limited to 'python')
| -rw-r--r-- | python/binaryview.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/python/binaryview.py b/python/binaryview.py index ca288486..43f2e9db 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -3039,7 +3039,7 @@ class BinaryView(object): """ if plat is None: plat = self.platform - core.BNCreateUserFunction(self.handle, plat.handle, addr) + return binaryninja.function.Function(self, core.BNCreateUserFunction(self.handle, plat.handle, addr)) def remove_user_function(self, func): """ @@ -5515,21 +5515,21 @@ class BinaryView(object): graph_type): return None return result.value - + class QueueGenerator: def __init__(self, t, results): self.thread = t self.results = results t.start() - + def __iter__(self): return self - + def __next__(self): while True: if not self.results.empty(): return self.results.get() - + if (not self.thread.is_alive()) and self.results.empty(): raise StopIteration @@ -5672,7 +5672,7 @@ class BinaryView(object): ctypes.POINTER(core.BNLinearDisassemblyLine))\ (lambda ctxt, addr, match, line: not match_callback(addr, match,\ self._LinearDisassemblyLine_convertor(line)) is False) - + return core.BNFindAllTextWithProgress(self.handle, start, end, text, settings.handle, flags, graph_type, None, progress_func_obj, None, match_callback_obj) else: @@ -5689,7 +5689,7 @@ class BinaryView(object): return self.QueueGenerator(t, results) - def find_all_constant(self, start, end, constant, settings = None, + def find_all_constant(self, start, end, constant, settings = None, graph_type = FunctionGraphType.NormalFunctionGraph, progress_func = None, match_callback = None): """ @@ -5748,7 +5748,7 @@ class BinaryView(object): t = threading.Thread(target = lambda: core.BNFindAllConstantWithProgress(self.handle, start, end, constant, settings.handle, graph_type, None, progress_func_obj, None,\ match_callback_obj)) - + return self.QueueGenerator(t, results) def reanalyze(self): |
