2

Over the IDA Gui it is possible to export a local type with dependencies to a header file. For example if i export a struct that has one member from type DWORD than the header file also contains "typedef unsigned int DWORD".

I want to do a similar task with the python api.

def get_member_type(struct, idx):
   member = ida_struct.get_member(struct, idx)
   tif = tinfo_t()
   ida_struct.get_member_tinfo(member, tif)
   return tif

This function return the type of the struct members for example "DWORD" but how can i get the information that this is a unsigned int?

  • You can use the difference in size or offset value. – Biswapriyo Feb 19 at 15:44
1

print_decls(ordinals_sring, flags) return a string with the same content as the "export to header file" option in the GUI.

The ordinals string can contain multiple ordinals seperated with a comma and all PDF_ Flags can be used (for example PDF_INCL_DEPS).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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