AddressOfEntryPoint超出了文件的末尾

问题描述 投票:1回答:1

我试图了解COFF标题中的AddressOfEntryPoint

我有一个“没有”的.NET exe:

class Program
{
    public static void Main()
    {
    }
}

(我把它编译为x86应用程序)

我在COFF标题中获得的标准字段的值是:

COFF - Optional Header Standard Fields
======================================

UInt16    Magic                         0x0000010B
Byte      MajorLinkerVersion            0x30
Byte      MinorLinkerVersion            0x0
UInt32    SizeOfCode                    0x0400
UInt32    SizeOfInitializedData         0x0800
UInt32    SizeOfUninitializedData       0x0000
UInt32    AddressOfEntryPoint           0x2356
UInt32    BaseOfCode                    2000
UInt32    BaseOfData                    4000

AddressOfEntryPoint0x2356

该文件不够长,不能从任何地方偏移此值,那么它是什么?

(存档于:https://drive.google.com/open?id=1VClORkJKyGhd7o3YBPbCZEni1ad_mncl

.net windows executable portable-executable coff
1个回答
0
投票

为了计算文件中EntryPoint的偏移量,您需要减去BaseOfCode,但也需要从PointerToRawData部分添加.text。对于这个文件,最后一个是0x200和前面的计算它给0x556指向一个很好的jmp_CorExeMain

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.