调试信息会显示C ++ / MSVC中的代码吗? [英] Do debugging information reveal code in C++ / MSVC?

查看:113
本文介绍了调试信息会显示C ++ / MSVC中的代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我们分发包含调试信息/符号的已编译C ++可执行文件,这是否会使第三方比缺少调试信息的情况更多地了解从中编译程序的源代码?

If we distribute a compiled C++ executable which contains debug information/symbols does this enable a third party to learn more about the source code from which the program was compiled than if debug information were missing?


  • 了解更多 =>获取有关函数,变量,类等的名称的信息。

  • 当然假定没有调试-符号文件(.pdb)已发运

此问题主要与保护用MSVC编译的C ++中的专有代码有关,但是信息

This question relates mostly to protection of proprietary code in C++ as compiled with MSVC, but information about other compilers and debug symbols in general may provide insights as well.

一些问题的上下文:我们附带调试信息的可执行文件会在程序意外的情况下创建堆栈跟踪

Some context for the question: We ship executables with debug information to create stack traces in case of unexpected program state.

编辑:我们当然将PDB维护在公司内部,以便能够在堆栈跟踪到达时读取堆栈跟踪。

We maintain the PDBs inside our company, of course, to be able to read the stack traces once they arrive.

推荐答案

基本上没有。所有调试信息都存储在PDB中,而EXE仅包含指向PDB的路径。

Basically, no. All debug information is stored in the PDB and the EXE just contains the path to the PDB.

如果您担心的话,可以始终使用十六进制编辑器浏览二进制代码,以查看.EXE中嵌入了哪些信息。每当我为一个新平台或一组新的开发工具构建时,都会倾向于这样做。有时,您会嵌入一些您真正不想要的东西,但通常与代码无关,更像是网络名称和路径。

If you are concerned, you can always use a hex editor to browse through the binary code to see what information is embedded in the .EXE. This is something I tend to do whenever I build for a new platform or with a new set of dev tools. Sometimes you get things embedded that you don't really want, but usually not about the code, more like network names and paths.

这篇关于调试信息会显示C ++ / MSVC中的代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆