使用 .Net Reflector 或其他工具确定 exe 的原始构建位置/路径

发布于 2024-08-20 04:13:37 字数 368 浏览 3 评论 0原文

我有一个 EXE 当前部署在我们的生产服务器 (c# .net 2) 上。我继承了对该应用程序进行一些更改并重新部署的任务。

我没有编写这个应用程序,有人指出了不同网络驱动器上的几个不同文件夹,其中包含一些不同的 Visual Studio 解决方案(~10),这些解决方案是这个应用程序随着时间的推移的各种咒语,并且可能是 Visual Studio 项目的竞争者用于生成此 exe,但我不知道使用哪个项目与生产中的 EXE 相匹配。

有没有办法使用 .net Reflector 或其他工具来确定源文件在用于编译 EXE 时所处的原始文件路径,然后我可以向后确定正确的 Visual Studio 解决方案并开始在那里做出改变。

谢谢

I have an EXE that is currently deployed on our production server (c# .net 2). I have inherited the task of making some changes to this app and re-deploying.

I didn't write this app and I have been pointed at a few different folders on various network drives with a few different Visual Studio solutions (~10) that were various incantations of this app through time and could be contenders for the Visual Studio project that was used to generate this exe but I don't know which project was used that matches the in production EXE.

Is there a way using .net Reflector or another tool to determine the original file path the source files lay when they were used to compile the EXE, I can then work backwards to determine the correct Visual Studio solution and start making changes there.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

忆梦 2024-08-27 04:13:37

如果您无法了解生产中运行的内容的起源,这听起来就像是一种糟糕的情况。

尽管如此,一种可能的解决方案是查看 .exe 程序集的调试头,如果它是使用调试符号编译的,它可能包含 pdb 的原始完整路径,让您了解它的构建位置。您可以使用 Windows sdk 中的 dumpbin 工具来获取它。

以下是输出示例:

  Debug Directories

        Time Type       Size      RVA  Pointer
    -------- ------ -------- -------- --------
    4A0F2A94 cv           51 0006672C    6492C    Format: RSDS, {77468AA8-8494-46AC-87DF-422721517504}, 8, C:\sources\mcs\class\Mono.Cecil\obj\Debug\Mono.Cecil.pdb

更好的是,如果您手边有 pdb,则可以使用 之类的工具pdbdump 了解哪些文件用于编译程序集。

That sounds like one hell of a situation if you can't get to know what's the origin of what's running in production.

Nonetheless, one possible solution is to have a look at the debug header of the .exe assembly, if it has been compiled with debug symbols, it may contain the original full path of the pdb, giving you a clue of where it has been built. You can get it with the dumpbin tool that is part of the windows sdk.

Here's an example of the output:

  Debug Directories

        Time Type       Size      RVA  Pointer
    -------- ------ -------- -------- --------
    4A0F2A94 cv           51 0006672C    6492C    Format: RSDS, {77468AA8-8494-46AC-87DF-422721517504}, 8, C:\sources\mcs\class\Mono.Cecil\obj\Debug\Mono.Cecil.pdb

Better yet, if you have the pdb handy, you can use a tool like pdbdump to know which files were used to compile the assembly.

又怨 2024-08-27 04:13:37

您最好的选择可能是使用 Reflector & http://www.codeplex.com/reflectoraddins 上的文件生成器插件之一用于转储代码到文件中。但在进行任何更改之前,请确保您可以重建。

Your best bet is probably to use Reflector & one of the file generator plugins at http://www.codeplex.com/reflectoraddins to dump the code into files. Before making any changes though, make sure you can rebuild.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文