如何检查 exe 是否设置为 LARGEADDRESSAWARE
我正在开发一个 C# 程序,它将加载文件并获取加载文件的创建日期、修改日期、大小等信息。我需要知道的另一件事是加载的文件(executable.exe
)与 LARGEADDRESSAWARE
标志链接。 FileInfo 类不提供此信息。
有谁知道在 C# 中如何找出给定的可执行文件是否与 LARGEADDRESSAWARE
标志链接(以处理大于 2 GB 的地址)?
I am developing a C# program that will load files and get information such as loaded file created date, modification date, size etc. Another thing that I need to know is whether the loaded file (executable.exe
) is linked with the LARGEADDRESSAWARE
flag. The FileInfo class doesn't provide this information.
Does anyone know how in C# can I find out whether a given executable.exe is linked with the LARGEADDRESSAWARE
flag (to handle addresses larger than 2 GB)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
下面是一些检查大地址感知标志的代码。您所要做的就是传递一个指向可执行文件开头的流。
Here is some code that checks for the Large Address Aware flag. All you have to do is pass a stream that is pointed to the start of an executable.
/LARGEADDRESSAWARE 的 MSDN 文档
指出:如果您正在寻找一种以编程方式执行此操作的方法,您可以从应用程序中调用 dumpbin 并解析输出。
更新:
还有一篇很好的博客文章此处更深入地讨论了该问题。
The MSDN documentation for
/LARGEADDRESSAWARE
states:If you're looking for a way to do this programatically, you could invoke dumpbin from your application and parse the output.
Update:
There is also a good blog post here that discusses the issue in more depth.
根据上面 Will 的回答,我在 x86 安装包中使用了以下内容:
From Will's answer above I'm using the following in my x86 setup package: