hi
I was wondering if these tasks could be assigned with hotkeys:
- copy a named func’s address
- go to address by name e.g: myfunc+0x42
- go to address by module offset; like in x64dbg “:$+0x1234”
hi
I was wondering if these tasks could be assigned with hotkeys:
Hi @alex ,
So, to summarize:
G hotkeyimport ida_idaapi
import ida_funcs
import ida_name
import ida_ida
import ida_kernwin
from PySide6 import QtWidgets
ACTION_HOTKEY = "Ctrl-Shift-Q"
def copy_current_function_name():
ea = ida_kernwin.get_screen_ea()
if ea == ida_idaapi.BADADDR:
ida_kernwin.warning("No current address")
return
func = ida_funcs.get_func(ea)
if func is None:
ida_kernwin.warning(f"No function at {ea:#x}")
return
name = ida_funcs.get_func_name(func.start_ea)
if not name:
name = ida_name.get_ea_name(func.start_ea)
# In case you want to keep the mangled name, remove this
demangled = ida_name.demangle_name(
name, ida_ida.inf_get_short_demnames())
if demangled:
name = demangled
QtWidgets.QApplication.clipboard().setText(name)
ida_kernwin.msg(f"Copied function name to clipboard: {name}\n")
class copy_func_name_plugin_t(ida_idaapi.plugin_t):
flags = ida_idaapi.PLUGIN_KEEP
comment = "Copy current function's name to clipboard"
help = "Copies the name of the function at the current EA to the clipboard"
wanted_name = "Copy function name to clipboard"
wanted_hotkey = ACTION_HOTKEY
def init(self):
return ida_idaapi.PLUGIN_KEEP
def run(self, arg):
copy_current_function_name()
def term(self):
pass
def PLUGIN_ENTRY():
return copy_func_name_plugin_t()