我需要了解链接器如何工作以及链接器如何生成包含所有不同部分和段的 .exe。更准确地说,我希望至少能够使用十六进制编辑器制作一个包含以下代码的 .exe。
int main()
{
}
请建议我一些必要的读物。我有 John Levine 的链接器和加载器。
最佳答案
Ian Lance Taylor 编写了一个新的 ELF 链接器,名为 gold
。他在一系列 blog posts 中描述了链接器执行的一般任务。 .
这在细节上与 PE 链接器所做的不同,但总体思路都是相同的(与“链接器和加载器”中的相同。
I wanna be atleast able to make an .exe which contains the following code, with my hands using a hex editor
我不确定在这种情况下你为什么需要链接器。阅读description of PE file format ,构造必要的 header ,写一个小 .text
包含 xor %eax,%eax; ret
的部分,将切入点设置为该部分,...,利润?
关于linker - 链接器如何工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10968463/