I am looking for a way to obtain the pseudocode of a function via a script. I am using IDAPro 6.9 on OS X 10.11.4 (El Capitan).
I did locate this documentation on using the decompiler in batch mode:
https://www.hex-rays.com/products/decompiler/manual/batch.shtml
If I am interpreting the documentation correctly, it would seem to indicate that I can execute:
idal -Ohexx86:decompiled_output:function_name -A myidapro.idb
and it will produce the pseudocode for function_name and write the result to decompiled_output. Is this correct?
When I try this, it just launches the text interface and no output file is created. I can, of course, launch the GUI and view the pseudocode of function_name.
Additionally, if there is a way to obtain the pseudocode of a function via a python script running within idapro, that would be the preferred option, but it is unclear to me whether that is possible.