DotPeek PDB生成用于没有调试目录的程序集

编程入门 行业动态 更新时间:2024-10-28 09:27:01
本文介绍了DotPeek PDB生成用于没有调试目录的程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我试图使用JetBrains dotPeek 1.4符号服务器,但是遇到一些第三方程序集失败,dotPeek状态为:

Pdb尚未生成,因为程序集不包含调试目录

使用CFF Explorer I发现这些程序集有空的调试目录可移植可执行文件(PE)头值。

有没有(简单)的方式来编辑PE添加调试目录标题值?

解决方案

de4dot在dotPeek眼中创建无效的可执行模块。但是,dotPeek不是de4dot的问题。但是由于我们没有dotPeek的来源,我们应该修改de4dot来实现互操作性。 修改:de4dot.code / AssemblyModule.cs模块添加

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

to de4dot.code.AssemblyModule.Save函数,您填写了exe模块中有效的pdb函数。为了节省您的时间,您可以使用de4dot项目与我的补丁: github/earnol/de4dot/commit/24c6e696fb9251f7d048ac33c88c710013a649d6 它将添加调试目录到输出可执行文件。只需删除生成的PDB并再次运行dotPeek。它将无瑕疵地工作。 使用像:de4dot.exe -f filein.exe -o fileout.exe -fpdb

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?

解决方案

de4dot creates invalid 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: github/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

更多推荐

DotPeek PDB生成用于没有调试目录的程序集

本文发布于:2023-11-13 09:40:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1584026.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:目录   程序   DotPeek   PDB

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!