-1

When IDA realizes a function relies on the this* pointer it often places as the second variable. Severely mucking up things. I was wondering is there away to fix this and maybe in turn help type identification.

I tried writing a h file but the original code is in c++

1

You can freely define the calling convention if required, see:

https://www.hex-rays.com/products/ida/support/idadoc/1361.shtml

Relevant excerpt:

IDA supports the user-defined calling convention. In this calling convention, the user can explicitly specify the locations of arguments and the return value. For example:

   int __usercall func@<ebx>(int x, int y@<esi>);

denotes a function with 2 arguments: the first argument is passed on the stack and the second argument is passed in the ESI register and the return value is stored in the EBX register.

You can access the type definition by pressing Y by default, when on a function name (and paste the above, for example).

  • Thanks for the reply. I was wondering if there is a way to achieve this via script. As I have near a thousand functions in need of changing – Sinister Mephisto May 17 '18 at 9:44

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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