currently I am trying to use IDA pro to generate assembly code from PE file and recompile it.Firstlybasically I know this way:File -> Produce File -> Create ASM Fileand it seems the asm file it generated cannot be directly recompile.Seconduse some IDC or Python script in the IDA to extract useful asm instructions, put them together in order and recompile,this kind of solution can be seen from some academic paper, but non of them have given some detailed instructions about how to do this task...Could anyone give me some instructions about this issue..? Thank you!
Recompile the asm file IDA pro created
disassembly;ida;idapython
Many years ago I wrote a very crude script to dump the current (as defined by cursor location) function to the output window using mostly nasm compatible syntax. You could potentially modify to save output to a file and iterate over every function in your database. The script is available here: nasm dumper