2017-04-23 145 views
1

我已经创建了DLL的生产版本。在使用virustotal进行扫描时,我注意到报告调试信息的结果在文件中,如下所示。有人可以告诉我这是什么调试信息,我该如何删除它?该DLL是从使用Visual Studio社区2017构建的C++。DLL调试信息

在任何人给我一个通用的建议,它是一个很好的做法有调试信息,我想说,不,我不需要调试信息,也不希望任何人都可以获得这个调试信息。

enter image description here

DUMPBIN /为DLL头如下:

PE signature found 

File Type: DLL 

FILE HEADER VALUES 
      14C machine (x86) 
       5 number of sections 
     58FBCD28 time date stamp Sat Apr 22 22:37:44 2017 
       0 file pointer to symbol table 
       0 number of symbols 
       E0 size of optional header 
      2102 characteristics 
        Executable 
        32 bit word machine 
        DLL 

OPTIONAL HEADER VALUES 
      10B magiC# (PE32) 
      14.10 linker version 
      10800 size of code 
      9800 size of initialized data 
       0 size of uninitialized data 
      2E64 entry point (10002E64) 
      1000 base of code 
      12000 base of data 
     10000000 image base (10000000 to 1001DFFF) 
      1000 section alignment 
      200 file alignment 
      6.00 operating system version 
      0.00 image version 
      6.00 subsystem version 
       0 Win32 version 
      1E000 size of image 
      400 size of headers 
       0 checksum 
       2 subsystem (Windows GUI) 
      140 DLL characteristics 
        Dynamic base 
        NX compatible 
      100000 size of stack reserve 
      1000 size of stack commit 
      100000 size of heap reserve 
      1000 size of heap commit 
       0 loader flags 
       10 number of directories 
      17E40 [  14C] RVA [size] of Export Directory 
      17F8C [  50] RVA [size] of Import Directory 
      1B000 [  1E0] RVA [size] of Resource Directory 
       0 [  0] RVA [size] of Exception Directory 
       0 [  0] RVA [size] of Certificates Directory 
      1C000 [ 11CC] RVA [size] of Base Relocation Directory 
      17780 [  38] RVA [size] of Debug Directory 
       0 [  0] RVA [size] of Architecture Directory 
       0 [  0] RVA [size] of Global Pointer Directory 
       0 [  0] RVA [size] of Thread Storage Directory 
      177B8 [  40] RVA [size] of Load Configuration Directory 
       0 [  0] RVA [size] of Bound Import Directory 
      12000 [  188] RVA [size] of Import Address Table Directory 
       0 [  0] RVA [size] of Delay Import Directory 
       0 [  0] RVA [size] of COM Descriptor Directory 
       0 [  0] RVA [size] of Reserved Directory 


SECTION HEADER #1 
    .text name 
    1069A virtual size 
    1000 virtual address (10001000 to 10011699) 
    10800 size of raw data 
    400 file pointer to raw data (00000400 to 00010BFF) 
     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 

SECTION HEADER #2 
    .rdata name 
    6834 virtual size 
    12000 virtual address (10012000 to 10018833) 
    6A00 size of raw data 
    10C00 file pointer to raw data (00010C00 to 000175FF) 
     0 file pointer to relocation table 
     0 file pointer to line numbers 
     0 number of relocations 
     0 number of line numbers 
40000040 flags 
     Initialized Data 
     Read Only 

    Debug Directories 

     Time Type  Size  RVA Pointer 
    -------- ------- -------- -------- -------- 
    58FBCD28 coffgrp  264 0001782C 1642C 4C544347 (LTCG) 
    58FBCD28 iltcg   0 00000000  0 

SECTION HEADER #3 
    .data name 
    1884 virtual size 
    19000 virtual address (10019000 to 1001A883) 
    800 size of raw data 
    17600 file pointer to raw data (00017600 to 00017DFF) 
     0 file pointer to relocation table 
     0 file pointer to line numbers 
     0 number of relocations 
     0 number of line numbers 
C0000040 flags 
     Initialized Data 
     Read Write 

SECTION HEADER #4 
    .rsrc name 
    1E0 virtual size 
    1B000 virtual address (1001B000 to 1001B1DF) 
    200 size of raw data 
    17E00 file pointer to raw data (00017E00 to 00017FFF) 
     0 file pointer to relocation table 
     0 file pointer to line numbers 
     0 number of relocations 
     0 number of line numbers 
40000040 flags 
     Initialized Data 
     Read Only 

SECTION HEADER #5 
    .reloc name 
    11CC virtual size 
    1C000 virtual address (1001C000 to 1001D1CB) 
    1200 size of raw data 
    18000 file pointer to raw data (00018000 to 000191FF) 
     0 file pointer to relocation table 
     0 file pointer to line numbers 
     0 number of relocations 
     0 number of line numbers 
42000040 flags 
     Initialized Data 
     Discardable 
     Read Only 

    Summary 

     2000 .data 
     7000 .rdata 
     2000 .reloc 
     1000 .rsrc 
     11000 .text 
+0

该文件的.rdata部分中的调试目录正在用于与调试无关的信息。微软不能真正修改数据目录而不会破坏很多工具,所以这是解决方法。例如,配置文件引导的优化信息,看起来像这样,大小是正确的。除此之外总是一个好主意,当你的程序在生产中崩溃时,你会得到一个小型转储。它没有透露任何敏感的东西,所以没有太多关于它的烦恼。 Dumpbin.exe /头文件以查看。 –

+0

调试信息通常存储在单独的.pdb文件中,而不是可执行文件本身。在你的情况下,可执行文件可能有调试部分(你使用类似Explorer的套件进行探索)而不是调试信息。 – VTT

+0

@Hans Passant:我已经在上面添加了DUMPBIN输出。假设我仍然想摆脱'调试'信息,这有可能吗?首先,我不知道倾销情况。如果有人给我发垃圾邮件,我不知道该怎么处理,而且我没有时间或倾向去了解它。其次,我的代码很少会崩溃 - 这只是个人偏好,所以获得转储的机会很小。我根本不需要倾销和调试,因此我想删除所有调试和无关信息的痕迹,以增加罗马尼亚语和波兰语脚本小子的乐趣。 – user118708

回答

1

为了消除调试目录完全添加/NOCOFFGRPINFO到链接器命令行下链接器/优化关闭链接时代码生成(即下降/LTCG),默认情况下启用VS2017中的发布版本。

+0

感谢您的回答。前段时间我问过类似的问题,但没有运气。也许你也可以提供关于TLS目录的线索? https://stackoverflow.com/questions/31690723/visual-studio-2015-2-new-sectionsin-exe-same-project – Jovibor