summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJosh Watson <josh@joshwatson.com>2018-07-24 17:17:00 -0700
committerplafosse <peter@vector35.com>2018-07-24 20:17:00 -0400
commit1f986c2698ff9df6d42429b1b7699842223634e5 (patch)
tree5bc71e1f1a9c1e2453115b0c49b901af737765b4 /python
parent7495ed55cdee4aa042f6cea921b49b738e6c685f (diff)
Fix PluginCommand.register_for methods (#1084)
Several register_for_* methods included an extraneous `.startup` that was probably removed in the python3 refactor. This PR fixes that problem and allows those plugins to correctly register.
Diffstat (limited to 'python')
-rw-r--r--python/plugin.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/python/plugin.py b/python/plugin.py
index 6ca930c9..4d9add9c 100644
--- a/python/plugin.py
+++ b/python/plugin.py
@@ -363,7 +363,7 @@ class PluginCommand(with_metaclass(_PluginCommandMetaClass, object)):
.. warning:: Calling ``register_for_low_level_il_function`` with the same function name will replace the existing function but will leak the memory of the original plugin.
"""
- binaryninja.startup._init_plugins()
+ binaryninja._init_plugins()
action_obj = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.POINTER(core.BNBinaryView), ctypes.POINTER(core.BNLowLevelILFunction))(lambda ctxt, view, func: cls._low_level_il_function_action(view, func, action))
is_valid_obj = ctypes.CFUNCTYPE(ctypes.c_bool, ctypes.c_void_p, ctypes.POINTER(core.BNBinaryView), ctypes.POINTER(core.BNLowLevelILFunction))(lambda ctxt, view, func: cls._low_level_il_function_is_valid(view, func, is_valid))
cls._registered_commands.append((action_obj, is_valid_obj))
@@ -382,7 +382,7 @@ class PluginCommand(with_metaclass(_PluginCommandMetaClass, object)):
.. warning:: Calling ``register_for_low_level_il_instruction`` with the same function name will replace the existing function but will leak the memory of the original plugin.
"""
- binaryninja.startup._init_plugins()
+ binaryninja._init_plugins()
action_obj = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.POINTER(core.BNBinaryView), ctypes.POINTER(core.BNLowLevelILFunction), ctypes.c_ulonglong)(lambda ctxt, view, func, instr: cls._low_level_il_instruction_action(view, func, instr, action))
is_valid_obj = ctypes.CFUNCTYPE(ctypes.c_bool, ctypes.c_void_p, ctypes.POINTER(core.BNBinaryView), ctypes.POINTER(core.BNLowLevelILFunction), ctypes.c_ulonglong)(lambda ctxt, view, func, instr: cls._low_level_il_instruction_is_valid(view, func, instr, is_valid))
cls._registered_commands.append((action_obj, is_valid_obj))
@@ -401,7 +401,7 @@ class PluginCommand(with_metaclass(_PluginCommandMetaClass, object)):
.. warning:: Calling ``register_for_medium_level_il_function`` with the same function name will replace the existing function but will leak the memory of the original plugin.
"""
- binaryninja.startup._init_plugins()
+ binaryninja._init_plugins()
action_obj = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.POINTER(core.BNBinaryView), ctypes.POINTER(core.BNMediumLevelILFunction))(lambda ctxt, view, func: cls._medium_level_il_function_action(view, func, action))
is_valid_obj = ctypes.CFUNCTYPE(ctypes.c_bool, ctypes.c_void_p, ctypes.POINTER(core.BNBinaryView), ctypes.POINTER(core.BNMediumLevelILFunction))(lambda ctxt, view, func: cls._medium_level_il_function_is_valid(view, func, is_valid))
cls._registered_commands.append((action_obj, is_valid_obj))
@@ -420,7 +420,7 @@ class PluginCommand(with_metaclass(_PluginCommandMetaClass, object)):
.. warning:: Calling ``register_for_medium_level_il_instruction`` with the same function name will replace the existing function but will leak the memory of the original plugin.
"""
- binaryninja.startup._init_plugins()
+ binaryninja._init_plugins()
action_obj = ctypes.CFUNCTYPE(None, ctypes.c_void_p, ctypes.POINTER(core.BNBinaryView), ctypes.POINTER(core.BNMediumLevelILFunction), ctypes.c_ulonglong)(lambda ctxt, view, func, instr: cls._medium_level_il_instruction_action(view, func, instr, action))
is_valid_obj = ctypes.CFUNCTYPE(ctypes.c_bool, ctypes.c_void_p, ctypes.POINTER(core.BNBinaryView), ctypes.POINTER(core.BNMediumLevelILFunction), ctypes.c_ulonglong)(lambda ctxt, view, func, instr: cls._medium_level_il_instruction_is_valid(view, func, instr, is_valid))
cls._registered_commands.append((action_obj, is_valid_obj))