HotKey

2018-09-10  本文已影响0人  BJChangAn

idapython/examples/hotkey.py

#---------------------------------------------------------------------
# This script demonstrates the usage of hotkeys.
#
# Note: Hotkeys only work with the GUI version of IDA and not in
#       text mode.
#
# Author: Gergely Erdelyi <gergely.erdelyi@d-dome.net>
#---------------------------------------------------------------------
import idaapi

def foo():
 print "Hotkey activated!"

# IDA binds hotkeys to IDC functions so a trampoline IDC function
# must be created
idaapi.CompileLine('static key_2() { RunPythonStatement("foo()"); }')
# Add the hotkey
AddHotkey("2", 'key_2')

# Press 2 to activate foo()

# The hotkey can be removed with
# DelHotkey('2')
上一篇 下一篇

猜你喜欢

热点阅读