9

It is possible to import structures and enums declarations from C files in IDA. However, is it possible to export structures and enums to C?

PSS
  • 3,088
  • 1
  • 21
  • 35
ekse
  • 2,208
  • 13
  • 19
  • I searched on Google on how to do this and couldn't find the answer in the first few results. I hope this type of self-answering is fine on this Stack Exchange. – ekse Jul 03 '13 at 21:38
  • it's even encouraged and it will certainly get you some upvotes if the answer is well-written and useful. +1x2 ;) – 0xC0000022L Jul 10 '13 at 00:49

2 Answers2

14

It is possible to export a structure by going in Local Types (Shift+F1). Then select the structure you want to export and in the contextual menu choose either Edit or Export to header file. It is possible to export multiple structures by holding Shift when selecting them.

ekse
  • 2,208
  • 13
  • 19
2

File-->Produce file-->Create C header file

This will export all defined structures and enums. Please note that in all IDA versions before IDA 6.5 you'll possibly need to reorder structures if you want to use created file for compilation of your own source.

w s
  • 8,458
  • 1
  • 24
  • 40