exe 上的字符串命令透露了太多

Strings command on exe revealing too much

本文关键字:透露 太多 命令 字符串 exe      更新时间:2023-10-16

我在VC++ 2010 Express中创建了一个应用程序,我想看看搜索字符串会揭示我的可执行文件。正如预期的那样,我看到了很多字符串,但引起我注意的是,我看到了 VS 为每个项目生成的.pdb文件的确切位置。

C:Users...myappDebugmyapp.pdb

这真的让我感到困扰,因为我认为不应该透露这么多信息(例如我的用户名)。除此之外,我还看到了很多错误消息,例如

Stack memory around _alloca was corrupted 
A local variable was used before it was initialized 
Stack memory was corrupted 
A cast to a smaller data type has caused a loss of data.  If this was intentional, you     should mask the source of the cast with the appropriate bitmask.  For example:  
char c = (i & 0xFF); 
Changing the code in this way will not affect the quality of the resulting optimized code. 
The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention. 
Stack around the variable ' ' was corrupted. 
The variable ' ' is being used without being initialized. 

我真的不明白为什么它们会出现(我的程序工作正常,它们都不适用),但我想我可以忍受。我的问题是我如何避免出现这种数据(尤其是当我说 pdb 位置时)?我尝试在项目属性中查找某些内容,但没有成功。

> 您想要的第一个选项是/PDBALTPATH:%_PDB% - 这将保留 PDB 名称但删除其路径。

错误消息是由默认选项/GS/RTC引起的。不过,后者不是发布版本的默认版本。 /GS-会关闭第一个,但这是一个安全风险。