Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Is it 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?

like image 896
Silver Dragon Avatar asked Feb 27 '09 20:02

Silver Dragon


3 Answers

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.

like image 138
Sedat Kapanoglu Avatar answered Oct 16 '22 03:10

Sedat Kapanoglu


You could try using dia2dump to look at the contents.

like image 20
Nick Avatar answered Oct 16 '22 03:10

Nick


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.

like image 25
Roman Starkov Avatar answered Oct 16 '22 03:10

Roman Starkov