関数に名前を付ける簡単な IDAPython スクリプト の IDC スクリプト版です。
static name_custom_func()
{
auto newName = AskStr("FuncName", "Input function name");
if (newName != 0)
{
auto func = GetFunctionAttr(ScreenEA(), FUNCATTR_START);
if (func != -1)
{
auto newFuncName = "zzz_" + newName;
Message("Renaming %s to %s\n", GetFunctionName(func), newFuncName);
MakeNameEx(func, newFuncName, SN_PUBLIC);
}
}
}
また、ida.idc
に、上記の関数と一緒に、次のようなホットキー定義を書いておけば、Ctrl-N
でスクリプトを起動することが出来ます。
static main(void)
{
AddHotkey("Ctrl-N", "name_custom_func");
}