DotPeek PDB generation for assemblies without debug directory

谁说我不能喝 提交于 2020-01-12 03:16:11

问题


I'm attempting to use JetBrains dotPeek 1.4 symbol server however I've encountered some 3rd party assemblies that fail, with dotPeek status of:

Pdb has not been generated because assembly does not contain debug directory

Using CFF Explorer I've discovered that these assemblies have empty "Debug Directory" Portable Executable (PE) header values.

Is there an (easy) way to edit the PE to add Debug Directory header values?


回答1:


de4dot creates invalid .net executable module in the eyes of dotPeek. It's problem of dotPeek, not de4dot, however. But since we do not have sources of dotPeek we ought to modify de4dot instead to achieve interoperability. Modify: de4dot.code/AssemblyModule.cs module adding

writerOptions.WritePdb = true;
module.CreatePdbState();

to de4dot.code.AssemblyModule.Save function and you fill have valid pdb function in exe module.

To save your time you can use de4dot project with my patch: https://github.com/earnol/de4dot/commit/24c6e696fb9251f7d048ac33c88c710013a649d6 It will add debug directory to the output executable. Just delete resulting PDB and run dotPeek again. It will work flawlessly. Use something like: de4dot.exe -f filein.exe -o fileout.exe -fpdb



来源:https://stackoverflow.com/questions/31299157/dotpeek-pdb-generation-for-assemblies-without-debug-directory

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