I'm currently trying to make a hotkey to rename example functions sub_123450(aType* this, void* a2)
to aType::123450(aType* this, void* a2)
. I have code to rename etc. but how can I get the name of the type of the arguments to the function?
1 Answer
func_ea = 0x123450 # sub_123450
tif = ida_typeinf.tinfo_t()
funcdata = ida_typeinf.func_type_data_t()
assert ida_nalt.get_tinfo(tif, func_ea)
assert tif.get_func_details(funcdata)
for pos, argument in enumerate(funcdata):
print(f'argument {pos + 1}: {argument.type}{argument.name}')
This should give you:
argument 1: aType* this
argument 2: void* a2