4

如果我做这样的事情:

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...)代表节名。但是第一列是什么?截面尺寸?

4

1 回答 1

2

这个值实际上是对齐的节大小。

如果这样做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
...

它也在1000 section alignment节中给出OPTIONAL HEADER VALUES

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

于 2017-02-02T18:15:44.977 回答