tinyLinker example
This example is from the tinyLinker project. It can be found under the Chapter#2
folder of this book’s GitHub project, which is publicly available. To save space, we only extracted the highlighted code; the complete source code should be referred to if you wish to look at the full project for detailed reading.
Now that you have learned how to generate a linker for an executable, next, you need to learn how to generate a PE program linker from scratch. We’ll take a hands-on approach to this in this section:
Figure 2.12 – The main function of tinyLinker
We assume that a simple executable should have at least three structure headers – that is, a DOS Header, NT Headers, and Section Headers, respectively. (Note that the File Header and Optional Header are part of the NT Headers). The contents of this section are appended to the ends of these headers.
In lines 26-31 of the code, the size of the entire program...