Is there a way to specify the name of a function when creating it with idc.MakeFunction()
?
If not, what is the best practice to rename a function?
I found idc.GetFunctionName(ea)
but no counterpart to set a name. A google research turned up some examples where people used idc.MakeNameEx()
. Yet, the purpose of MakeNameEx
seems to be to rename addresses:
def MakeNameEx(ea, name, flags): """ Rename an address
@param ea: linear address
@param name: new name of address. If name == "", then delete old name @param
flags: combination of SN_... constants
And involves a whole bunch of flags such as:
[...]
SN_NOCHECK = idaapi.SN_NOCHECK # Replace invalid chars with SubstChar
SN_PUBLIC = idaapi.SN_PUBLIC # if set, make name public
SN_NON_PUBLIC = idaapi.SN_NON_PUBLIC # if set, make name non-public
SN_WEAK = idaapi.SN_WEAK # if set, make name weak
SN_NON_WEAK = idaapi.SN_NON_WEAK # if set, make name non-weak
[...]
What I need is a simple rename of a function keeping all its properties, flags etc...