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?
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.– ekseJul 3, 2013 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, 2013 at 0:49
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.
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.