本文整理汇总了Python中ida_kernwin.action_handler_t方法的典型用法代码示例。如果您正苦于以下问题:Python ida_kernwin.action_handler_t方法的具体用法?Python ida_kernwin.action_handler_t怎么用?Python ida_kernwin.action_handler_t使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ida_kernwin
的用法示例。
在下文中一共展示了ida_kernwin.action_handler_t方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_hooks
# 需要导入模块: import ida_kernwin [as 别名]
# 或者: from ida_kernwin import action_handler_t [as 别名]
def init_hooks(idausr):
_setter = IdausrTemporarySetter(idausr)
class ActionHandler(ida_kernwin.action_handler_t):
def __init__(self, handler):
ida_kernwin.action_handler_t.__init__(self)
self.handler = handler
def activate(self, ctx):
with _setter:
self.handler()
def update(self, ctx):
return ida_kernwin.AST_ENABLE_ALWAYS
for name, label, handler, before in _HOOKS:
if ida_kernwin.unregister_action(name):
action = ida_kernwin.action_desc_t(name, label, ActionHandler(handler))
ida_kernwin.register_action(action)
ida_kernwin.attach_action_to_menu(before, name, ida_kernwin.SETMENU_INS)
示例2: __init__
# 需要导入模块: import ida_kernwin [as 别名]
# 或者: from ida_kernwin import action_handler_t [as 别名]
def __init__(self, items, idb_path, title):
ida_kernwin.action_handler_t.__init__(self)
self.items = items
self.idb_path = idb_path
self.title = title
示例3: __init__
# 需要导入模块: import ida_kernwin [as 别名]
# 或者: from ida_kernwin import action_handler_t [as 别名]
def __init__(self, graph):
ida_kernwin.action_handler_t.__init__(self)
self.graph = graph
示例4: __init__
# 需要导入模块: import ida_kernwin [as 别名]
# 或者: from ida_kernwin import action_handler_t [as 别名]
def __init__(self):
ida_kernwin.action_handler_t.__init__(self)
# Run editor when invoked.
示例5: __init__
# 需要导入模块: import ida_kernwin [as 别名]
# 或者: from ida_kernwin import action_handler_t [as 别名]
def __init__(self, callback, var_prop=False):
ida_kernwin.action_handler_t.__init__(self)
self.var_prop = var_prop
self.callback = callback
示例6: register_action
# 需要导入模块: import ida_kernwin [as 别名]
# 或者: from ida_kernwin import action_handler_t [as 别名]
def register_action(name, shortcut=''):
def handler(f):
# 1) Create the handler class
class MyHandler(ida_kernwin.action_handler_t):
def __init__(self):
ida_kernwin.action_handler_t.__init__(self)
# Say hello when invoked.
def activate(self, ctx):
t = threading.Thread(target=f)
t.start()
return 1
# This action is always available.
def update(self, ctx):
return ida_kernwin.AST_ENABLE_ALWAYS
# 2) Describe the action
action_desc = ida_kernwin.action_desc_t(
name, # The action name. This acts like an ID and must be unique
name, # The action text.
MyHandler(), # The action handler.
shortcut, # Optional: the action shortcut
name, # Optional: the action tooltip (available in menus/toolbar)
0) # Optional: the action icon (shows when in menus/toolbars)
# 3) Register the action
ida_kernwin.register_action(action_desc)
return f
return handler
示例7: __init__
# 需要导入模块: import ida_kernwin [as 别名]
# 或者: from ida_kernwin import action_handler_t [as 别名]
def __init__(self):
ida_kernwin.action_handler_t.__init__(self)