title: Convert exe to dll programaically
body: <p>I have a program compiled as exe and the programs needs to "convert" itself to a DLL, adding some exported functions. It contains both <code>WinMain</code> and <code>DllMain</code> functions.<br>
  I believe this shouldn't be hard, as this would mean only changing the PE header.<br> What's the best way to do it?<br>
  Note: Compiling it as DLL and EXE separately is <b>not</b> an option.</p>