Dumpbin输出,什么意思?

Dumpbin output ,meaning?

如果我这样做:

dumpbin myexe.exe

我得到的输出类似于:

Dump of file myexe.exe

File Type: EXECUTABLE IMAGE

Summary

      21000 .data
       1000 .gfids
     3C9000 .rdata
      4F000 .reloc
      B4000 .rsrc
     325000 .text
       1000 .tls

第二列(.data、.gfids、.rdata...)表示部分名称。 但是什么是第一列?分区大小?

这个值实际上是 aligned 部分大小。

如果您这样做 dumpbin /headers myexe.exe,您将获得更详细的输出。例如,dumpbin C:\Windows\explorer.exe 在我的系统上产生:

Dump of file c:\Windows\explorer.exe

File Type: EXECUTABLE IMAGE

Summary

    4000 .data
    1000 .didat
    1000 .imrsiv
   18000 .pdata
   7B000 .rdata
    6000 .reloc
  1EA000 .rsrc
  1C5000 .text

dumpbin /headers C:\Windows\explorer.exe,包含 .text 部分的输出如下(... = 省略的行):

...
SECTION HEADER #1
   .text name
  1C4737 virtual size
    1000 virtual address (0000000140001000 to 00000001401C5736)
  1C4800 size of raw data
     400 file pointer to raw data (00000400 to 001C4BFF)
       0 file pointer to relocation table
       0 file pointer to line numbers
       0 number of relocations
       0 number of line numbers
60000020 flags
         Code
         Execute Read
...

它还在 OPTIONAL HEADER VALUES 部分给出了 1000 section alignment

如您所见,.text 部分的大小实际上是 1C4737,当对齐时,它变为 1C5000,如 /summary 中所报告的(其中是 dumpbin) 的默认选项。