How to extend a com-file into an exe-file in Windows?

138 Views Asked by At

I am working on a compiler for a small (toy) language that produces 16-bit com-files, which are executable in Windows XP. However, in more modern releases of Windows com-files are executable only with the help of tools such as DosBox. I would like my compiler to produce exe-files that can be executed directly in Windows 10.

As I understand it, the exe-file needs a header that instructs the system of how to execute it. My idea is to simply add the header at the beginning of the com-file to extend it into an exe-file. I wonder if anyone can recommend an appropriate tutorial that describes how exe-files works. More specifically, I am looking for a tutorial of how to build the smallest possible working exe-file.

I also wonder if there is a difference between exe-files for 32-bit or 64-bit Windows?

Best Regards, Stefan

1

There are 1 best solutions below

0
On

You can download description exe format here. You need pecoff.docx file.

Also you may look on this old but detailed doc here.