4

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!

lllllllllllll
  • 8,519
  • 9
  • 45
  • 80

2 Answers2

10

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

Devolus
  • 21,661
  • 13
  • 66
  • 113
  • Hi Devolus, it seems that lots of edit work should be done if I use the asm file generated by "Create ASM File"... and I have no idea what can I do towards this issue... could you give me some help towards how to recompile this asm file...thank you! – lllllllllllll Dec 16 '13 at 20:53
  • 1
    I never produced a really workable output, at best I used it for reference. I'm not convinced that the target ASm is really assembleable, without a lot of work anyway. I doubt that you would get a better output with a script, and you would have to write it first. – Devolus Dec 16 '13 at 20:57
2

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.

Community
  • 1
  • 1
sudobangbang
  • 1,406
  • 10
  • 32
  • 55