mirror of
https://github.com/cemu-project/idapython.git
synced 2024-11-25 02:26:55 +01:00
18 lines
503 B
Python
18 lines
503 B
Python
import idaapi
|
|
|
|
def cb(*args):
|
|
print("Callback called!")
|
|
return 1
|
|
|
|
try:
|
|
ex_addmenu_item_ctx
|
|
idaapi.del_menu_item(ex_addmenu_item_ctx)
|
|
print("Menu removed")
|
|
del ex_addmenu_item_ctx
|
|
except:
|
|
ex_addmenu_item_ctx = idaapi.add_menu_item("Search/", "X", "", 0, cb, tuple("hello world"))
|
|
if ex_addmenu_item_ctx is None:
|
|
print("Failed to add menu!")
|
|
del ex_addmenu_item_ctx
|
|
else:
|
|
print("Menu added successfully. Run the script again to delete the menu") |