Note: This article was translated mainly by ChatGPT. If there is any mistake, please contact me.

Long ago, I knew that Windows PE executable files contained an MZ header, which is a complete DOS program. This time, for the 2023 New Year’s red packet, I finally used this long-delayed idea.

Before starting, I thought modifying the MZ header would not be too complicated. However, I ended up encountering several pitfalls and it took a long time to get it right, showing that I still have much to learn :(

Below, I’ll share the method to replace the MZ header of a PE executable file.

……

Continue reading