I am using idapython to get function return type and arguments @ an indirect call instruction.
I was able to sync ida disassembler with hexrays decompiler as asked here and I can now get decompiled output for specific instruction. For e.g.
I can get:
v4 = ((__int64 (__fastcall *)(_QWORD))fn2)(b) + v3;
My final goal is to get function return type for e.g. in above case it could be the type of variable
v4 and argument types, for e.g. type of variable
b. So, say the function can possibly be:
return type: int arg1 type: int ....
I want to get these for indirect callsites.
I checked the hexrays api but I believe there isn't any function which can give me return type and argument types/ count at a certain callsite.
One way to achieve this may be to extract arguments using regex for e.g. in above case
b and then hunt their type by searching through
lvars method from decompiled object. But, it seems like a lot of work (and maybe error prone) for seemingly easier problem using some internal ida functions.
Could you please give many any directions on how to solve this? really appreciated.