diff options
| author | Peter LaFosse <peter@vector35.com> | 2017-03-05 13:12:01 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2017-03-05 13:12:01 -0500 |
| commit | cf5997848b8819725315bd2c8dd8a04c70da3b63 (patch) | |
| tree | 24d9360e3ccfaee361aca4d345072c142c386a41 /python/plugin.py | |
| parent | a0132eed82d28d4408a2475847e1804a157b3dc1 (diff) | |
| parent | 27f1271083efb09efc6405f91be893ab38dad9a0 (diff) | |
Merginging with dev
Diffstat (limited to 'python/plugin.py')
| -rw-r--r-- | python/plugin.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/python/plugin.py b/python/plugin.py index 9a4da487..2632b5a9 100644 --- a/python/plugin.py +++ b/python/plugin.py @@ -24,7 +24,7 @@ import threading # Binary Ninja components import _binaryninjacore as core -from enums import LowLevelILOperation +from enums import PluginCommandType import startup import filemetadata import binaryview @@ -78,7 +78,7 @@ class PluginCommand(object): ctypes.memmove(ctypes.byref(self.command), ctypes.byref(cmd), ctypes.sizeof(core.BNPluginCommand)) self.name = str(cmd.name) self.description = str(cmd.description) - self.type = LowLevelILOperation(cmd.type) + self.type = PluginCommandType(cmd.type) @classmethod def _default_action(cls, view, action): @@ -210,21 +210,21 @@ class PluginCommand(object): def is_valid(self, context): if context.view is None: return False - if self.command.type == LowLevelILOperation.DefaultPluginCommand: + if self.command.type == PluginCommandType.DefaultPluginCommand: if not self.command.defaultIsValid: return True return self.command.defaultIsValid(self.command.context, context.view.handle) - elif self.command.type == LowLevelILOperation.AddressPluginCommand: + elif self.command.type == PluginCommandType.AddressPluginCommand: if not self.command.addressIsValid: return True return self.command.addressIsValid(self.command.context, context.view.handle, context.address) - elif self.command.type == LowLevelILOperation.RangePluginCommand: + elif self.command.type == PluginCommandType.RangePluginCommand: if context.length == 0: return False if not self.command.rangeIsValid: return True return self.command.rangeIsValid(self.command.context, context.view.handle, context.address, context.length) - elif self.command.type == LowLevelILOperation.FunctionPluginCommand: + elif self.command.type == PluginCommandType.FunctionPluginCommand: if context.function is None: return False if not self.command.functionIsValid: @@ -235,13 +235,13 @@ class PluginCommand(object): def execute(self, context): if not self.is_valid(context): return - if self.command.type == LowLevelILOperation.DefaultPluginCommand: + if self.command.type == PluginCommandType.DefaultPluginCommand: self.command.defaultCommand(self.command.context, context.view.handle) - elif self.command.type == LowLevelILOperation.AddressPluginCommand: + elif self.command.type == PluginCommandType.AddressPluginCommand: self.command.addressCommand(self.command.context, context.view.handle, context.address) - elif self.command.type == LowLevelILOperation.RangePluginCommand: + elif self.command.type == PluginCommandType.RangePluginCommand: self.command.rangeCommand(self.command.context, context.view.handle, context.address, context.length) - elif self.command.type == LowLevelILOperation.FunctionPluginCommand: + elif self.command.type == PluginCommandType.FunctionPluginCommand: self.command.functionCommand(self.command.context, context.view.handle, context.function.handle) def __repr__(self): |
