How much information do pdb files contain? (C# / .NET)

匆匆过客 提交于 2020-01-10 09:49:49

问题


Is is wise to redistribute the pdb files along with a commercial application?

Occasionally, I'm using the stack trace to get a more detailed error reporting logs from the deployed applications; can this functionality be achieved without relying to those files?

Also, how much hints of the original source code does these files contain? Would it be easier to reverse-engineer my application using it?


回答1:


It basically adds information for:

  • All non-public types, interfaces, structures, classes
  • Local variables in functions
  • Source file names for relevant code and corresponding line numbers in source code.

which all combined makes reverse engineering very easy for native code.

Luckily you can create a stripped down version of your PDB files which only contains public information with /PDBSTRIPPED parameter.

Oh you edited to add C#/.NET, so I'm not sure if "PDBSTRIPPED" is applicable. However .NET applications are very easy to reverse engineer even without any symbol information. I wouldn't mind including them in a .NET project.




回答2:


You could try using dia2dump to look at the contents.




回答3:


The managed .pdb files contain the following information:

  • The names of all local variables
  • The names of all source code files and the mapping from IL instructions onto lines within those files.

Everything else is contained in the binary itself, including the names of all types, members and function arguments.

Source: PDB files: what every developer must know.




回答4:


The PDB-files also include all comments of your source files. So with EXE AND PDB-file it is possible to generate a 1:1-copy from your original source code.



来源:https://stackoverflow.com/questions/596512/how-much-information-do-pdb-files-contain-c-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!