IDA pro script to extract all the instructions into a assemble file

7.3k views Asked by At

I am looking for some IDA pro scripts to extract all the instructions and write them into a assemble file, which can be re-assembly

Could anyone give me some help?

Thanks!

2

There are 2 answers

2
Devolus On BEST ANSWER

File -> Produce File -> Create ASM File ... Shortcut is ALT-F10

0
sudobangbang On

You could also do this via IDApython:

idc.GenerateFile(idc.OFILE_ASM, idc.GetInputFile()+".asm", 0, idc.BADADDR, 0)

This answer was found to a previous question found here. This answer also shows how to generate instruction when IDA only recognizes it as a binary file. This will help immensely at efficiently removing the gibberish that IDA produces. It utilizes the MakeCode() function. This will be more efficient because it eliminates the need to manually find all the entry points and hit "c" x numbers of times.