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 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.