Files
idapython-src/examples/uihooks/prevent_jump.py
T
2019-11-14 15:58:44 +01:00

19 lines
551 B
Python

"""
This example shows how to use ida_kernwin.UI_Hooks, to respond to a
command instead of the action that would otherwise do it.
"""
import ida_kernwin
class prevent_jump_t(ida_kernwin.UI_Hooks):
def preprocess_action(self, action_name):
if action_name == "JumpEnter":
print("Inhibiting 'jump'!")
return 1
return 0
phh = prevent_jump_t()
if phh.hook():
print("From now on, pressing <Enter> will prevent IDA from jumping. "\
+"Please type 'phh.unhook()' to revert to the normal behavior.")