I actually have a .asm formatted file. This file was certainly obtained by disassembling an original exe file with IDA and then save as an .asm file. Now I have this .asm and I would like to get back the original exe, that I have lost. Unfortunately I cannot upload this .asm file in IDA pro and assemble it. So my question is "how to assemble it again to make an exe as original one ? Thank for your help. Bye

1 Answer 1


As far as assembling .asm file is concerned (assuming you are on windows platform) there are various assembler such a NASM,MASM,FLAT assembler etc. and various others in compilers suite such as GNU GCC Mingw.

But considering above case, as .asm file is generated by IDA, directly assembling it in any assembler program will give you large number of errors. Asm file generated by IDA is easy to understand but difficult to assemble.

However, if the size of asm file is small say 1-3Kb a little effort and knowledge of syntax specific to assembler tool will yield the result provided every instruction was disassembled successfully by IDA. But if the size of file is large then it is a difficult task.

Please also note that sometime IDA assembly can be erroneous such as positive sp detected in that case you have to correct/fix the stack size in assembly file manually.

Moreover, sometimes IDA cannot recognize code and it is left as data in the disassembly which will get reflected in your .asm file, this will generate error when you assemble your file.

Finally, assembling IDA generated .asm file is bad idea, it's better to go through IDA pseudo code and generate a corresponding function.

  • I attach this link that however is quite old reverseengineering.stackexchange.com/questions/3800/… Commented May 28, 2022 at 10:28
  • Yes sir, this link explains pretty much every aspect. Task is tedious but I think once you know what a exe is supposed to do then you can make a program for that. However again size of the exe and how complex is the task are the crux.
    – Viktor
    Commented May 28, 2022 at 10:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.