I found documentation on how the PE header is structured and how a program is loaded and started by the OS. Can you give me some pointers on what I should look now ? There is some very simple exe packer source I can examine ? UPX is way too much complex for me at the moment.
Sorry, I don't have any simple packers to point you to, but I think I've seen one or two long, long ago. Good luck!
One of the simpler tools than UPX is SimpleDPack, which is a very simple Windows exe packaging tool, suitable for learning or studying PE structures. Additionally, you can also consider Simple Executable Packer on SourceForge, a simple Windows exe/dll packaging tool, with source code mainly written in C and very minimalist.